File tree Expand file tree Collapse file tree 1 file changed +30
-9
lines changed
Expand file tree Collapse file tree 1 file changed +30
-9
lines changed Original file line number Diff line number Diff line change 44
55# Development
66
7- Add a .env file to ` ./api/.env ` , ` ./dev/.env ` with the following:
7+ ## Setup DB credentials
8+
9+ Add a .env file to ` ./api/.env ` , ` ./dev/.env ` with the following credentials:
810
911``` shell
1012POSTGRES_USER=YOUR_USERNAME
@@ -14,31 +16,50 @@ JWT_SECRET=YOUR_SUPER_SECRET_KEY
1416DATABASE_URL=" postgresql://$POSTGRES_USER :$POSTGRES_PASSWORD @localhost:5432/$POSTGRES_DB ?schema=public"
1517```
1618
17- Then, start the DB service on localhost:5432
19+ - ` dev/.env ` is used to setup the DB with correct credentials
20+ - ` api/.env ` is used by the backend API to talk to the DB.
21+
22+ ## Setup DB
23+
24+ Note: to avoid installing docker on your local machine, you could launch the DB
25+ service on a remote Linux server. You'll need to change the DATABASE_URL in the .env files.
26+
27+ To start the DB service on localhost:5432, install docker and run:
1828
1929```
20- cd ./ dev
30+ cd dev
2131docker compose up -d
2232```
2333
2434If you haven't initialized the DB for the first time, do the initialization:
2535
26- ```
27- cd ./ api
36+ ``` shell
37+ cd api
2838npx prisma migrate dev --name init
2939```
3040
31- Start the API server on http://localhost:4000 :
41+ You might also need to generate the prisma client (the above command will generate the client. You only need this if you are using a remote DB) :
3242
43+ ``` shell
44+ cd api
45+ npx prisma generate
3346```
34- cd ./api
47+
48+ ## Start the app
49+
50+ Start the API server on http://localhost:4000 :
51+
52+ ``` shell
53+ cd api
54+ yarn # install deps
3555yarn dev
3656```
3757
3858Start the UI server on http://localhost:3000 :
3959
40- ```
41- cd ./ui
60+ ``` shell
61+ cd ui
62+ yarn # install deps
4263yarn dev
4364```
4465
You can’t perform that action at this time.
0 commit comments