Skip to content

Commit

Permalink
Update the readme after migrate to one .env file (#444)
Browse files Browse the repository at this point in the history
* fix: readme

* fix: prettier

---------

Co-authored-by: orig <[email protected]>
  • Loading branch information
origranot and orig authored Sep 15, 2023
1 parent 136eeb6 commit e3ce83a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 22 deletions.
38 changes: 17 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,21 +104,20 @@ List of things you need to run the project locally and how to install them.
```sh
npm install && npm run install:all
```
3. Navigate to backend folder, copy `.example.env` to `.env` and fill it properly ([see below](#backend-configuration)).
4. Navigate to frontend folder, copy `.example.env` to `.env` and fill it properly ([see below](#frontend-configuration)).
5. Make sure you have a local instance of PostgreSQL running on port 5432. If not, you can run it using docker:
3. Copy `.example.env` to `.env` and fill it properly (see [Configuration](#-configuration))
4. Make sure you have a local instance of PostgreSQL running on port 5432. If not, you can run it using docker:
```sh
docker run --name reduced_to_db -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=reduced_to_db -p 5432:5432 -d postgres
```
6. Run Prisma migration from root folder:
5. Run Prisma migration from root folder:
```sh
npx nx migrate-dev prisma --name=init
```
7. Run the backend from root folder:
6. Run the backend from root folder:
```sh
npx nx serve backend
```
8. Run the frontend from root folder:
7. Run the frontend from root folder:
```sh
npx nx serve frontend
```
Expand All @@ -133,6 +132,7 @@ The project is structured in the following way:
│ ├── backend
│ └── frontend
└── libs/
├── config
└── prisma
```

Expand All @@ -159,11 +159,10 @@ npx nx run-many -t docker-build

For the minimal configuration you can just rename the `.example.env` files to `.env`.

#### Backend configuration
###### General

###### App

- **APP_PORT**: Backend port
- **BACKEND_APP_PORT**: Backend port
- **FRONTEND_APP_PORT**: Frontend port
- **NODE_ENV**: Node environment (development / production)

###### Database
Expand All @@ -181,7 +180,9 @@ For the minimal configuration you can just rename the `.example.env` files to `.

###### Frontend

- **FRONT_DOMAIN**: Frontend instance domain
- **DOMAIN**: Domain of your frontend app
- **API_DOMAIN**: Domain of your backend instance (used for server side requests)
- **CLIENTSIDE_API_DOMAIN**: Domain of your backend instance (used for client side requests)

###### Redis

Expand All @@ -193,19 +194,12 @@ For the minimal configuration you can just rename the `.example.env` files to `.

###### Auth

- **JWT_SECRET**: Jwt secret string
- **JWT_ACCESS_SECRET**: Jwt secret (used for access tokens)
- **JWT_REFRESH_SECRET**: Jwt secret (used for refresh tokens)

###### Novu

- **NOVU_API_KEY**: Get it from https://novu.co/ (Not required for local development)

#### Frontend configuration

- **DOMAIN**: Domain of your frontend app (used for cookies)

- **API_DOMAIN**: Domain of your backend instance (used for server side requests)

- **CLIENTSIDE_API_DOMAIN**: Domain of your backend instance (used for client side requests)
- **NOVU_API_KEY**: Get it from https://novu.co/, you don't need this when running locally (just verify your email from the database)

Happy Hacking !

Expand Down Expand Up @@ -239,6 +233,8 @@ Simply copy and paste a URL into the provided area. Then click shorten URL! Your
- [ ] Improve front-end components
- [x] Backend tests
- [x] Migration to Nx
- [ ] Split backend into libs
- [ ] Support k8s deployment (helm)
- [ ] Front-end Tests
- [ ] Logs
- [ ] Add a statistics page
Expand Down
2 changes: 1 addition & 1 deletion docker/deployment/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
image: postgres
container_name: postgres_db
restart: always
env_file: database.env
env_file: .env
ports:
- 5432:5432
volumes:
Expand Down

0 comments on commit e3ce83a

Please sign in to comment.