Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

459 add definitions for important env variables to readme #469

Merged
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,54 @@ server {
``cd ~/bluewave-onboarding
docker compose up -d``

## Environment variables

In order to the project to run safely and correctly, the user should add their own environment variables. They can be added to the .env file in the root directory of the project. The following is the list of environment variables that should be added and its description:

1. Database credentials
```
DEV_DB_USERNAME - Development database username
DEV_DB_PASSWORD - Development database password
DEV_DB_NAME - Development database name
DEV_DB_HOST - Development database host
DEV_DB_PORT - Development database port
TEST_DB_USERNAME - Test database username
TEST_DB_PASSWORD - Test database password
TEST_DB_NAME - Test database name
TEST_DB_HOST - Test database host
TEST_DB_PORT - Test database port
PROD_DB_USERNAME - Production database username
PROD_DB_PASSWORD - Production database password
PROD_DB_NAME - Production database name
PROD_DB_HOST - Production database host
PROD_DB_PORT - Production database port
```

2. Email service configuration
For the email service to run correctly, the user should add their own email credentials
```
EMAIL_ENABLE - Enable email service (boolean)
EMAIL_HOST - Email host
EMAIL_PORT - Email port
EMAIL - Email
APP_PASSWORD - Email password
```
DeboraSerra marked this conversation as resolved.
Show resolved Hide resolved

3. JWT Secret Key
```
JWT_SECRET - secret key to sign the JWT token
```
DeboraSerra marked this conversation as resolved.
Show resolved Hide resolved

4. Enable IP check for the API
If the ENABLE_IP_CHECK is set to true, but the ALLOWED_IP_RANGE and ALLOWED_IPS are not set, the API will work for all IP addresses.
```
ENABLE_IP_CHECK - Enable IP check for the API (boolean)
ALLOWED_IP_RANGE - Allowed IP range for the API with the format "baseIp/rangeStart-rangeEnd" (e.g. 192.168.1/1-255) separated by comma
ALLOWED_IPS - Allowed IP addresses for the API separated by comma
```
DeboraSerra marked this conversation as resolved.
Show resolved Hide resolved

For development and testing purposes, the application is ready to go after cloning and dependencies installation.

## Contributing

Here's how you can contribute to the Onboarding product.
Expand Down
17 changes: 10 additions & 7 deletions backend/.env
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
# For development environment, the project is ready to run after cloning and installing the dependencies.

# Node environment
NODE_ENV=development

# Development environment
# Development database environment
DEV_DB_USERNAME=user123
DEV_DB_PASSWORD=password123
DEV_DB_NAME=onboarding_db
DEV_DB_HOST=db
DEV_DB_PORT=5432
DeboraSerra marked this conversation as resolved.
Show resolved Hide resolved

# Enable email service
EMAIL_ENABLE=false
# Email service configuration, for the email service to run correctly, the user should add their own email credentials
EMAIL_HOST=your_email_host
EMAIL_PORT=your_email_port
EMAIL=your_email
APP_PASSWORD=your_app_password

# JWT Secret Key
JWT_SECRET="NKrbO2lpCsOpVAlqAPsjZ0tZXzIoKru7gAmYZ7XlHn0=qqwqeq"
DeboraSerra marked this conversation as resolved.
Show resolved Hide resolved

TEST_DB_USERNAME=user123
TEST_DB_PASSWORD=password123
TEST_DB_NAME=onboarding_db_test
TEST_DB_HOST=localhost
TEST_DB_PORT=5432

# Enable IP check for the API
ENABLE_IP_CHECK=false
# Allowed IP range for the API "baseIp/rangeStart-rangeEnd" (e.g. 192.168.1/1-255) separated by comma
ALLOWED_IP_RANGE=11.22.33/10-200, 192.168.65/1-255
Expand Down
21 changes: 14 additions & 7 deletions backend/.env.production
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
# Production Environment Configuration

# Database Configuration
PROD_DB_USERNAME=prod_user
PROD_DB_PASSWORD=prod_password
PROD_DB_NAME=prod_db
PROD_DB_HOST=localhost
# Production environment
PROD_DB_USERNAME=user123
PROD_DB_PASSWORD=password123
PROD_DB_NAME=onboarding_db
PROD_DB_HOST=db
PROD_DB_PORT=5432
DeboraSerra marked this conversation as resolved.
Show resolved Hide resolved

# Enable email service
EMAIL_ENABLE=true
# Email service configuration, for the email service to run correctly, the user should add their own email credentials
EMAIL_HOST=your_email_host
EMAIL_PORT=your_email_port
EMAIL=your_email
APP_PASSWORD=your_app_password

# JWT Secret Key
JWT_SECRET=your_prod_jwt_secret_key_here

# Enable IP check for the API
ENABLE_IP_CHECK=false
# Allowed IP range for the API "baseIp/rangeStart-rangeEnd" (e.g. 192.168.1/1-255) separated by comma
ALLOWED_IP_RANGE=11.22.33/10-200
Expand Down
4 changes: 3 additions & 1 deletion backend/.env.test
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
# Test Environment Configuration

# Database Configuration
# Test database environment
TEST_DB_USERNAME=user123
TEST_DB_PASSWORD=password123
TEST_DB_NAME=onboarding_db_test
TEST_DB_HOST=localhost
TEST_DB_PORT=5432
DeboraSerra marked this conversation as resolved.
Show resolved Hide resolved

# Credentials for test postgres database
POSTGRES_USER=user123
POSTGRES_PASSWORD=password123
POSTGRES_DB=onboarding_db_test

# JWT Secret Key
JWT_SECRET=your_test_jwt_secret_key_here

# Enable IP check for the API
ENABLE_IP_CHECK=false
# Allowed IP range for the API "baseIp/rangeStart-rangeEnd" (e.g. 192.168.1/1-255) separated by comma
ALLOWED_IP_RANGE=11.22.33/10-200, 192.168.65/1-255
Expand Down
Loading