twenty/README.md

83 lines
2.5 KiB
Markdown
Raw Normal View History

2023-01-27 14:12:04 +03:00
# Twenty
2022-12-01 17:58:08 +03:00
2023-01-27 14:12:04 +03:00
Welcome to Twenty documentation!
2022-12-01 17:58:08 +03:00
2023-01-27 14:12:04 +03:00
## High Level Overview
2022-12-01 17:58:08 +03:00
Twenty development stack is composed of 3 different layers
- front: our frontend React app
- server: our backend that contain endpoint, crm logic, scripts, jobs...
- storages: postgres
2023-01-27 14:12:04 +03:00
2023-04-05 16:01:20 +03:00
## Setup env variables
1. `cp ./infra/dev/.front.env.example ./front/.env` and fill with values
## Development environment setup with npm (Not recommended)
2023-01-27 14:12:04 +03:00
This is the easiest way to get started contributing to twenty
Make sure you have `node@18` installed on your machine. You can use `nvm` to manage your nvm versions in case you have projects that require different node versions.
2023-04-05 16:01:20 +03:00
`npm run install-dev`
`npm run front`
You'll need to provide your own postgres storage.
Once this is completed you should have:
- front available on: http://localhost:3001
- server available on: http://localhost:3000/health
2023-04-05 16:01:20 +03:00
## Development environment setup with docker-compose (Recommended)
We also provide a containerized environment with Docker and orchestrated with docker-compose in case it is easier for you. This install will also provision a postgres container out of the box.
2023-01-27 14:12:04 +03:00
### Step 1: pre-requesites
2023-04-05 16:01:20 +03:00
Make sure to have the latest Docker and Docker-compose versions installed on your computer. You can run `docker-compose --version` to check if you have docker-compose installed and `docker --version` to check if you have docker installed.
2023-01-27 14:12:04 +03:00
### Step 2: docker build
Build docker containers.
The whole setup experience is happening in `infra/dev` folder. Make sure to be in this folder:
2023-01-27 14:12:04 +03:00
```
cd infra/dev
```
```
docker-compose up --build --force-recreate
```
Once this is completed you should have:
- front available on: http://localhost:3001
2023-04-12 16:08:27 +03:00
- hasura available on: http://localhost:8080
- server available on: http://localhost:3000/health
- postgres: available on http://localhost:5432 that should contain `twenty` database
2023-01-27 14:12:04 +03:00
2023-04-09 17:43:43 +03:00
### Step 3: IDE setup
If you are using VSCode, please use the `Dev Containers` extension to open the project in a container. This will allow you to run Visual Studio on top of the docker container. This will allow you to run the project without having to install node on your machine.
### Note
2022-12-01 17:58:08 +03:00
If you are using Docker install, make sure to ssh in the docker container during development to execute commands. You can also use `Makefile` to help you
2022-12-28 23:19:12 +03:00
## Development
2022-12-01 17:58:08 +03:00
2023-01-27 14:12:04 +03:00
### Tests
#### Unit tests:
2023-01-27 14:12:04 +03:00
```
make front-test
2023-01-27 14:12:04 +03:00
# coverage
make front-coverage
2023-01-27 14:12:04 +03:00
```
2022-12-01 17:58:08 +03:00
2023-01-27 14:12:04 +03:00
#### Storybook:
2022-12-01 17:58:08 +03:00
```
make front-storybook
2023-01-27 14:12:04 +03:00
```
## Developping on server
Section TBD