If you find this project helpful, please consider starring ⭐ this repository — it motivates me to create more content and helps others discover it too!
A hands-on reference project that demonstrates three classic creational design patterns—Singleton, Builder, and Prototype—implemented in a modern Node.js stack (Express 14 ▪ Prisma 5 ▪ PostgreSQL 15).
Why?
Developers often read about patterns in theory but rarely see them living inside a real-world codebase.
This repo stitches them into a minimal yet production-ready API so you can explore, tweak, and learn.
| Layer | Tech | Purpose |
|---|---|---|
| Server | Express JS | Lightweight HTTP routing & middleware |
| ORM | Prisma ORM | Typed DB client & migrations |
| DB | PostgreSQL 15 | Relational data store |
| Patterns | Singleton • Builder • Prototype | Clean, maintainable code architecture |
| Tooling | ESLint • Prettier • dotenv | Code quality & config management |
Follow these steps to run the project locally:
-
Clone the repository
git clone https://github.com/gamalsamadov/builder-singleton-example.git
-
Install dependencies
cd builder-singleton-example npm install -
Run the development server
npm run dev
Feel free to reach out to me if you have any questions or feedback!
- Email: info@samadov.dev
- Instagram: @samadov.dev
- LinkedIn: En. Samadov J.