The backend needs access to a postgres database to work properly. To configure it, you will need to create a config folder. Then create a config.json file inside the config folder. Please insert the following config (with your credentials) inside:
{
"development": {
"username": "root",
"password": "password",
"database": "bypass_development",
"host": "localhost",
"dialect": "postgres"
}
}
- Install dependencies with npm.
- Start the database
docker-compose up -d
- Start the server using
node server.js
The backend uses: NodeJs Postgres.
- Change "trust" authentifcation by "md5" in file:
nano /usr/local/var/postgres/pg_hba.conf
- Create a databse
createdb <databasename>
- Add an user with password
psql postgres -c "CREATE ROLE <username> WITH LOGIN PASSWORD '<password>'"
- Change password (maybe you need it for default password ;)
psql postgres -c "ALTER USER <username> PASSWORD '<newpassword>'"
- Add database privileges to username
psql postgres -c "GRANT ALL PRIVILEGES ON DATABASE <databasename> TO <username>"
- Change owner of database
psql postgres -c "ALTER DATABASE <databasename> OWNER TO <username>"
You will need to create /config/config.json. Those following must be inlude inside config.json:
{
"development": {
"username": "root",
"password": "password",
"database": "bypass_development",
"host": "localhost",
"dialect": "postgres"
}
}
- Install dependencies with
node install
- Migrate database with
sequelize db:migrate
- Start the server using
nodemon server.js
npm install npm@latest -g npm install -g npm-check-updates npm i nsp -g npm install -g snyk
npm-check-updates -u npm update npm install nsp check snyk test snyk wizard