This project is a TypeScript application built with the NestJS framework. It uses Prisma as an ORM for database management and Jest for testing. The project is managed with npm and follows the coding standards enforced by ESLint and Prettier.
- NestJS: A progressive Node.js framework for building efficient, reliable, and scalable server-side applications.
- TypeScript: A strongly typed superset of JavaScript that adds static types.
- Prisma: An open-source database ORM.
- PostgreSQL: A powerful, open source object-relational database
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
- Node.js
- pnpm
- git
- PostgreSQL database
- Clone the repository:
git clone https://github.com/Dank-del/notes-api.git
- Install the dependencies:
pnpm install
- Add a
.env
file to the root of the project with the following contents:
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/notes" # your database url
PORT=3000 # the port the server will run on
JWT_SECRET=secret # the secret used to sign JWTs
- Run the Prisma migration to create the database schema:
npx prisma db push
Start the application by running:
pnpm start:dev
The application will be running at http://localhost:3000.
Run the tests by executing:
pnpm test
To build the application for production, run:
pnpm build
This will create a dist
directory with the compiled JavaScript files.
The API documentation is available at http://localhost:3000/api.