diff --git a/.devcontainer/init.sh b/.devcontainer/init.sh index 4be95e0f65..542d44763a 100755 --- a/.devcontainer/init.sh +++ b/.devcontainer/init.sh @@ -2,6 +2,5 @@ DEBIAN_FRONTEND=noninteractive -cd infra/dev make build make up \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000000..4346d4e0ba --- /dev/null +++ b/Makefile @@ -0,0 +1,2 @@ +%: + $(MAKE) -C infra/dev $* diff --git a/docs/docs/start/local-setup.mdx b/docs/docs/start/local-setup.mdx index b45043f38f..0b7e2a72f7 100644 --- a/docs/docs/start/local-setup.mdx +++ b/docs/docs/start/local-setup.mdx @@ -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. @@ -59,22 +53,26 @@ Start the containers: make up ``` -Run database migrations: +Run database migrations, generate prisma client and seed: ``` make server-prisma-migrate -``` - -Generate prisma client -``` make server-prisma-generate-client -``` - -Seed the database: -``` make server-prisma-seed ``` -### 7. Start +You can also ssh directly in the container and run these commands from the container: +``` +make sh +``` +Then +``` +cd server +yarn prisma:migrate +yarn prisma:generate-client +yarn prisma:seed +``` + +### 6. Start Once this is completed you can run the project with the following commands: @@ -85,7 +83,7 @@ make front-start server: ``` -make-server start +make server-start ``` - front available on: http://localhost:3001 @@ -93,10 +91,6 @@ make-server start - 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. @@ -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 @@ -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 diff --git a/docs/package.json b/docs/package.json index 99e3726591..3d5dc2d0f5 100644 --- a/docs/package.json +++ b/docs/package.json @@ -1,6 +1,6 @@ { "name": "docs", - "version": "0.0.0", + "version": "0.1.0", "private": true, "scripts": { "docusaurus": "docusaurus",