{"id":25519567,"url":"https://github.com/phenom-world/node-express-prisma-starter-broilerplate","last_synced_at":"2025-04-11T00:22:31.226Z","repository":{"id":276874700,"uuid":"930584893","full_name":"phenom-world/Node-Express-Prisma-Starter-Broilerplate","owner":"phenom-world","description":"A production-ready Node.js Express boilerplate with TypeScript, Prisma ORM, Redis, and Object-Oriented Programming (OOP) principles.","archived":false,"fork":false,"pushed_at":"2025-02-10T23:20:12.000Z","size":41,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T21:11:17.371Z","etag":null,"topics":["expressjs","generic-repository","nodemailer","oop-principles","prisma-orm","redis-cache","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phenom-world.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-10T21:46:22.000Z","updated_at":"2025-02-12T01:08:57.000Z","dependencies_parsed_at":"2025-02-10T23:34:12.602Z","dependency_job_id":null,"html_url":"https://github.com/phenom-world/Node-Express-Prisma-Starter-Broilerplate","commit_stats":null,"previous_names":["phenom-world/node-express-prisma-starter-broilerplate"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phenom-world%2FNode-Express-Prisma-Starter-Broilerplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phenom-world%2FNode-Express-Prisma-Starter-Broilerplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phenom-world%2FNode-Express-Prisma-Starter-Broilerplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phenom-world%2FNode-Express-Prisma-Starter-Broilerplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phenom-world","download_url":"https://codeload.github.com/phenom-world/Node-Express-Prisma-Starter-Broilerplate/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248318932,"owners_count":21083751,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["expressjs","generic-repository","nodemailer","oop-principles","prisma-orm","redis-cache","typescript"],"created_at":"2025-02-19T17:20:00.697Z","updated_at":"2025-04-11T00:22:31.194Z","avatar_url":"https://github.com/phenom-world.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Node-Express-Prisma-Starter-Boilerplate\n\nA production-ready Node.js Express boilerplate with TypeScript, featuring robust architecture, Prisma ORM with generic repository pattern and Object-Oriented Programming (OOP) principles.\n\n## Features\n\n- **TypeScript Support** - Written in TypeScript for better developer experience and type safety.\n- **Express.js** - Fast, unopinionated web framework for Node.js.\n- **Prisma ORM** - Database access with a **Generic Repository Pattern**, following OOP principles for better maintainability and reusability.\n- **Redis Integration** - Redis support for caching to improve performance.\n- **Error Handling** - Centralized global error handling middleware.\n- **API Documentation** - Auto-generated route documentation.\n- **Code Quality**\n  - ESLint for code linting.\n  - Prettier for code formatting.\n- **Event System** - Built-in event handling system for better modularization.\n- **Middleware** - Common middleware implementations:\n  - Authentication middleware.\n  - Error handling middleware.\n  - Rate limiting middleware.\n  - Pagination middleware.\n  - Request validation middleware.\n- **Postman Collection** - `Broilerplate.postman_collection.json` included for API testing.\n- **Object-Oriented Architecture** - Designed with OOP principles, ensuring modularity, reusability, and scalability.\n\n## Prerequisites\n\n- Node.js (v16 or higher)\n- npm or yarn\n- Redis server\n- PostgreSQL or any database supported by Prisma\n\n## Installation\n\n1. **Clone the repository:**\n\n   ```bash\n   git clone \u003crepository-url\u003e\n   cd \u003cproject-name\u003e\n   ```\n\n2. **Install dependencies:**\n\n   ```bash\n   npm install\n   # or\n   yarn install\n   ```\n\n3. **Setup environment variables:**\n\n   ```bash\n   cp .env.example .env\n   ```\n\n   - Open `.env` and update the configuration as needed.\n\n4. **Generate Prisma client:**\n\n   ```bash\n   npm run prisma:generate\n   ```\n\n5. **Run database migrations:**\n\n   ```bash\n   npm run prisma:migrate:dev\n   ```\n\n6. **Seed the database with initial data:**\n\n   ```bash\n   npm run prisma:seed\n   ```\n\n## Project Structure\n\n```\nsrc/\n├── app/\n│   ├── middlewares/       # Express middlewares\n│   ├── modules/           # Feature modules\n│   │   └───├── constants/\n│   │       ├── controllers/\n│   │       ├── helpers/\n│   │       ├── interfaces/\n│   │       ├── routes/\n│   │       ├── services/\n│   │       └── router.ts\n│   └── index.ts          # Express app configuration\n├── config/               # Configuration files\n├── shared/              # Shared utilities and helpers\n├── types/               # TypeScript type definitions\n└── server.ts            # Application entry point\n```\n\n## Usage\n\n### **Development Mode**\n\n```bash\nnpm run dev\n# or\nyarn dev\n```\n\n### **Database Management Scripts**\n\n- **Generate Prisma client**\n  ```bash\n  npm run prisma:generate\n  ```\n- **Run migrations (development)**\n  ```bash\n  npm run prisma:migrate:dev\n  ```\n- **Reset database**\n  ```bash\n  npm run prisma:db:reset\n  ```\n- **Open Prisma Studio**\n  ```bash\n  npm run prisma:studio\n  ```\n- **Seed database**\n  ```bash\n  npm run prisma:seed\n  ```\n\n## API Documentation\n\n- The application automatically logs all available routes.\n- Use the provided **Postman Collection (`Broilerplate.postman_collection.json`)** to test API endpoints.\n\n## Error Handling\n\nThe application includes a centralized error-handling system. Any error that occurs is caught and formatted before being sent to the client, ensuring a standardized response structure.\n\n## Security Measures\n\nThis boilerplate includes several security enhancements:\n\n- **Helmet.js** for setting security headers.\n- **Rate Limiting** to prevent excessive API requests.\n- **CORS Configuration** for cross-origin security.\n- **Disabled `x-powered-by` Header** to mask Express usage.\n- **Request Size Limiting** to prevent large payload attacks.\n\n## Contributing\n\nContributions are welcome! Please follow these steps:\n\n1. Fork the repository.\n2. Create a new branch (`feature/your-feature` or `fix/your-fix`).\n3. Commit your changes.\n4. Push the branch and create a pull request.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphenom-world%2Fnode-express-prisma-starter-broilerplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphenom-world%2Fnode-express-prisma-starter-broilerplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphenom-world%2Fnode-express-prisma-starter-broilerplate/lists"}