It is a User CRUD api on Express-JS, GraphQL and PostgreSQL(Prisma). You can:
- Login, Register.
- Authentication (passport)
- CRUD User.
Access Apollo Server: http://localhost:3000/graphql
Run the following command to install dependencies:
npm install
Run the following command to build PostgreSQL instance:
docker-compose up -d postgres
This project depends on some environment variables.
If you are running this project locally, create a .env
file at the root for these variables.
Your host provider should included a feature to set them there directly to avoid exposing them.
Here are the required ones:
#Database env
DB_HOST=
DB_ENGINE=
DB_NAME=
DB_PORT=
DB_USER=
DB_PASSWORD=
DB_CONNECT_TIMEOUT=
DATABASE_URL=${DB_ENGINE}://${DB_USER}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_NAME}?schema=public&connect_timeout=${DB_CONNECT_TIMEOUT}
#Application env
PORT=
JWT_SECRET=
#Seed db
MASTER_PASS=
Run the following command to create/update your database based on existing sql migration scripts:
npm run update-database
The project includes a seed script to populate the database:
npm run seed-db
Run the following command to run the project:
npm run build
npm run start
Step 1: Get access token Step 2: Set token on Headers with Authorization type
- Email - nguyentrung96dn@gmail.com
- Linkedin - linkedin.com