Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/khaledsaeed18/express-notes-app-with-typescript-prisma-postgresql
A simple and secure notes app built with Express.js, TypeScript, Prisma ORM, and PostgreSQL. It features JWT-based authentication, bcrypt.js for password hashing, input validation with express-validator, and request rate limiting with express-rate-limit for enhanced security and performance.
https://github.com/khaledsaeed18/express-notes-app-with-typescript-prisma-postgresql
authentication backend bcryptjs express-rate-limit express-validator expressjs jsonwebtoken middleware nodejs pagination postgresql-database prisma-orm typescript
Last synced: 3 days ago
JSON representation
A simple and secure notes app built with Express.js, TypeScript, Prisma ORM, and PostgreSQL. It features JWT-based authentication, bcrypt.js for password hashing, input validation with express-validator, and request rate limiting with express-rate-limit for enhanced security and performance.
- Host: GitHub
- URL: https://github.com/khaledsaeed18/express-notes-app-with-typescript-prisma-postgresql
- Owner: KhaledSaeed18
- Created: 2025-01-02T22:27:03.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2025-02-03T13:37:46.000Z (8 days ago)
- Last Synced: 2025-02-03T14:38:20.092Z (8 days ago)
- Topics: authentication, backend, bcryptjs, express-rate-limit, express-validator, expressjs, jsonwebtoken, middleware, nodejs, pagination, postgresql-database, prisma-orm, typescript
- Language: TypeScript
- Homepage:
- Size: 34.2 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Express TypeScript Backend with Prisma
[![Node.js](https://img.shields.io/badge/Node.js-339933?style=for-the-badge&logo=nodedotjs&logoColor=white)](https://nodejs.org/)
[![TypeScript](https://img.shields.io/badge/TypeScript-007ACC?style=for-the-badge&logo=typescript&logoColor=white)](https://www.typescriptlang.org/)
[![Express.js](https://img.shields.io/badge/Express.js-000000?style=for-the-badge&logo=express&logoColor=white)](https://expressjs.com/)
[![Prisma](https://img.shields.io/badge/Prisma-3982CE?style=for-the-badge&logo=Prisma&logoColor=white)](https://www.prisma.io/)
[![PostgreSQL](https://img.shields.io/badge/PostgreSQL-316192?style=for-the-badge&logo=postgresql&logoColor=white)](https://www.postgresql.org/)
[![JWT](https://img.shields.io/badge/JWT-000000?style=for-the-badge&logo=JSON%20web%20tokens&logoColor=white)](https://jwt.io/)
[![bcrypt](https://img.shields.io/badge/bcrypt-003A70?style=for-the-badge&logo=lock&logoColor=white)](https://www.npmjs.com/package/bcryptjs)
[![Express Validator](https://img.shields.io/badge/Express_Validator-7457C2?style=for-the-badge&logo=validator&logoColor=white)](https://express-validator.github.io/)
[![Rate Limit](https://img.shields.io/badge/Rate_Limit-2EA44F?style=for-the-badge&logo=shield&logoColor=white)](https://www.npmjs.com/package/express-rate-limit)
[![CORS](https://img.shields.io/badge/CORS-000000?style=for-the-badge&logo=cors&logoColor=white)](https://www.npmjs.com/package/cors)A robust REST API backend built with Express.js, TypeScript, and Prisma ORM featuring authentication and note management.
## Features
- 🔐 JWT-based Authentication
- 📝 CRUD operations for Notes
- 🔍 Search functionality
- 📄 Pagination support
- ⚡ Rate limiting
- 🔒 Password validation and security
- 🎯 Input validation
- 🚫 Error handling middleware
- 📦 PostgreSQL database with Prisma ORM## Tech Stack
- Node.js
- Express.js
- TypeScript
- Prisma ORM
- PostgreSQL
- JSON Web Tokens
- bcrypt.js
- express-validator
- express-rate-limit## Installation
1- Clone the repository:
```bash
git clone https://github.com/KhaledSaeed18/Express-Notes-App-with-TypeScript-Prisma-PostgreSQL.git
cd Express-Notes-App-with-TypeScript-Prisma-PostgreSQL
```2- Install dependencies:
```bash
npm install
```3- Create a .env file in the root directory:
```.env
PORT=
API_VERSION=v1
BASE_URL=/api
DATABASE_URL=postgresql://:@localhost:5432/
JWT_SECRET=your-jwt-secret-key
JWT_REFRESH_SECRET=your-jwt-refresh-secret-key
```4- Set up the database:
```bash
npx prisma migrate dev # Apply the migrationsnpx prisma generate # Generate the Prisma Client
```5- Run the application:
```bash
npm run dev
```6- Production Build:
```bash
npm run build
npm start
```## API Endpoints
### Base URL
`http://localhost:3000/api/v1`
- Authentication:
- `POST /api/v1/auth/signup` - Register a new user
- `POST /api/v1/auth/signin` - Login user
- `POST /api/v1/auth/refresh-token` - Refresh access token- Notes:
- `POST /api/v1/note/create-note` - Create a new note
- `GET /api/v1/note/get-notes` - Get all notes (paginated)
- `GET /api/v1/note/get-note/:id` - Get a specific note
- `GET /api/v1/note/search-notes` - Search notes (paginated)
- `PUT /api/v1/note/update-note/:id` - Update a note
- `DELETE /api/v1/note/delete-note/:id` - Delete a note