Codebase | Description |
---|---|
client | Frontend App |
server | Backend App |
Prerequisite: Install Docker on your local environment.
To get started, read and follow the instructions in Developing inside a Container.
- Install the Remote - Containers extension.
- Open VSCode and bring up the Command Palette.
If you need to modify environment variables for backend, you need to modify them inside
/home/docker-compose.yml
file and restart your terminal.
Navigate to /server
and create a .env
file with the following environment variables in the root directory /server/.env
:
PORT=4000
SITE_NAME="Course Project"
DEFAULT_DOMAIN="localhost"
APP_PROTOCOL="http"
APP_DOMAIN="localhost"
LINK_LENGTH= 6
SENTRY_PRIVATE_DSN=""
SENTRY_PUBLIC_DSN=""
LOG_JSON_STYLE=true
LOG_DATE_FORMAT="YYYY-MM-DD HH:mm:ss"
LOG_INFO_MAX_SIZE=5242880
LOG_INFO_MAX_FILES=100
LOG_INFO_COLORIZE=true
LOG_ERROR_MAX_SIZE=5242880
LOG_ERROR_MAX_FILES=100
LOG_ERROR_COLORIZE=true
Run the following commands:
docker build -t server .
docker run -d -p 4000:4000 --name server server
Navigate to /client
and create a .env
file with the following environment variables in the root directory /client/.env
:
BACKEND_URL="http://localhost:4000/api"
Run the following commands:
docker build -t client .
docker run -d -p 8080:8080 --name client client
Run the following commands:
docker-compose up
Navigate to server and create a .env
file with the following environment variables in the root directory server/.env
:
PORT=4000
SITE_NAME="Course Project"
DEFAULT_DOMAIN="localhost"
APP_PROTOCOL="http"
APP_DOMAIN="localhost"
LINK_LENGTH= 6
SENTRY_PRIVATE_DSN=""
SENTRY_PUBLIC_DSN=""
LOG_JSON_STYLE=true
LOG_DATE_FORMAT="YYYY-MM-DD HH:mm:ss"
LOG_INFO_MAX_SIZE=5242880
LOG_INFO_MAX_FILES=100
LOG_INFO_COLORIZE=true
LOG_ERROR_MAX_SIZE=5242880
LOG_ERROR_MAX_FILES=100
LOG_ERROR_COLORIZE=true
Navigate to client and create a .env
file with the following environment variables in the root directory client/.env
:
BACKEND_URL="http://localhost:4000/api"
npm run install:app
npm run build:app
npm run start-server:dev
npm run start-server:prod
npm run start-client:dev
Use the build file in the dist
folder to run the frontend app in production mode
- You can refer to the container deployment guide above for more information.