https://github.com/tomdoestech/rest-api-for-scale
https://github.com/tomdoestech/rest-api-for-scale
drizzle-orm nodejs postgresql rest-api
Last synced: 4 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/tomdoestech/rest-api-for-scale
- Owner: TomDoesTech
- Created: 2024-12-28T03:43:19.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-28T03:55:12.000Z (over 1 year ago)
- Last Synced: 2024-12-28T04:27:57.356Z (over 1 year ago)
- Topics: drizzle-orm, nodejs, postgresql, rest-api
- Language: TypeScript
- Homepage: https://youtu.be/m1sNz9Fw_vY
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Build a REST API like a senior developer
## Need help?
The best place to get help is on Discord or X.
Discord: https://discord.gg/4ae2Esm6P7
X: https://x.com/tomdoes_tech
## What you will learn
* Basic Principals of REST APIs
* How to structure your applications
* How to test REST APIs
* How to use Docker for local development
* How to use Drizzle for database interactions
* How to use JSON Schema for API design
* Basic TypeScript
* How to capture and visualise metrics
## Modules
### User
* Functional style
* json-schema
### Job
* Object-oriented
* Dependency injection
* json-schema
## Job application
* Object-oriented
* Dependency injection
* Zod schema
## Features
* Authentication
* User management
* Job management
* Metrics
## Technology
* Node.js
* Fastify
* Drizzle
* Postgres
* TypeScript
* Pino
* Prometheus
* Grafana
## What you'll need
* A code editor - VSCode/Cursor
* A HTTP client - Postman
* Node.js installed
* Docker installed (Optional) or a Postgres instance
* SQL client - [TablePlus](https://tableplus.com) (Optional)
## Options for Postgres
* Docker (Recommended)
* Local Postgres instance
* DBngin (local) https://dbngin.com/
* Neon (Cloud) https://neon.tech/
* Supabase (Cloud) https://supabase.com/
## Part 1 - Design
* Database design
* API design
## Part 2 - Setup Docker (Optional)
* Postgres
* API
* Dozzle (Logs)
## Part 3 - Project setup
* Install dependencies
* Install dev dependencies
* Initalise project
* Setup database
* Setup logging
* Configure server
## Part 4 - User module
* Register user
* Login
* Get user
* Testing
## Part 5 - Job module
* Create job
* Get job
* Update job
* Delete job
* Testing
## Part 6 - Job application
* Create job application
* Get job applications for a job
* Update job application status
* Delete job application
* Testing
## Part 7 - Metrics
* Setup Prometheus
* Capture default metrics
* Add a histogram for all requests
* Add a custom metric for database calls
* Visualise metrics with Grafana
## Challenges
1. Verify the user's account via email
2. Add an OAuth flow with an identity provider like Google or GitHub
3. Add multi-tenancy
## Need help?
Discord: https://discord.gg/4ae2Esm6P7
Twitter: https://twitter.com/tomdoes_tech
Bluesky: https://tomdoestech.bsky.social