Make sure Docker is installed and running on your system before executing any Docker commands. https://docs.docker.com/get-docker/.
For setting up the development environment, you will use Docker Compose to build and manage your services. You have options to start the backend, frontend, or both simultaneously. Here's how you can do it:
Before running the whole build, you need to set environment variables in .env as presented in .env-example file.
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
Now you can copy the result and paste into the .env file.
To build all the services necessary for the development environment, run the following command in your terminal:
docker-compose build
You can start the services individually or both at once depending on your need:
-
Backend Only
To start only the backend services in development mode, run:
make dev-b
-
Frontend Only
To start only the frontend services in development mode, run:
make dev-f
-
Both Backend and Frontend
To start both backend and frontend services simultaneously in development mode, use:
make dev
Setting up the production environment requires building the frontend assets and the Docker images, followed by launching the services.
Before building your Docker images in production, ensure that the frontend assets are compiled, use the following command in required directories:
npm run build
To build all the services necessary for the production environment, run:
docker-compose build
Like in development, you can start the backend, frontend, or both in production mode:
-
Backend Only
To deploy only the backend services in production mode, run:
make prod-b
-
Frontend Only
To deploy only the frontend services in production mode, run:
make prod-f
-
Both Backend and Frontend
To deploy both backend and frontend services simultaneously in production mode, use:
make prod
-
Windows
- Go to the official PostgreSQL website: Download PostgreSQL.
- Choose the appropriate version for your operating system and download the installer.
- Run the installer and follow the instructions to install PostgreSQL.
- After the installation completes, ensure PostgreSQL has been successfully installed by running either the psql program or pgAdmin.
- Note: If you want to use
psql
in the Windows terminal, you need to set the environment variable for PostgreSQL bin directory. This can usually be done during the installation process or manually by updating the system's PATH variable.
-
Unix/Linux (Ubuntu):
- Open a terminal.
- Execute the following commands to install PostgreSQL:
sudo apt update sudo apt install postgresql postgresql-contrib
- After the installation completes, PostgreSQL will automatically start as a service.
psql -U postgres
The whole setup is managed by the docker compose, all you have to do is fill the example create your .env file basing of the given example.
Note: When you want to develop locally the host should be named as the database container name.
-
Enter the backend terminal
-
Run following script
node createsuperuser.js
-
Unfortunately right now you have to do it manually
-
Run following script
node --env-file=.\front\.env .\front\fb_make_super_user.mjs EMAIL