diff --git a/README.md b/README.md index eef90d844..dbc6cd9bf 100644 --- a/README.md +++ b/README.md @@ -17,26 +17,70 @@

+## About Helsinki Events Monorepo + > Howtos for monorepo. New to monorepos ? [check this FAQ](./docs/howto/how-to.md). +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. + +### Why a Monorepo? + +The primary reason for using a monorepo is to streamline the development and deployment process for our applications. It offers several key advantages: + +- **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. + +- **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. + +- **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. + ## Architecture The subgraphs of multiple datasources are combined to a one supergraph with an app specific Apollo-Router instance. 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. 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. -``` -┌─────────────┐ ┌───────────────┐ ┌── Headless CMS (app specific datasource for the dynamic page and articles content) -│ │ │ │ ├── Unified-Search (Elasticsearch-service for search results scoring) -│ Application ├───────┤ Apollo Router ├───────├── Events GraphQL Proxy (A GraphQL-proxy for the LinkedEvents) -│ │ │ │ └── Venues GraphQL Proxy (A GraphQL-proxy for the Palvelukartta/Servicemap / "TPREK" Toimipaikkarekisteri) -└─────────────┘ └───────────────┘ +```mermaid +--- +title: Graph Service Diagram +--- +flowchart LR + subgraph Supergraph + ROUTER[**Events Graphql Federation**: *Apollo Router service to provide a supergraph*] + subgraph Subgraphs + EventsProxy["**Events GraphQL Proxy**: *A GraphQL-proxy for the LinkedEvents*"] + VenuesProxy["**Venues GraphQL Proxy**: *A GraphQL-proxy for the Palvelukartta/Servicemap / 'TPREK' Toimipaikkarekisteri*"] + CMS["**Headless CMS**: *App specific datasource for the dynamic page and articles content*"] + US["**Unified-Search**: *Elasticsearch-service for search results scoring*"] + end + end + + subgraph ExternalGraph["External services"] + LinkedEvents + Wordpress["Wordpress (Headless CMS)"] + Servicemap["Palvelukartta / Servicemap"] + Sentry + DigiaIiris + Askem + end + + Application --> ROUTER + Application --> Sentry + Application --> DigiaIiris + Application --> Askem + + ROUTER --> EventsProxy + ROUTER --> VenuesProxy + ROUTER --> CMS + ROUTER --> US + + EventsProxy --> LinkedEvents + VenuesProxy --> Servicemap + CMS --> Wordpress + US --> Servicemap ``` ## Structure -[![Open in Gitpod](https://img.shields.io/badge/Open%20In-Gitpod.io-%231966D2?style=for-the-badge&logo=gitpod)](https://gitpod.io/#https://github.com/City-of-Helsinki/events-helsinki-monorepo) - ``` . ├── proxies @@ -48,6 +92,7 @@ All the applications inside the monorepo are sharing the similar Apollo-Router i │ ├── hobbies-helsinki (i18n, ssr, api, vitest) │ ├── events-helsinki ("clone of hobbies-helsinki") │ └── sports-helsinki ("clone of hobbies-helsinki") +│ └── packages ├── common-i18n (locales...) ├── 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 g:clean` | Clean builds in all workspaces | | `yarn g:check-dist` | Ensure build dist files passes es2017 (run `g:build` first). | | `yarn g:check-size` | Ensure browser dist files are within size limit (run `g:build` first). | -| `yarn clean:global-cache` | Clean tooling caches (eslint, vitest...) | +| `yarn clean:global-cache` | Clean tooling caches (eslint, vitest...) | | `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)) | | `yarn deps:update --dep dev` | Apply possible updates (run `yarn install && yarn dedupe` after) | | `yarn check:install` | Verify if there's no peer-deps missing in packages | | `yarn dedupe` | Built-in yarn deduplication of the lock file | | `yarn build` | Builds application with rollup. | -| `yarn publish-canary` | Publishes a canary tagged version of the application. CD is configured to run this script on additions to the main branch. | > Why using `:` to prefix scripts names ? It's convenient in yarn 3+, we can call those scripts from any folder in the monorepo. > `g:` is a shortcut for `global:`. See the complete list in [root package.json](./package.json). @@ -284,6 +328,10 @@ Optinally it is possible revalidate one selected uri. Uri have to be exactly cor curl -X POST https://tapahtumat.test.hel.ninja/api/revalidate -H "Content-Type: application/json" -d '{"secret": "secretrevalidationtoken", "uri": "/fi"}' ``` +### 4.3 Updating pages and articles in CMS + +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! + ## 5. Quality ### 5.1 Linters diff --git a/apps/events-helsinki/README.md b/apps/events-helsinki/README.md index 9ab89855b..d74b0430e 100644 --- a/apps/events-helsinki/README.md +++ b/apps/events-helsinki/README.md @@ -8,14 +8,58 @@ Production server: https://tapahtumat.hel.fi (NOTE: this production server might 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. -## Architecture - -``` -┌─────────────┐ ┌───────────────┐ ┌── Headless CMS (app specific datasource for the dynamic page and articles content) -│ │ supergraph > │ │ subgraphs > ├── Unified-Search (Elasticsearch-service for search results scoring) -│ Application ├───────────────┤ Apollo Router ├─────────────├── Events GraphQL Proxy (A GraphQL-proxy for the LinkedEvents) -│ │ │ │ └── Venues GraphQL Proxy (A GraphQL-proxy for the Palvelukartta/Servicemap / "TPREK" Toimipaikkarekisteri) -└─────────────┘ └───────────────┘ +## Service architecture + +The service consists of: + +- **[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. +- **[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. +- **[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. +- **[LinkedEvents API](https://github.com/City-of-Helsinki/linkedevents):** A city of Helsinki centralized API for events. +- **[Unified Search](https://github.com/City-of-Helsinki/unified-search):** Provide search service for venues. +- **[Palvelukartta / Servicemap](https://servicemap.hel.fi):** Provides details for venues. +- **[Digia Iiris](https://iirishelp.digia.com/):** Web analytics (a [Matomo](https://matomo.org/) service). +- **[Sentry](https://sentry.io/):** A monitoring service. +- **[Askem](https://www.askem.com/):** A website feedback collection and analysis tool. + +```mermaid +--- +title: Graph Service Diagram +--- +flowchart LR + subgraph Supergraph + ROUTER[**Events Graphql Federation**: *Apollo Router service to provide a supergraph*] + subgraph Subgraphs + EventsProxy["**Events GraphQL Proxy**: *A GraphQL-proxy for the LinkedEvents*"] + VenuesProxy["**Venues GraphQL Proxy**: *A GraphQL-proxy for the Palvelukartta/Servicemap / 'TPREK' Toimipaikkarekisteri*"] + CMS["**Headless CMS**: *App specific datasource for the dynamic page and articles content*"] + US["**Unified-Search**: *Elasticsearch-service for search results scoring*"] + end + end + + subgraph ExternalGraph["External services"] + LinkedEvents + Wordpress["Wordpress (Headless CMS)"] + Servicemap["Palvelukartta / Servicemap"] + Sentry + DigiaIiris + Askem + end + + Application --> ROUTER + Application --> Sentry + Application --> DigiaIiris + Application --> Askem + + ROUTER --> EventsProxy + ROUTER --> VenuesProxy + ROUTER --> CMS + ROUTER --> US + + EventsProxy --> LinkedEvents + VenuesProxy --> Servicemap + CMS --> Wordpress + US --> Servicemap ``` ### Headless CMS datasources @@ -135,10 +179,6 @@ class AppConfig { 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. -## Contact - -City of Helsinki Slack channel _NO CHANNEL YET?_ (use #hobbieshelsinki) - ## Learn more You can learn more in the [NextJs documentation](https://nextjs.org/docs/getting-started). diff --git a/apps/hobbies-helsinki/README.md b/apps/hobbies-helsinki/README.md index cadd1d84a..06e8a022d 100644 --- a/apps/hobbies-helsinki/README.md +++ b/apps/hobbies-helsinki/README.md @@ -8,14 +8,58 @@ Production server: https://harrastukset.hel.fi 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). -## Architecture - -``` -┌─────────────┐ ┌───────────────┐ ┌── Headless CMS (app specific datasource for the dynamic page and articles content) -│ │ supergraph > │ │ subgraphs > ├── Unified-Search (Elasticsearch-service for search results scoring) -│ Application ├───────────────┤ Apollo Router ├─────────────├── Events GraphQL Proxy (A GraphQL-proxy for the LinkedEvents) -│ │ │ │ └── Venues GraphQL Proxy (A GraphQL-proxy for the Palvelukartta/Servicemap / "TPREK" Toimipaikkarekisteri) -└─────────────┘ └───────────────┘ +## Service architecture + +The service consists of: + +- **[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. +- **[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. +- **[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. +- **[LinkedEvents API](https://github.com/City-of-Helsinki/linkedevents):** A city of Helsinki centralized API for events. +- **[Unified Search](https://github.com/City-of-Helsinki/unified-search):** Provide search service for venues. +- **[Palvelukartta / Servicemap](https://servicemap.hel.fi):** Provides details for venues. +- **[Digia Iiris](https://iirishelp.digia.com/):** Web analytics (a [Matomo](https://matomo.org/) service). +- **[Sentry](https://sentry.io/):** A monitoring service. +- **[Askem](https://www.askem.com/):** A website feedback collection and analysis tool. + +```mermaid +--- +title: Graph Service Diagram +--- +flowchart LR + subgraph Supergraph + ROUTER[**Events Graphql Federation**: *Apollo Router service to provide a supergraph*] + subgraph Subgraphs + EventsProxy["**Events GraphQL Proxy**: *A GraphQL-proxy for the LinkedEvents*"] + VenuesProxy["**Venues GraphQL Proxy**: *A GraphQL-proxy for the Palvelukartta/Servicemap / 'TPREK' Toimipaikkarekisteri*"] + CMS["**Headless CMS**: *App specific datasource for the dynamic page and articles content*"] + US["**Unified-Search**: *Elasticsearch-service for search results scoring*"] + end + end + + subgraph ExternalGraph["External services"] + LinkedEvents + Wordpress["Wordpress (Headless CMS)"] + Servicemap["Palvelukartta / Servicemap"] + Sentry + DigiaIiris + Askem + end + + Application --> ROUTER + Application --> Sentry + Application --> DigiaIiris + Application --> Askem + + ROUTER --> EventsProxy + ROUTER --> VenuesProxy + ROUTER --> CMS + ROUTER --> US + + EventsProxy --> LinkedEvents + VenuesProxy --> Servicemap + CMS --> Wordpress + US --> Servicemap ``` ### Headless CMS datasources @@ -135,10 +179,6 @@ class AppConfig { 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. -## Contact - -City of Helsinki Slack channel #hobbieshelsinki - ## Learn more You can learn more in the [NextJs documentation](https://nextjs.org/docs/getting-started). diff --git a/apps/sports-helsinki/README.md b/apps/sports-helsinki/README.md index d3ae753c1..4de505255 100644 --- a/apps/sports-helsinki/README.md +++ b/apps/sports-helsinki/README.md @@ -8,14 +8,58 @@ Production server: https://liikunta.hel.fi (NOTE: this production server might s 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. -## Architecture +## Service architecture -``` -┌─────────────┐ ┌───────────────┐ ┌── Headless CMS (app specific datasource for the dynamic page and articles content) -│ │ supergraph > │ │ subgraphs > ├── Unified-Search (Elasticsearch-service for search results scoring) -│ Application ├───────────────┤ Apollo Router ├─────────────├── Events GraphQL Proxy (A GraphQL-proxy for the LinkedEvents) -│ │ │ │ └── Venues GraphQL Proxy (A GraphQL-proxy for the Palvelukartta/Servicemap / "TPREK" Toimipaikkarekisteri) -└─────────────┘ └───────────────┘ +The service consists of: + +- **[Sports-Helsinki](https://github.com/City-of-Helsinki/events-helsinki-monorepo/apps/sports-helsinki):** The NextJS / React application. Integrates to a supergraph of Events Feration Router that provides subgraphs to get dynamic CMS content, venues and events. +- **[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. +- **[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. +- **[LinkedEvents API](https://github.com/City-of-Helsinki/linkedevents):** A city of Helsinki centralized API for events. +- **[Unified Search](https://github.com/City-of-Helsinki/unified-search):** Provide search service for venues. +- **[Palvelukartta / Servicemap](https://servicemap.hel.fi):** Provides details for venues. +- **[Digia Iiris](https://iirishelp.digia.com/):** Web analytics (a [Matomo](https://matomo.org/) service). +- **[Sentry](https://sentry.io/):** A monitoring service. +- **[Askem](https://www.askem.com/):** A website feedback collection and analysis tool. + +```mermaid +--- +title: Graph Service Diagram +--- +flowchart LR + subgraph Supergraph + ROUTER[**Events Graphql Federation**: *Apollo Router service to provide a supergraph*] + subgraph Subgraphs + EventsProxy["**Events GraphQL Proxy**: *A GraphQL-proxy for the LinkedEvents*"] + VenuesProxy["**Venues GraphQL Proxy**: *A GraphQL-proxy for the Palvelukartta/Servicemap / 'TPREK' Toimipaikkarekisteri*"] + CMS["**Headless CMS**: *App specific datasource for the dynamic page and articles content*"] + US["**Unified-Search**: *Elasticsearch-service for search results scoring*"] + end + end + + subgraph ExternalGraph["External services"] + LinkedEvents + Wordpress["Wordpress (Headless CMS)"] + Servicemap["Palvelukartta / Servicemap"] + Sentry + DigiaIiris + Askem + end + + Application --> ROUTER + Application --> Sentry + Application --> DigiaIiris + Application --> Askem + + ROUTER --> EventsProxy + ROUTER --> VenuesProxy + ROUTER --> CMS + ROUTER --> US + + EventsProxy --> LinkedEvents + VenuesProxy --> Servicemap + CMS --> Wordpress + US --> Servicemap ``` ### Headless CMS datasources @@ -136,21 +180,41 @@ if this would be the final active implementation of the type, the [CombinedSearc When an URL is given as an input, a form search adapter picks the params to initialize a search form. The form values should always be in sync with the URL. The search specific adapters are used to map the form values to the actual search inputs. _In this visualization, the URL params are just some examples and may not be synced with the actual implementation._ -``` -┌──────────────────────────────┐ ┌────────────────────────────┐ ┌─────────────────┐ -| Form adapter ├─────┤ Venue search adapter ├────┤ Unified-Search | -|==============================| |============================| |=================| -| Given URL as an input | | Converted param | | Responds to | -| e.g /search?text=football& | | e.g /graphql?q=football | | param `q` | -| returnPath=/ | └────────────────────────────┘ └─────────────────┘ -| | -| Makes queries to multiple | -| datasources | ┌────────────────────────────┐ ┌─────────────────┐ -| |─────┤ Event search adapter |────┤ LinkedEvents | -| | |============================| |=================| -| | | Converted param | | Responds to | -| | | e.g /graphql?text=football | | param `text` | -└──────────────────────────────┘ └────────────────────────────┘ └─────────────────┘ +```mermaid +--- +title: Search Component Architecture +--- +graph LR + subgraph FormAdapter ["Form adapter"] + direction TB + F1["Given URL as an input e.g. '/search?text=football&returnPath=/'"] + F2["Makes queries to multiple datasources"] + end + + subgraph VenueSearchAdapter ["Venue search adapter"] + direction TB + V1["Converted param e.g. '/graphql?q=football'"] + end + + subgraph UnifiedSearch ["Unified-Search"] + direction TB + U1["Responds to param 'q'"] + end + + subgraph EventSearchAdapter ["Event search adapter"] + direction TB + E1["Converted param e.g. '/graphql?text=football'"] + end + + subgraph LinkedEvents ["LinkedEvents"] + direction TB + L1["Responds to param 'text'"] + end + + FormAdapter --> VenueSearchAdapter + FormAdapter --> EventSearchAdapter + VenueSearchAdapter --> UnifiedSearch + EventSearchAdapter --> LinkedEvents ``` CombinedSearchPage.tsx @@ -301,10 +365,6 @@ class AppConfig { 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. -## Contact - -City of Helsinki Slack channel #hobbieshelsinki - ## Learn more You can learn more in the [NextJs documentation](https://nextjs.org/docs/getting-started). diff --git a/packages/components/src/edge-runtime-compatible/README.md b/packages/components/src/edge-runtime-compatible/README.md index f376ed911..8f658f959 100644 --- a/packages/components/src/edge-runtime-compatible/README.md +++ b/packages/components/src/edge-runtime-compatible/README.md @@ -1,10 +1,10 @@ ## Edge runtime compatible source code -Basically for [Next.js's middleware compatibility](https://nextjs.org/docs/pages/building-your-application/routing/middleware#runtime): +Basically for [Next.js's middleware compatibility](https://nextjs.org/docs/pages/api-reference/file-conventions/middleware#runtime): > Middleware currently only supports the Edge runtime. See - https://nextjs.org/docs/pages/api-reference/edge -- https://nextjs.org/docs/pages/building-your-application/routing/middleware +- https://nextjs.org/docs/pages/api-reference/file-conventions/middleware#runtime diff --git a/packages/eslint-config-bases/README.md b/packages/eslint-config-bases/README.md index ab43e2e6a..b9fe5d23e 100644 --- a/packages/eslint-config-bases/README.md +++ b/packages/eslint-config-bases/README.md @@ -46,14 +46,16 @@ You can find the bases in [./src/bases](./src/bases). | Base | Match convention | Scope | | :---------------------------------------------- | :-------------------------------- | :-------------------------------------------------------------- | | [typescript](./src/bases/typescript.js) | _all_ | Naming conventions, consistent imports, import sorting... | -| [sonar](./src/bases/testcafe.js) | `*.testcafe.ts` | Common rules for best practices when writing tests for TestCafe | -| [regexp](./src/bases/regexp.js) | `*.{js,jsx,jsx,tsx}` | Keep regexp consistent and safer. | -| [react](./src/bases/react.js) | `*.{jsx,tsx}` | Recommendations for react, react-hooks and jsx projects. | -| [jest](./src/bases/jest.js) | `**/?(*.)+(test).{js,jsx,ts,tsx}` | Catch inconsistencies or error in jest tests. | +| [sonar](./src/bases/testcafe.js) | `*.{js,jsx,ts,tsx}` | Common rules for best practices when writing tests for TestCafe | +| [regexp](./src/bases/regexp.js) | _all_ | Keep regexp consistent and safer. | +| [react](./src/bases/react.js) | `**/*.{js,jsx,ts,tsx}` | Recommendations for react, react-hooks and jsx projects. | +| [vitest](./src/bases/vitest.js) | `**/?(*.)+(test).{js,jsx,ts,tsx}` | Catch inconsistencies or error in vitest tests. | | [rtl](./src/bases/rtl.js) | `**/?(*.)+(test).{js,jsx,ts,tsx}` | Potential errors / deprecations in react-testing-library tests. | | [graphql-schema](./src/bases/graphql-schema.js) | `*.graphql` | Ensure validity of graphql schema files. | | [storybook](./src/bases/storybook.js) | `*.stories.{ts,tsx,mdx}` | Potential errors / deprecations in stories. | +| [testcafe](./src/bases/testcafe.js) | `browser-tests/**/*.ts` | Potential errors / deprecations in browser tests. | | [prettier](./src/bases/prettier.js) | _all_ | Post configure eslint for prettier compatibility. | +| [stylistic](./src/bases/stylistic.js) | `**/*.{js,jsx,ts,tsx}` | Rules that focus on style concerns. | > **Notes**: > @@ -64,77 +66,3 @@ You can find the bases in [./src/bases](./src/bases). > - Based on filename conventions some rules are relaxed or disabled to avoid false positives and > keep a good level of performance. For example the [sonar base](./src/bases/sonar.js) won't run on > test and storybook files. If you work on different conventions the patterns must be updated. - -## Prettier integration - -To prevent conflicts between prettier and eslint, you must re-export the prettier base from `@events-helsinki/eslint-config-bases`. - -```javascript -const { - getPrettierConfig, -} = require("@events-helsinki/eslint-config-bases/helpers"); -module.exports = { - ...prettierConfig, - overrides: [ - // whatever you need - ], -}; -``` - -> **Tip**: You can tune the provided [prettier.base.config](./src/prettier.base.config.js) for your own needs. - -## Notes - -### Typescript - -Generic typescript project, mostly based on - -| Type/Plugin | Comment | -| :----------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------- | -| [eslint:recommended](https://eslint.org/docs/rules/) | The basics for code linting. | -| [@typescript-eslint/recommended](https://typescript-eslint.io/rules/) | The basics for typescript. | -| [@typescript-eslint/consistent-type](https://typescript-eslint.io/rules/consistent-type-imports) | Use TS 3.8+ imports/exports, helps with [esbuild](https://esbuild.github.io) | -| [@typescript-eslint/naming-convention](https://typescript-eslint.io/rules/naming-convention) | | -| [eslint-plugin-import](https://github.com/import-js/eslint-plugin-import) | Order imports | - -## Sonarjs - -| Type/Plugin | Comment | -| :---------------------------------------------------------------------------------------- | :--------------------------- | -| [eslint-plugin-sonarjs/recommended](https://github.com/SonarSource/eslint-plugin-sonarjs) | Help to keep complexity sane | - -### React - -| Type/Plugin | Comment | -| :---------------------------------------------------------------------------------------------------------------------- | :--------------------------------------- | -| [eslint-plugin-react/recommended](https://github.com/yannickcr/eslint-plugin-react) | | -| [eslint-plugin-react-hooks/recommended](https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks) | | -| [eslint-plugin-jsx-a11y/recommended](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y) | Helps to produce accessibility-ready jsx | - -### Jest - -| Type/Plugin | Comment | -| :------------------------------------------------------------------------------------- | :-------------------------- | -| [eslint-plugin-jest/recommended](https://github.com/jest-community/eslint-plugin-jest) | Jest recommended practices. | - -### React Testing Library - -| Type/Plugin | Comment | -| :------------------------------------------------------------------------------------------------------------ | :------------------------------------ | -| [eslint-plugin-testing-library/recommended](https://github.com/testing-library/eslint-plugin-testing-library) | Ease when using react-testing-library | - -### Testcafe - -| Type/Plugin | Comment | -| :----------------------------------------------------------------------------------------------- | :------------------------------------------------------- | -| [testcafe-community/recommended](https://www.npmjs.com/package/eslint-plugin-testcafe-community) | Rules for best practices when writing tests for TestCafe | - -### Regexp - -| Type/Plugin | Comment | -| :------------------------------------------------------------------------------------ | :------ | -| [eslint-plugin-regexp/recommended](https://github.com/ota-meshi/eslint-plugin-regexp) | | - -### Etc - -... diff --git a/proxies/events-graphql-federation/README.md b/proxies/events-graphql-federation/README.md index 634935e40..b93c1f977 100644 --- a/proxies/events-graphql-federation/README.md +++ b/proxies/events-graphql-federation/README.md @@ -2,12 +2,16 @@ The Events GraphQL Federation is a project for a Apollo federation supergraph (and subgraphs) and the Apollo Router configuration. -``` -┌─────────────┐ ┌───────────────┐ ┌── Headless CMS (app specific datasource for the dynamic page and articles content) -│ │ supergraph > │ │ subgraphs > ├── Unified-Search (Elasticsearch-service for search results scoring) -│ Application ├───────────────┤ Apollo Router ├─────────────├── Events GraphQL Proxy (A GraphQL-proxy for the LinkedEvents) -│ │ │ │ └── Venues GraphQL Proxy (A GraphQL-proxy for the Palvelukartta/Servicemap / "TPREK" Toimipaikkarekisteri) -└─────────────┘ └───────────────┘ +```mermaid +--- +title: Graph Service Diagram +--- +graph LR + APP[Application] --supergraph--> ROUTER[Apollo Router] + ROUTER --subgraph--> CMS["**Headless CMS**: *App specific datasource for the dynamic page and articles content*"] + ROUTER --subgraph--> US["**Unified-Search**: *Elasticsearch-service for search results scoring*"] + ROUTER --subgraph--> EVENTS["**Events GraphQL Proxy**: *A GraphQL-proxy for the LinkedEvents*"] + ROUTER --subgraph--> VENUES["**Venues GraphQL Proxy**: *A GraphQL-proxy for the Palvelukartta/Servicemap / 'TPREK' Toimipaikkarekisteri*"] ``` **For more detailed documentation, please read the documentation maintained by the Apollo team!**