Setup
Installation
Using Docker Compose
To deploy the Junqo-platform, you need to have the following tools installed on your machine:
- Git
- Docker (v20.10.7 or higher)
- Docker Compose (v1.29.2 or higher)
- Python (v3.6 or higher)
If you don’t have these tools installed, you can follow the installation instructions on the official websites of Git, Docker, Docker Compose, and Python.
Once you have installed these tools, you can proceed to the deployment of the Junqo-platform.
-
The first step to deploy the Junqo-platform is to clone or download the repository and move to the project directory:
# Clone the repository git clone git@github.com:Junqo-org/junqo-platform.git # Move to the project directory cd junqo-platform
-
After cloning the repository, you need to spread the graphql schema to the frontend and the backend.
python3 tools/update_schemas.py
-
Once you are in the project directory, you need to create a
db_password.conf
file at the root of the project. This file should contain the password for the database user. The content of the file should look like this:my_db_password
-
Then, you need to create the
junqo_back/.env
file to configure the backend. You can use thejunqo_back/exemple.env
file to create the new one. Don’t forget to change the values as they are not safe for production use.For more informations, see the backend configuration documentation.
-
Then, you need to create the
junqo_front/config/.env
file to configure the frontend. You can use thejunqo_front/config/exemple.env
file to create the new one. Don’t forget to change the values as they are not safe for production use.For more informations, see the frontend configuration documentation.
-
After creating the
db_password.conf
, thejunqo_back/.env
and thejunqo_front/config/.env
files, you can proceed to deploy the Junqo-platform using Docker Compose.docker-compose up -d
For more informations, see the deployment documentation.
Building the project
Backend
To build the backend, follow the following documentation: backend documentation.
Frontend
To build the frontend, follow the following documentation: frontend documentation.
Database
-
Install PostgreSQL
Windows: Download the PostgreSQL installer from the official website. Run the installer and follow the on-screen instructions.
Linux (Ubuntu/Debian):
sudo apt update sudo apt install postgresql postgresql-contrib
macOS: Use Homebrew to install PostgreSQL:
brew update brew install postgresql
-
Start the PostgreSQL Service
Windows: The installer usually sets PostgreSQL to start automatically.
Linux:
sudo service postgresql start
macOS:
brew services start postgresql
-
Access PostgreSQL
Switch to the postgres user:
sudo -i -u postgres
Access the PostgreSQL prompt:
psql
-
Create a New Database
In the PostgreSQL prompt, create a new database:
CREATE DATABASE mydatabase;
-
Create a New User
Create a new user with a password:
CREATE USER myuser WITH ENCRYPTED PASSWORD 'mypassword';
-
Grant Privileges
Grant all privileges on the new database to the new user:
GRANT ALL PRIVILEGES ON DATABASE mydatabase TO myuser;
-
Configure PostgreSQL
Edit the postgresql.conf file to configure settings like listening addresses, ports, etc. Edit the pg_hba.conf file to configure client authentication.
-
Restart PostgreSQL
After making configuration changes, restart the PostgreSQL service: Linux:
sudo service postgresql restart
macOS:
brew services restart postgresql