Improve Documentation (#3795)

* Begin docs improvement

* Keep improving documentation

* Upgrade Docusarus

* Fix broken links
This commit is contained in:
Félix Malfait
2024-02-05 15:01:37 +01:00
committed by GitHub
parent 6748dfebc4
commit a5989a470c
91 changed files with 1045 additions and 895 deletions

View File

@ -1,3 +1,5 @@
{
"position": 4
"position": 4,
"collapsible": true,
"collapsed": true
}

View File

@ -1,4 +0,0 @@
{
"label": "Basics",
"position": 1
}

View File

@ -1,35 +0,0 @@
---
title: Overview
sidebar_position: 0
sidebar_custom_props:
icon: TbEyeglass
---
Twenty primarily uses NestJS for the backend.
Prisma was the first choice as the ORM with a lot of auto-generated code under the hood. But to offer users flexibility and allow them to create custom fields and custom objects, something more low-level than Prisma made more sense to have more fine-grained control. This is why the project now uses TypeORM.
Here's what the tech stack now looks like.
## Tech Stack
**Core**
- [NestJS](https://nestjs.com/)
- [TypeORM](https://typeorm.io/)
- [GraphQL Yoga](https://the-guild.dev/graphql/yoga-server)
**Database**
- [Postgres](https://www.postgresql.org/)
**Third-party integrations**
- [Sentry](https://sentry.io/welcome/) for tracking bugs
**Testing**
- [Jest](https://jestjs.io/)
**Tooling**
- [Yarn](https://yarnpkg.com/)
- [ESLint](https://eslint.org/)
**Development**
- [AWS EKS](https://aws.amazon.com/eks/)

View File

@ -1,61 +0,0 @@
---
title: Development workflow
sidebar_position: 3
sidebar_custom_props:
icon: TbTopologyStar
---
## First time setup
```
cd server
yarn # install dependencies
yarn prisma:migrate # run migrations
yarn prisma:generate # generate prisma and nestjs-graphql schemas
yarn prisma:seed # provision database with seeds
# alternatively, you can run
yarn prisma:reset # all-in-one command to reset, migrate, seed and generate schemas
```
## Starting a new feature
Make sure your database is running on the URL provided in your `server/.env` file.
```
cd server
yarn
yarn prisma:migrate && yarn prisma:generate
yarn start:dev
```
## Lint
```
yarn lint
```
## Test
```
yarn test
```
## Resetting the database
If you want to reset the database, you can run the following command:
```bash
cd server
yarn database:reset
```
:::warning
This will drop the database and re-run the migrations and seed.
Make sure to back up any data you want to keep before running this command.
:::

View File

@ -1,4 +0,0 @@
{
"label": "Others",
"position": 2
}

View File

@ -1,12 +1,91 @@
---
title: Backend Development
displayed_sidebar: backendSidebar
sidebar_position: 0
sidebar_custom_props:
icon: TbTerminal
isSidebarRoot: true
---
Welcome to the Backend Development section of the documentation.
Here you will find information about the development process, the recommended tools, and the best practices you should follow.
import DocCardList from '@theme/DocCardList';
<DocCardList />
## Useful commands
### First time setup
```
yarn prisma:migrate # run migrations
yarn prisma:generate # generate prisma and nestjs-graphql schemas
yarn prisma:seed # provision database with seeds
# alternatively, you can run
yarn prisma:reset # all-in-one command to reset, migrate, seed and generate schemas
```
### Starting the app
```
nx prisma:migrate twenty-server
nx prisma:generate twenty-server
nx start:dev twenty-server
```
### Lint
```
nx lint twenty-server
```
### Test
```
nx test twenty-server
```
### Resetting the database
If you want to reset the database, you can run the following command:
```bash
nx database:reset twenty-server
```
:::warning
This will drop the database and re-run the migrations and seed.
Make sure to back up any data you want to keep before running this command.
:::
## Tech Stack
Twenty primarily uses NestJS for the backend.
Prisma was the first ORM we used. But in order to allow users to create custom fields and custom objects, a lower-level made more sense as we need to have fine-grained control. The project now uses TypeORM.
Here's what the tech stack now looks like.
**Core**
- [NestJS](https://nestjs.com/)
- [TypeORM](https://typeorm.io/)
- [GraphQL Yoga](https://the-guild.dev/graphql/yoga-server)
**Database**
- [Postgres](https://www.postgresql.org/)
**Third-party integrations**
- [Sentry](https://sentry.io/welcome/) for tracking bugs
**Testing**
- [Jest](https://jestjs.io/)
**Tooling**
- [Yarn](https://yarnpkg.com/)
- [ESLint](https://eslint.org/)
**Development**
- [AWS EKS](https://aws.amazon.com/eks/)