To run this project locally, follow these steps:
-
Clone the repository:
git clone git@github.com:O-clock-Pavlova/seniorLove-back.git
-
Navigate to the project directory:
cd DIRECTORYPATH/ -
Install the dependencies:
pnpm install
-
Create PSQL Database:
- Connect to postgres as a superuser (postgres user) via psql
- Create new user with password
CREATE USER username WITH PASSWORD 'password';
- Create database owned by user
CREATE DATABASE databaseName OWNER username;
-
Setup the .env
- Create
.envfile - Fill it with your credentials, you can find .env variables inside
.env.example
- Create
-
Init NODE_ENV:
- Windows :
$env:NODE_ENV = 'development'
- MacOS / Linux :
export NODE_ENV=development -
Set up the PostgreSQL database:
- Init the tables creation script inside
package.json
pnpm prestart
- Create tables and populate with test data
pnpm db:reset
- Init the tables creation script inside
-
Launch unit tests (optional):
pnpm test -
Start the server:
pnpm dev