Skip to content

Commit 63d8ed8

Browse files
committed
more instructions on native dev
1 parent 96f03d5 commit 63d8ed8

File tree

1 file changed

+30
-9
lines changed

1 file changed

+30
-9
lines changed

README.md

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
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
1012
POSTGRES_USER=YOUR_USERNAME
@@ -14,31 +16,50 @@ JWT_SECRET=YOUR_SUPER_SECRET_KEY
1416
DATABASE_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
2131
docker compose up -d
2232
```
2333

2434
If you haven't initialized the DB for the first time, do the initialization:
2535

26-
```
27-
cd ./api
36+
```shell
37+
cd api
2838
npx 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
3555
yarn dev
3656
```
3757

3858
Start the UI server on http://localhost:3000:
3959

40-
```
41-
cd ./ui
60+
```shell
61+
cd ui
62+
yarn # install deps
4263
yarn dev
4364
```
4465

0 commit comments

Comments
 (0)