This is a simple starter pack for building RESTful APIs using Express, TypeScript, Prisma, and PostgreSQL.
- ESLint + Prettier + Airbnb Style Guide for Code Quality.
- VSCode debugger.
- API error Middleware with PostgreSQL error handling Reference
- Testing with Jest
- Linting and Pre-Commit Checks with husky
src\
|--config\ # Environment variables and configuration related things
|--constants\ # constant variables
|--controllers\ # controllers for module (Business logic)
|--middlewares\ # Custom middlewares (auth, common API error handling)
|--routes\ # Routes
|--services\ # For common business logic (service layer)
|--utils\ # Utility functions
|--app.js # Main Express app setup
|--server.js # App entry point
Clone or download this repository and cd into express-typescript-prisma-postgresql
-
Create the
.env
file by copying the.env.example
file -
Configure your PostgreSQL database by editing DATABASE_URL and SHADOW_DATABASE_URL in
.env
-
Install the project's npm dependencies by running
npm i
-
Apply schema changes to your database
npm run db:push
-
Run
npm run dev
for starting local API server, server starts onhttp://localhost:4000/
set breakpoints at code and hit f5
Run tests by using the command npm run test
Build the application with npm run build
. 'dist' folder will be created.
Run npm run studio
and open a web browser with the URL http://localhost:5555/
If you liked it then please show your love by ⭐ the repo