{"id":14986474,"url":"https://github.com/muneebhashone/typescript-backend-toolkit","last_synced_at":"2025-05-16T12:11:42.079Z","repository":{"id":252594501,"uuid":"840890740","full_name":"muneebhashone/typescript-backend-toolkit","owner":"muneebhashone","description":"TypeScript Backend Toolkit - Express.js - Swagger (OpenAPI 3.0) Autogenered docs, Zod - BullMQ - React Email - Mailgun - Docker - MongoDB (Mongoose) - Socket.io","archived":false,"fork":false,"pushed_at":"2025-02-22T17:12:27.000Z","size":5309,"stargazers_count":292,"open_issues_count":3,"forks_count":51,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-09T08:03:40.884Z","etag":null,"topics":["boilerplate","bullmq","express","javascript","mailgun","mongoose","node","openapi","openapi-generator","openapi-specification","postgresql","prisma","react","react-email","socket-io","swagger","template","toolkit","typescript","zod"],"latest_commit_sha":null,"homepage":"https://tstoolkit.themuneebh.com","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/muneebhashone.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":"2024-08-11T02:19:59.000Z","updated_at":"2025-04-07T07:57:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"af4ce9a1-0c81-48b2-8829-f1d060d037b2","html_url":"https://github.com/muneebhashone/typescript-backend-toolkit","commit_stats":{"total_commits":109,"total_committers":5,"mean_commits":21.8,"dds":0.3669724770642202,"last_synced_commit":"b1fa0a80d8d47e0e94cdd64aa0513de8ffb54da2"},"previous_names":["muneebhashone/typescript-backend-toolkit"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muneebhashone%2Ftypescript-backend-toolkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muneebhashone%2Ftypescript-backend-toolkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muneebhashone%2Ftypescript-backend-toolkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muneebhashone%2Ftypescript-backend-toolkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/muneebhashone","download_url":"https://codeload.github.com/muneebhashone/typescript-backend-toolkit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254527099,"owners_count":22085919,"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":["boilerplate","bullmq","express","javascript","mailgun","mongoose","node","openapi","openapi-generator","openapi-specification","postgresql","prisma","react","react-email","socket-io","swagger","template","toolkit","typescript","zod"],"created_at":"2024-09-24T14:12:55.631Z","updated_at":"2025-05-16T12:11:42.056Z","avatar_url":"https://github.com/muneebhashone.png","language":"TypeScript","readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"logo.webp\" width=\"200px\" align=\"center\" alt=\"Zod logo\" /\u003e\n  \u003ch1 align=\"center\"\u003e✨ TypeScript Backend Toolkit ✨\u003c/h1\u003e\n  \u003cp align=\"center\"\u003e\n    \u003cbr/\u003e\n    Robust backend boilerplate designed for scalability, flexibility, and ease of development. It's packed with modern technologies and best practices to kickstart your next backend project.\n  \u003c/p\u003e\n\u003c/p\u003e\n\u003cbr/\u003e\n\n## Prerequisites\n\nBefore you get started, make sure you have the following installed on your machine:\n\n- **Docker + Docker Compose**\n- **PNPM**\n- **Node.js 20+ (LTS)**\n\n## How to Run\n\n1. **Set up Docker Services**:\n\n   - Run the following command to start MongoDB and Redis instances locally:\n     ```sh\n     docker compose up -d\n     ```\n2. **Install Dependencies**:\n\n   - Use pnpm to install all the necessary dependencies:\n     ```sh\n     pnpm i\n     ```\n3. **Configure Environment Variables**:\n\n   - Create a `.env` file in the root directory.\n   - Use the provided `.env.sample` as a template to enter all the required environment variables.\n\n## What's Included\n\n- **OpenAPI Autogenerated Swagger Docs** : Automatically generated Swagger docs through MagicRouter API and Zod, accessible at `/api-docs`.\n- **Auth Module**: Includes Google Sign-In support for easy authentication.\n- **User Management**: Comprehensive user management functionality.\n- **File Upload**: Handles file uploads with Multer and Amazon S3.\n- **Data Validation \u0026 Serialization**: Zod is used for validation and serialization of data.\n- **Configuration Management**: Managed using dotenv-cli and validated with Zod for accuracy and safety.\n- **Middlewares**:\n  - **Authorization**: Built-in authorization middleware.\n  - **Zod Schema Validation**: Ensures your API inputs are correctly validated.\n  - **JWT Extraction**: Easily extract and verify JWT tokens.\n- **Type-safe Email Handling**: Emails are managed using React Email and Mailgun for dynamic and flexible email handling.\n- **Queues**: Powered by BullMQ with Redis for handling background jobs.\n- **ESLint Setup**: Pre-configured ESLint setup for consistent code quality.\n  ```sh\n  pnpm run lint\n  ```\n- **Development Server**: Run the server in development mode using ts-node-dev:\n  ```sh\n  pnpm run dev\n  ```\n- **Build Process**: Efficiently bundle your project using tsup:\n  ```sh\n  pnpm run build\n  ```\n- **PM2 Support**: Out-of-the-box support for PM2 to manage your production processes.\n\n## Folder Structure\n```plaintext\n├── build.ts\n├── docker-compose.yml\n├── docs\n│   └── EMAIL.md\n├── ecosystem.config.js\n├── eslint.config.mjs\n├── LICENSE\n├── logo.webp\n├── modules.d.ts\n├── package.json\n├── pnpm-lock.yaml\n├── public\n│   ├── index.html\n│   ├── logo.webp\n│   ├── script.js\n│   └── styles.css\n├── README.md\n├── src\n│   ├── common\n│   │   ├── common.schema.ts\n│   │   └── common.utils.ts\n│   ├── config\n│   │   └── config.service.ts\n│   ├── email\n│   │   ├── email.service.ts\n│   │   └── templates\n│   │       └── ResetPassword.tsx\n│   ├── enums.ts\n│   ├── healthcheck\n│   │   ├── healthcheck.controller.ts\n│   │   └── healthcheck.routes.ts\n│   ├── lib\n│   │   ├── aws.service.ts\n│   │   ├── common.schema.ts\n│   │   ├── database.ts\n│   │   ├── email.server.ts\n│   │   ├── logger.service.ts\n│   │   ├── mailgun.server.ts\n│   │   ├── queue.server.ts\n│   │   ├── realtime.server.ts\n│   │   ├── redis.server.ts\n│   │   └── session.store.ts\n│   ├── main.ts\n│   ├── middlewares\n│   │   ├── can-access.middleware.ts\n│   │   ├── extract-jwt-schema.middleware.ts\n│   │   ├── multer-s3.middleware.ts\n│   │   └── validate-zod-schema.middleware.ts\n│   ├── modules\n│   │   ├── auth\n│   │   │   ├── auth.constants.ts\n│   │   │   ├── auth.controller.ts\n│   │   │   ├── auth.router.ts\n│   │   │   ├── auth.schema.ts\n│   │   │   └── auth.service.ts\n│   │   └── user\n│   │       ├── user.controller.ts\n│   │       ├── user.dto.ts\n│   │       ├── user.model.ts\n│   │       ├── user.router.ts\n│   │       ├── user.schema.ts\n│   │       └── user.services.ts\n│   ├── openapi\n│   │   ├── magic-router.ts\n│   │   ├── openapi.utils.ts\n│   │   ├── swagger-doc-generator.ts\n│   │   ├── swagger-instance.ts\n│   │   └── zod-extend.ts\n│   ├── queues\n│   │   └── email.queue.ts\n│   ├── routes\n│   │   └── routes.ts\n│   ├── types.ts\n│   ├── upload\n│   │   ├── upload.controller.ts\n│   │   └── upload.router.ts\n│   └── utils\n│       ├── api.utils.ts\n│       ├── auth.utils.ts\n│       ├── common.utils.ts\n│       ├── email.utils.ts\n│       ├── getPaginator.ts\n│       ├── globalErrorHandler.ts\n│       ├── isUsername.ts\n│       └── responseInterceptor.ts\n└── tsconfig.json\n```\n\n## Roadmap\n\n- **Socket.io Support:** Adding support for Redis adapter and a chat module.\n- **Notification Infrastructure**: Notifications via FCM and Novu.\n- **Ansible Playbook** : Create an Ansible playbook for server configuration to set up a basic environment quickly and consistently.\n- **AWS CDK Support** : Integrate AWS CDK for infrastructure management, making it easier to deploy and manage cloud resources.\n- **Monorepo Support** : Implement monorepo architecture using Turborepo and Pnpm for better project organization and scalability.\n- **AWS Lambda Support** : Add support for deploying serverless functions on AWS Lambda.\n- **Cloudflare Workers Support** : Enable Cloudflare Workers support for edge computing and faster request handling.\n- **Containerization with Docker** : Implement containerization to ensure the project can be easily deployed to any environment using Docker.\n- **Kubernetes Support** : Integrate Kubernetes for container orchestration, enabling scalable and automated deployment of the application.\n- **CI/CD with GitHub Actions** : Implement a CI/CD pipeline using GitHub Actions to automate testing, building, and deployment processes.\n- **Testing with Jest**: Add support for unit and integration testing using Jest to ensure code reliability and maintainability.\n\n## Contributions\n\nFeel free to contribute to this project by submitting issues or pull requests. Let's build something amazing together!\n\n## **License**\n\nThis project is licensed under the MIT License - see the [LICENSE](./LICENSE) file for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuneebhashone%2Ftypescript-backend-toolkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmuneebhashone%2Ftypescript-backend-toolkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuneebhashone%2Ftypescript-backend-toolkit/lists"}