Skip to content

TrungDN1996/express-prisma-api

Repository files navigation

Description

It is a demo app on Express-JS and PostgreSQL(Prisma). You can:

  1. Login, Register.
  2. User follow another users.
  3. CRUD Article, Tag.

Host API http://localhost:3000/api

Getting Started

Prerequisites

Run the following command to install dependencies:

npm install

Run with docker

Run the following command to build PostgreSQL instance:

docker-compose up -d postgres

Environment variables

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:

PORT=
DATABASE_URL=
JWT_SECRET=
NODE_ENV=production

Apply any SQL migration script

Run the following command to create/update your database based on existing sql migration scripts:

npm run update-database

Seed the database

The project includes a seed script to populate the database:

npm run seed-db

Run the project

Run the following command to run the project:

npm run build
npm run start

Swagger UI (Tsoa)

See OpenAPI(Swagger) http://localhost:3000/docs alt text

Stay in touch

About

It is a demo app on Express-JS and PostgreSQL(Prisma)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •