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: 10 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 (4 months ago)
- Default Branch: main
- Last Pushed: 2025-02-03T13:37:46.000Z (3 months ago)
- Last Synced: 2025-03-29T11:12:26.782Z (about 1 month 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: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Express TypeScript Backend with Prisma
[](https://nodejs.org/)
[](https://www.typescriptlang.org/)
[](https://expressjs.com/)
[](https://www.prisma.io/)
[](https://www.postgresql.org/)
[](https://jwt.io/)
[](https://www.npmjs.com/package/bcryptjs)
[](https://express-validator.github.io/)
[](https://www.npmjs.com/package/express-rate-limit)
[](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