Skip to content

Commit

Permalink
Update install instruction in docs (#376)
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesBochet authored Jun 25, 2023
1 parent 9c21975 commit 3c5a270
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 30 deletions.
1 change: 0 additions & 1 deletion .devcontainer/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@

DEBIAN_FRONTEND=noninteractive

cd infra/dev
make build
make up
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
%:
$(MAKE) -C infra/dev $*
47 changes: 19 additions & 28 deletions docs/docs/start/local-setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,15 @@ Default values should work out of the box with the docker setup.
We provide a containerized environment with Docker and orchestrated with docker-compose.
This install will also provision a Postgres container.

The configuration is stored `infra/dev` folder.
The configuration is stored `infra/dev` folder.

```
cd infra/dev
make build
```

### 5. Auth setup
### 5. Migrate & seed

Right now the only way to authenticate yourself is to setup Google Sign-in in `server/.env`
We will add an easier option soon.

### 6. Migrate & seed

Before running the project, we need to apply database init and migrations and run the seed.
Before running the project, we need to init the database by running migration and seeds.

Always go the `infra/dev` folder to run the `make` commands.

Expand All @@ -59,22 +53,26 @@ Start the containers:
make up
```

Run database migrations:
Run database migrations, generate prisma client and seed:
```
make server-prisma-migrate
make server-prisma-generate-client
make server-prisma-seed
```

Generate prisma client
You can also ssh directly in the container and run these commands from the container:
```
make server-prisma-generate-client
make sh
```

Seed the database:
Then
```
make server-prisma-seed
cd server
yarn prisma:migrate
yarn prisma:generate-client
yarn prisma:seed
```

### 7. Start
### 6. Start

Once this is completed you can run the project with the following commands:

Expand All @@ -85,18 +83,14 @@ make front-start

server:
```
make-server start
make server-start
```

- front available on: http://localhost:3001
- server available on: http://localhost:3000/healthz
- postgres: available on http://localhost:5432 and should contain database named `twenty`


### 8. Development

Documented [here](../dev/workflows.mdx)

## Without Docker

While Docker is the recommended way to run Twenty, you might want to run the project directly on your machine.
Expand All @@ -119,7 +113,7 @@ cp ./server/.env.example ./server/.env

Most default value should work out of the box, but don't forget to update the database connection string.

### 4. Build
### 4. Build, Migrate & Seed
On the frontend:
```
cd front
Expand All @@ -131,14 +125,11 @@ On the server side:
cd server
yarn
yarn prisma:migrate
yarn prisma:generate-client
yarn prisma:seed
```
You can also run `yarn prisma:seed` to seed the database with mock data.

### 5. Auth Setup
Right now the only way to authenticate yourself is to setup Google Sign-in in `server/.env`
We will add an easier option soon.

### 6. Start
### 5. Start
On the frontend:
```
cd front
Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "docs",
"version": "0.0.0",
"version": "0.1.0",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
Expand Down

0 comments on commit 3c5a270

Please sign in to comment.