mirror of
https://github.com/lingble/twenty.git
synced 2025-11-02 05:37:56 +00:00
Update scripts and documentation to use nx and new monorepo architecture (#2912)
* Update scripts and documentation to use nx and new monorepo architecture * Start fixing docker * Migrate eslint plugin and postgres setup * Fix docker * Fix patches * Fix * fix: wip try to fix the patches * Apply patches --------- Co-authored-by: Jérémy Magrin <jeremy.magrin@gmail.com>
This commit is contained in:
@@ -57,13 +57,13 @@ You need to set some environment variables before you can work on the project. L
|
||||
|
||||
```bash
|
||||
cd twenty
|
||||
cp ./front/.env.example ./front/.env
|
||||
cp ./server/.env.example ./server/.env
|
||||
cp ./packages/twenty-front/.env.example ./packages/twenty-front/.env
|
||||
cp ./packages/twenty-server/.env.example ./packages/twenty-server/.env
|
||||
```
|
||||
|
||||
The default values should work out of the box, except for the postgres URL, which requires a small modification.
|
||||
|
||||
Open `./server/.env` and change to the following:
|
||||
Open `./packages/twenty-server/.env` and change to the following:
|
||||
|
||||
```bash
|
||||
PG_DATABASE_URL=postgres://twenty:twenty@postgres:5432/default?connection_limit=1
|
||||
@@ -75,14 +75,9 @@ PG_DATABASE_URL=postgres://twenty:twenty@postgres:5432/default?connection_limit=
|
||||
The project includes an environment containerized with Docker and orchestrated with `docker-compose`.
|
||||
This installation method will also provision a PostgreSQL container.
|
||||
|
||||
:::info
|
||||
|
||||
The configuration for the build is in the `infra/dev` folder, but you can run `make` commands directly from the root folder.
|
||||
|
||||
:::
|
||||
|
||||
```bash
|
||||
make build
|
||||
make -C packages/twenty-docker dev-build
|
||||
```
|
||||
|
||||
## Step 4: Migrate & seed
|
||||
@@ -91,12 +86,12 @@ Before running the project, you need to initialize the database by running the m
|
||||
|
||||
Start the containers:
|
||||
```bash
|
||||
make up
|
||||
make -C packages/twenty-docker dev-up
|
||||
```
|
||||
|
||||
Setup database, run migrations, and seed:
|
||||
```bash
|
||||
make server-database-init
|
||||
make -C packages/twenty-docker dev-server-database-init
|
||||
```
|
||||
|
||||
## Step 5: Start Twenty
|
||||
@@ -104,11 +99,11 @@ make server-database-init
|
||||
Run the project with the following commands from the `root` folder:
|
||||
|
||||
```bash
|
||||
make server-start
|
||||
make -C packages/twenty-docker dev-server-start
|
||||
```
|
||||
|
||||
```bash
|
||||
make front-start
|
||||
make -C packages/twenty-docker dev-front-start
|
||||
```
|
||||
|
||||
You should now have:
|
||||
@@ -123,12 +118,11 @@ Sign in using a seeded demo account `tim@apple.dev` (password: `Applecar2025`) t
|
||||
If you don't want to use the `make` command and work directly from the container, you can also ssh directly into the container:
|
||||
|
||||
```bash
|
||||
make sh
|
||||
make -C packages/twenty-docker dev-sh
|
||||
```
|
||||
Then run commands through yarn:
|
||||
Then run commands through yarn and nx:
|
||||
```bash
|
||||
cd server
|
||||
yarn database:init
|
||||
yarn nx run twenty-server:database:init
|
||||
```
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user