From 39ad0028949e013a5f02c6c84e909690cdac3d7e Mon Sep 17 00:00:00 2001 From: panosdb Date: Thu, 13 Jun 2024 13:21:04 +0300 Subject: [PATCH 1/4] Document the codebase --- README.md | 53 ++++++++++++++++++++++++-- docs/Deanslist-Architecture.drawio.svg | 4 ++ 2 files changed, 54 insertions(+), 3 deletions(-) create mode 100644 docs/Deanslist-Architecture.drawio.svg diff --git a/README.md b/README.md index 18d80b1..527eaf0 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Deanslist Platform +\_# Deanslist Platform ## Getting Started @@ -87,6 +87,52 @@ pnpm dev:web pnpm dev:sdk ``` +## Explaining the codebase + +This codebase is a [Nx Monorepo](https://nx.dev/). + +It includes: + +1. 2 app projects: `api`, `web` +2. 2 e2e projects: `api-e2e`, `web-e2e` +3. 2 lib projects: `sdk`, `tools` + +It is utilizing the below technologies for ease of development: + +- Database: [PostgreSQL](https://www.postgresql.org/) +- Schema and database management: [Prisma](https://www.prisma.io/) +- E2E APIs: [GraphQL](https://graphql.org/) +- UI library: [Mantine](https://mantine.dev/) + +The diagram below show the dataflow E2E. + +![Architecture](docs/Deanslist-Architecture.drawio.svg) + +To get a detailed code structure run: + +```shell +pnpm nx graph +``` + +### API code + +The backend code is located under `./libs/api`. + +- The `core` folder includes framework related and reusable functionality, e.g. app configuration, pagination, etc... +- Each app `` has its own folder, `./libs/api/` + - the `data-access` folder has code to interact with the database + - the `feature` folder has code to return data to the UI + +### WEB code + +The WEB code is located under `./libs/web`. + +- The `core` folder includes framework related and reusable functionality, e.g. components, etc... +- Each app `` has its own folder, `./libs/web/` + - the `data-access` folder has code to get data from the API + - the `feature` folder sets up the routes and the pages + - the `ui` folder holds simple UI elements to be used in the `feature` code + ## Extending the application You can use the following commands to generate new models, API features, web features and SDK types. @@ -143,7 +189,7 @@ pnpm nx g web-feature company Output: -```shell +````shell > NX Generating @deanslist-platform/tools:web-feature CREATE libs/web/company/data-access/... @@ -151,4 +197,5 @@ CREATE libs/web/company/feature/... CREATE libs/web/company/ui/... UPDATE libs/web/shell/feature/src/lib/shell-admin-routes.tsx UPDATE tsconfig.base.json -``` +```_ +```` diff --git a/docs/Deanslist-Architecture.drawio.svg b/docs/Deanslist-Architecture.drawio.svg new file mode 100644 index 0000000..1ce1538 --- /dev/null +++ b/docs/Deanslist-Architecture.drawio.svg @@ -0,0 +1,4 @@ + + + +
WEB
(./libs/webs)
WEB...
API
(./libs/api)
API...
Manage Schema
Data Interaction
Manage Schema...
DTO
DTO
<ENTITY>/data-access
<ENTITY>/data-access
Entity
Entity
<ENTITY>/feature
<ENTITY>/feature
<ENTITY>/data-access
<ENTITY>/data-access
<ENTITY>/feature
<ENTITY>/feature
<ENTITY>/ui
<ENTITY>/ui
./api-schema.graphql
./api-schema.graphql
core/ui
core/ui
\ No newline at end of file From 75bd5a169c2524d365b676b5c2c2439bab61039f Mon Sep 17 00:00:00 2001 From: panosdb Date: Thu, 13 Jun 2024 13:23:15 +0300 Subject: [PATCH 2/4] Fix changes --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 527eaf0..defb31c 100644 --- a/README.md +++ b/README.md @@ -189,7 +189,7 @@ pnpm nx g web-feature company Output: -````shell +```shell > NX Generating @deanslist-platform/tools:web-feature CREATE libs/web/company/data-access/... @@ -197,5 +197,4 @@ CREATE libs/web/company/feature/... CREATE libs/web/company/ui/... UPDATE libs/web/shell/feature/src/lib/shell-admin-routes.tsx UPDATE tsconfig.base.json -```_ -```` +``` From 914f0484d4d0f66429cbbc43cf03bd7fc026a37d Mon Sep 17 00:00:00 2001 From: panosdb Date: Thu, 13 Jun 2024 13:23:44 +0300 Subject: [PATCH 3/4] Fix changes --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index defb31c..83abb00 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -\_# Deanslist Platform +# Deanslist Platform ## Getting Started From 6f03ff14c5b2c23c9f8a66b317406b60404eab09 Mon Sep 17 00:00:00 2001 From: panosdb Date: Thu, 13 Jun 2024 13:27:42 +0300 Subject: [PATCH 4/4] Fix error --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 83abb00..1720657 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,7 @@ It is utilizing the below technologies for ease of development: - E2E APIs: [GraphQL](https://graphql.org/) - UI library: [Mantine](https://mantine.dev/) -The diagram below show the dataflow E2E. +The diagram below shows the dataflow E2E. ![Architecture](docs/Deanslist-Architecture.drawio.svg)