Clone the repo:
git clone https://github.com/SomeRandomDolphin/RPLorer.git
Install the dependencies:
npm install
Set the environment variables:
cp .env.example .env
# open .env and modify the environment variables
set up postgres database using docker
# set up postgres with docker
docker-compose up -d
Running the application:
# running locally
npm run dev
# running in prodution
npm run start
# migrate and seed database
prisma migrate dev
prisma db seed
access localhost:8000
request
> router > controller > service > repository > service > controller > router > response
It is forced to commit Conventional Commit to this repository. For commiting in this style you can use this VSCode Extension.
prisma\
|--migration\ # migration history
|--schema.prisma # database schema
src\
|--config\ # Environment variables and configuration related things
|--controller\ # Route controllers (controller layer)
|--middleware\ # Custom express middlewares
|--model\ # interface models (data layer)
|--repository\ # database queries
|--router\ # Routes
|--seed\ # database seeding
|--service\ # Business logic (service layer)
|--utils\ # Utility classes and functions
|--index.ts # App entry point
Response api functions are arranged in API-Response file containing:
- responseOK
- responseData
- responseError
Success
{
message: string, (optional)
data: [] or {}
}
Error
{
message: string,
errors: {
field1: "error message",
field2: "error message",
...
}
}
Please refer to this postman