From 06e2f30f1b4a6ec38a48c199cf4363e3387c579f Mon Sep 17 00:00:00 2001 From: orig Date: Fri, 15 Sep 2023 17:19:33 +0300 Subject: [PATCH 1/2] fix: readme --- README.md | 38 +++++++++++++--------------- docker/deployment/docker-compose.yml | 2 +- 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 8878ab70..20a38519 100644 --- a/README.md +++ b/README.md @@ -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 ``` @@ -133,6 +132,7 @@ The project is structured in the following way: │ ├── backend │ └── frontend └── libs/ + ├── config └── prisma ``` @@ -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 @@ -181,7 +180,10 @@ 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 @@ -193,19 +195,13 @@ 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 +- **NOVU_API_KEY**: Get it from https://novu.co/, you don't need this when running locally (just verify your email from the database) -- **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) Happy Hacking ! @@ -239,6 +235,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 diff --git a/docker/deployment/docker-compose.yml b/docker/deployment/docker-compose.yml index c309fb76..0838e110 100644 --- a/docker/deployment/docker-compose.yml +++ b/docker/deployment/docker-compose.yml @@ -5,7 +5,7 @@ services: image: postgres container_name: postgres_db restart: always - env_file: database.env + env_file: .env ports: - 5432:5432 volumes: From 35caee4659bb19798375bf6b23614cf3caee59a8 Mon Sep 17 00:00:00 2001 From: orig Date: Fri, 15 Sep 2023 17:21:10 +0300 Subject: [PATCH 2/2] fix: prettier --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 20a38519..c7a9e1f1 100644 --- a/README.md +++ b/README.md @@ -184,7 +184,6 @@ For the minimal configuration you can just rename the `.example.env` files to `. - **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 - **REDIS_ENABLE**: Whether to use external redis store or not @@ -202,7 +201,6 @@ For the minimal configuration you can just rename the `.example.env` files to `. - **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 !

(back to top)