You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: misc updates, mermaid graphs and improved architecture
TH-1422.
Converted DITAA formatted ASCII charts to Mermaid charts. Added more
information about the service architecture. E.g. external services are
now in their own subgraph.
Miscallenous fixes and updates to README files:
- Fixed some URLs
- Added some eslint configurations
- Removed some nonsense text
- etc.
Copy file name to clipboardExpand all lines: README.md
+58-10Lines changed: 58 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,26 +17,70 @@
17
17
</a>
18
18
</p>
19
19
20
+
## About Helsinki Events Monorepo
21
+
20
22
> Howtos for monorepo. New to monorepos ? [check this FAQ](./docs/howto/how-to.md).
21
23
24
+
The Helsinki Events Monorepo is a version control system for three related applications: Events-Helsinki, Hobbies-Helsinki, and Sports-Helsinki. These are React/Next.js-based applications that allow citizens to discover events, courses, hobbies, and activities in Helsinki. The monorepo also contains the shared services, libraries, and components used across these applications.
25
+
26
+
### Why a Monorepo?
27
+
28
+
The primary reason for using a monorepo is to streamline the development and deployment process for our applications. It offers several key advantages:
29
+
30
+
-**Shared Code and Resources**: Instead of maintaining separate repositories for each app, a monorepo allows us to centralize and easily share common code, components, and services. This reduces duplication and ensures consistency across all three applications.
31
+
32
+
-**Simplified Dependencies**: With a single repository, managing dependencies between the applications and shared libraries becomes much simpler. Developers can make changes to a shared library and see the effects on all dependent applications in one place.
33
+
34
+
-**Atomic Commits**: This allows for a single commit that spans multiple projects. For example, a single pull request can include a new feature in a shared library and the corresponding updates in all three applications that use it. This prevents versioning issues and ensures everything works together.
35
+
22
36
## Architecture
23
37
24
38
The subgraphs of multiple datasources are combined to a one supergraph with an app specific Apollo-Router instance.
25
39
An application (Events, Hobbies, Sports) uses the app specific Apollo-Router so the app gets all the datasources in use with a single Apollo-Client.
26
40
All the applications inside the monorepo are sharing the similar Apollo-Router in means of structure, but since there are app specific Headless CMS instances to share app specific data, each of the applications are connected to a unique environment-app-specific router instances.
27
41
28
-
```
29
-
┌─────────────┐ ┌───────────────┐ ┌── Headless CMS (app specific datasource for the dynamic page and articles content)
│ Application ├───────┤ Apollo Router ├───────├── Events GraphQL Proxy (A GraphQL-proxy for the LinkedEvents)
32
-
│ │ │ │ └── Venues GraphQL Proxy (A GraphQL-proxy for the Palvelukartta/Servicemap / "TPREK" Toimipaikkarekisteri)
33
-
└─────────────┘ └───────────────┘
42
+
```mermaid
43
+
---
44
+
title: Graph Service Diagram
45
+
---
46
+
flowchart LR
47
+
subgraph Supergraph
48
+
ROUTER[**Events Graphql Federation**: *Apollo Router service to provide a supergraph*]
49
+
subgraph Subgraphs
50
+
EventsProxy["**Events GraphQL Proxy**: *A GraphQL-proxy for the LinkedEvents*"]
51
+
VenuesProxy["**Venues GraphQL Proxy**: *A GraphQL-proxy for the Palvelukartta/Servicemap / 'TPREK' Toimipaikkarekisteri*"]
52
+
CMS["**Headless CMS**: *App specific datasource for the dynamic page and articles content*"]
53
+
US["**Unified-Search**: *Elasticsearch-service for search results scoring*"]
54
+
end
55
+
end
56
+
57
+
subgraph ExternalGraph["External services"]
58
+
LinkedEvents
59
+
Wordpress["Wordpress (Headless CMS)"]
60
+
Servicemap["Palvelukartta / Servicemap"]
61
+
Sentry
62
+
DigiaIiris
63
+
Askem
64
+
end
65
+
66
+
Application --> ROUTER
67
+
Application --> Sentry
68
+
Application --> DigiaIiris
69
+
Application --> Askem
70
+
71
+
ROUTER --> EventsProxy
72
+
ROUTER --> VenuesProxy
73
+
ROUTER --> CMS
74
+
ROUTER --> US
75
+
76
+
EventsProxy --> LinkedEvents
77
+
VenuesProxy --> Servicemap
78
+
CMS --> Wordpress
79
+
US --> Servicemap
34
80
```
35
81
36
82
## Structure
37
83
38
-
[](https://gitpod.io/#https://github.com/City-of-Helsinki/events-helsinki-monorepo)
39
-
40
84
```
41
85
.
42
86
├── proxies
@@ -48,6 +92,7 @@ All the applications inside the monorepo are sharing the similar Apollo-Router i
48
92
│ ├── hobbies-helsinki (i18n, ssr, api, vitest)
49
93
│ ├── events-helsinki ("clone of hobbies-helsinki")
50
94
│ └── sports-helsinki ("clone of hobbies-helsinki")
95
+
│
51
96
└── packages
52
97
├── common-i18n (locales...)
53
98
├── components (common event components, utils and hooks, storybook, vitest)
@@ -167,13 +212,12 @@ Some convenience scripts can be run in any folder of this repo and will call the
|`yarn deps:check --dep dev`| Will print what packages can be upgraded globally (see also [.ncurc.yml](https://github.com/sortlist/packages/blob/main/.ncurc.yml)) |
INFO: The headless CMS that the apps are using (Wordpress), should trigger the revalidation process automatically, by sending a request when a save button is clicked!
Copy file name to clipboardExpand all lines: apps/events-helsinki/README.md
+52-12Lines changed: 52 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,14 +8,58 @@ Production server: https://tapahtumat.hel.fi (NOTE: this production server might
8
8
9
9
This is a [Next.js](https://nextjs.org/) project originally bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app), but cloned from the Hobbies-Helsinki.
10
10
11
-
## Architecture
12
-
13
-
```
14
-
┌─────────────┐ ┌───────────────┐ ┌── Headless CMS (app specific datasource for the dynamic page and articles content)
│ Application ├───────────────┤ Apollo Router ├─────────────├── Events GraphQL Proxy (A GraphQL-proxy for the LinkedEvents)
17
-
│ │ │ │ └── Venues GraphQL Proxy (A GraphQL-proxy for the Palvelukartta/Servicemap / "TPREK" Toimipaikkarekisteri)
18
-
└─────────────┘ └───────────────┘
11
+
## Service architecture
12
+
13
+
The service consists of:
14
+
15
+
-**[Events-Helsinki](https://github.com/City-of-Helsinki/events-helsinki-monorepo/apps/events-helsinki):** The NextJS / React application. Integrates to a supergraph of Events Feration Router that provides subgraphs to get dynamic CMS content and events.
16
+
-**[Events Graphql Federation](https://github.com/City-of-Helsinki/events-helsinki-monorepo/proxies/events-graphql-federation):**[Apollo Router](https://www.apollographql.com/docs/graphos/routing) to provide a supergraph.
17
+
-**[Headless CMS](https://github.com/City-of-Helsinki/headless-cms):** Content Management Service that provides dynamic pages and dynamic content for the teachers' UI. It also provides content for the header and the footer. A React component library can be found from https://github.com/City-of-Helsinki/react-helsinki-headless-cms.
18
+
-**[LinkedEvents API](https://github.com/City-of-Helsinki/linkedevents):** A city of Helsinki centralized API for events.
19
+
-**[Unified Search](https://github.com/City-of-Helsinki/unified-search):** Provide search service for venues.
20
+
-**[Palvelukartta / Servicemap](https://servicemap.hel.fi):** Provides details for venues.
21
+
-**[Digia Iiris](https://iirishelp.digia.com/):** Web analytics (a [Matomo](https://matomo.org/) service).
22
+
-**[Sentry](https://sentry.io/):** A monitoring service.
23
+
-**[Askem](https://www.askem.com/):** A website feedback collection and analysis tool.
24
+
25
+
```mermaid
26
+
---
27
+
title: Graph Service Diagram
28
+
---
29
+
flowchart LR
30
+
subgraph Supergraph
31
+
ROUTER[**Events Graphql Federation**: *Apollo Router service to provide a supergraph*]
32
+
subgraph Subgraphs
33
+
EventsProxy["**Events GraphQL Proxy**: *A GraphQL-proxy for the LinkedEvents*"]
34
+
VenuesProxy["**Venues GraphQL Proxy**: *A GraphQL-proxy for the Palvelukartta/Servicemap / 'TPREK' Toimipaikkarekisteri*"]
35
+
CMS["**Headless CMS**: *App specific datasource for the dynamic page and articles content*"]
36
+
US["**Unified-Search**: *Elasticsearch-service for search results scoring*"]
37
+
end
38
+
end
39
+
40
+
subgraph ExternalGraph["External services"]
41
+
LinkedEvents
42
+
Wordpress["Wordpress (Headless CMS)"]
43
+
Servicemap["Palvelukartta / Servicemap"]
44
+
Sentry
45
+
DigiaIiris
46
+
Askem
47
+
end
48
+
49
+
Application --> ROUTER
50
+
Application --> Sentry
51
+
Application --> DigiaIiris
52
+
Application --> Askem
53
+
54
+
ROUTER --> EventsProxy
55
+
ROUTER --> VenuesProxy
56
+
ROUTER --> CMS
57
+
ROUTER --> US
58
+
59
+
EventsProxy --> LinkedEvents
60
+
VenuesProxy --> Servicemap
61
+
CMS --> Wordpress
62
+
US --> Servicemap
19
63
```
20
64
21
65
### Headless CMS datasources
@@ -135,10 +179,6 @@ class AppConfig {
135
179
136
180
The application configuration is done via the [AppConfig.ts](./src/domain/app/AppConfig.ts) as much as possible, so there would be a single point to configure it.
137
181
138
-
## Contact
139
-
140
-
City of Helsinki Slack channel _NO CHANNEL YET?_ (use #hobbieshelsinki)
141
-
142
182
## Learn more
143
183
144
184
You can learn more in the [NextJs documentation](https://nextjs.org/docs/getting-started).
Copy file name to clipboardExpand all lines: apps/hobbies-helsinki/README.md
+52-12Lines changed: 52 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,14 +8,58 @@ Production server: https://harrastukset.hel.fi
8
8
9
9
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
10
10
11
-
## Architecture
12
-
13
-
```
14
-
┌─────────────┐ ┌───────────────┐ ┌── Headless CMS (app specific datasource for the dynamic page and articles content)
│ Application ├───────────────┤ Apollo Router ├─────────────├── Events GraphQL Proxy (A GraphQL-proxy for the LinkedEvents)
17
-
│ │ │ │ └── Venues GraphQL Proxy (A GraphQL-proxy for the Palvelukartta/Servicemap / "TPREK" Toimipaikkarekisteri)
18
-
└─────────────┘ └───────────────┘
11
+
## Service architecture
12
+
13
+
The service consists of:
14
+
15
+
-**[Hobbies-Helsinki](https://github.com/City-of-Helsinki/events-helsinki-monorepo/apps/hobbies-helsinki):** The NextJS / React application. Integrates to a supergraph of Events Feration Router that provides subgraphs to get dynamic CMS content and courses.
16
+
-**[Events Graphql Federation](https://github.com/City-of-Helsinki/events-helsinki-monorepo/proxies/events-graphql-federation):**[Apollo Router](https://www.apollographql.com/docs/graphos/routing) to provide a supergraph.
17
+
-**[Headless CMS](https://github.com/City-of-Helsinki/headless-cms):** Content Management Service that provides dynamic pages and dynamic content for the teachers' UI. It also provides content for the header and the footer. A React component library can be found from https://github.com/City-of-Helsinki/react-helsinki-headless-cms.
18
+
-**[LinkedEvents API](https://github.com/City-of-Helsinki/linkedevents):** A city of Helsinki centralized API for events.
19
+
-**[Unified Search](https://github.com/City-of-Helsinki/unified-search):** Provide search service for venues.
20
+
-**[Palvelukartta / Servicemap](https://servicemap.hel.fi):** Provides details for venues.
21
+
-**[Digia Iiris](https://iirishelp.digia.com/):** Web analytics (a [Matomo](https://matomo.org/) service).
22
+
-**[Sentry](https://sentry.io/):** A monitoring service.
23
+
-**[Askem](https://www.askem.com/):** A website feedback collection and analysis tool.
24
+
25
+
```mermaid
26
+
---
27
+
title: Graph Service Diagram
28
+
---
29
+
flowchart LR
30
+
subgraph Supergraph
31
+
ROUTER[**Events Graphql Federation**: *Apollo Router service to provide a supergraph*]
32
+
subgraph Subgraphs
33
+
EventsProxy["**Events GraphQL Proxy**: *A GraphQL-proxy for the LinkedEvents*"]
34
+
VenuesProxy["**Venues GraphQL Proxy**: *A GraphQL-proxy for the Palvelukartta/Servicemap / 'TPREK' Toimipaikkarekisteri*"]
35
+
CMS["**Headless CMS**: *App specific datasource for the dynamic page and articles content*"]
36
+
US["**Unified-Search**: *Elasticsearch-service for search results scoring*"]
37
+
end
38
+
end
39
+
40
+
subgraph ExternalGraph["External services"]
41
+
LinkedEvents
42
+
Wordpress["Wordpress (Headless CMS)"]
43
+
Servicemap["Palvelukartta / Servicemap"]
44
+
Sentry
45
+
DigiaIiris
46
+
Askem
47
+
end
48
+
49
+
Application --> ROUTER
50
+
Application --> Sentry
51
+
Application --> DigiaIiris
52
+
Application --> Askem
53
+
54
+
ROUTER --> EventsProxy
55
+
ROUTER --> VenuesProxy
56
+
ROUTER --> CMS
57
+
ROUTER --> US
58
+
59
+
EventsProxy --> LinkedEvents
60
+
VenuesProxy --> Servicemap
61
+
CMS --> Wordpress
62
+
US --> Servicemap
19
63
```
20
64
21
65
### Headless CMS datasources
@@ -135,10 +179,6 @@ class AppConfig {
135
179
136
180
The application configuration is done via the [AppConfig.ts](./src/domain/app/AppConfig.ts) as much as possible, so there would be a single point to configure it.
137
181
138
-
## Contact
139
-
140
-
City of Helsinki Slack channel #hobbieshelsinki
141
-
142
182
## Learn more
143
183
144
184
You can learn more in the [NextJs documentation](https://nextjs.org/docs/getting-started).
0 commit comments