realworld-express-prisma-backend
v1.1.2
Published
A RealWorld Backend API made with express + prisma
Downloads
1
Maintainers
Readme
Typescript + Express + Prisma codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the RealWorld spec and API.
Demo RealWorld
This codebase was created to demonstrate a backend built with Typescript + Express + Prisma including CRUD operations, authentication, routing, pagination, and more.
We've gone to great lengths to adhere to the Typescript community styleguides & best practices.
For more information on how to this works with other frontends/backends, head over to the RealWorld repo.
How it works
The project is build using TypeScript for language, Express for routing and server framework and Prisma as an ORM.
The project uses PostgreSQL for the database.
For unit testing it uses the Jest framework since it is what is promoted by prisma team to mock testing function that change the database.
Getting started
To run this project you should have node/npm installed.
Run npm install
to install the dependencies.
Create a development environment file .env.development
inside the root folder with the following attributes:
DATABASE_URL=file:./dev.db
JWT_SECRET=theSecretForCreatingTheJWT
NODE_ENV=development
- To update the database in development mode use
npm run migrate:develop
- To run the development version
npm run develop
. - To test the application
npm test
. - To build a production version
npm run build
. - To run the production build
npm run start
.