https://github.com/nicoaudy/express-zod-mongoose
Simple example for using zod for validation and mongoose for ORM
https://github.com/nicoaudy/express-zod-mongoose
Last synced: 2 months ago
JSON representation
Simple example for using zod for validation and mongoose for ORM
- Host: GitHub
- URL: https://github.com/nicoaudy/express-zod-mongoose
- Owner: nicoaudy
- Created: 2023-08-23T07:21:30.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-08-23T07:21:40.000Z (about 2 years ago)
- Last Synced: 2025-01-19T01:12:08.522Z (9 months ago)
- Language: TypeScript
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Simple REST API Implementation Mongoose, Zod & TypeScript
## Concepts
- REST API principals
- CRUD
- HTTP methods
- JWT & refresh tokens
- Request validation## Technologies
- Node.js
- MongoDB with Mongoose
- TypeScript
- Express.js & Express.js middleware
- Zod validation## Features
- logger
- Validate request middleware
- Registration
1. User model
2. User endpoint
3. User session
4. Deserialize user middleware (refresh tokens)
5. Get sessions
6. Delete session
7. Require user middleware
- Product resource
1. Product model
2. Create product
3. Read product
4. Update product
5. Delete productNote: Make sure you add .env to your .gitignore before pushing any changes to your repository. You will also want to generate new ACCESS_TOKEN_PUBLIC_KEY & ACCESS_TOKEN_PRIVATE_KEY keys and add them to your .env
#### Generate new keys: https://travistidwell.com/jsencrypt/demo/