{"id":23782293,"url":"https://github.com/dpvasani/backend-template-typescript","last_synced_at":"2025-10-28T19:14:06.444Z","repository":{"id":269868287,"uuid":"908669460","full_name":"dpvasani/Backend-Template-TypeScript","owner":"dpvasani","description":"This repository provides a production-grade backend template for Node.js applications using Express.js and TypeScript, with Mongoose for MongoDB integration. It includes a foundational structure, environment configuration, and a basic User model to jump start your backend development.","archived":false,"fork":false,"pushed_at":"2025-02-27T16:44:27.000Z","size":145,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-11T03:33:25.813Z","etag":null,"topics":["mongodb","mongoose","nodejs","rest-api","restful-api","typescript"],"latest_commit_sha":null,"homepage":"https://dpvasani.github.io/Backend-Template-TypeScript/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dpvasani.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2024-12-26T16:43:55.000Z","updated_at":"2025-02-27T16:44:31.000Z","dependencies_parsed_at":"2024-12-26T19:26:55.899Z","dependency_job_id":"e057d727-5991-48e7-9081-6e2538e862cf","html_url":"https://github.com/dpvasani/Backend-Template-TypeScript","commit_stats":null,"previous_names":["dpvasani/backend-template-typescript"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dpvasani/Backend-Template-TypeScript","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpvasani%2FBackend-Template-TypeScript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpvasani%2FBackend-Template-TypeScript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpvasani%2FBackend-Template-TypeScript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpvasani%2FBackend-Template-TypeScript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dpvasani","download_url":"https://codeload.github.com/dpvasani/Backend-Template-TypeScript/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpvasani%2FBackend-Template-TypeScript/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265067607,"owners_count":23706304,"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":["mongodb","mongoose","nodejs","rest-api","restful-api","typescript"],"created_at":"2025-01-01T12:14:30.966Z","updated_at":"2025-10-28T19:14:06.109Z","avatar_url":"https://github.com/dpvasani.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Backend Template TypeScript\n\nThis repository provides a production-grade backend template for Node.js applications using Express.js and TypeScript, with Mongoose for MongoDB integration. It includes a foundational structure, environment configuration, and a basic User model to jump start your backend development.\n\n\n## Features\n\n* **Production-Grade Setup:** Configured for scalability, security, and performance.\n* **Express.js:** Minimalist web framework for routing and middleware.\n* **TypeScript:** Enforced type safety for improved code maintainability and reduced runtime errors.\n* **Mongoose:** Object Data Modeling (ODM) for seamless interaction with MongoDB.\n* **User Model:** Pre-configured with basic fields like name, email, and password (extendable).\n* **Prettier:** Code formatting with custom rules for consistent code style.\n* **Environment Configuration:** `.env` file for secure storage of sensitive data (e.g., database credentials, API keys).\n* **Git Best Practices:** `.gitignore` for keeping sensitive files out of version control.\n* **TypeScript Integration:** Highlights the use of TypeScript for type safety.\n* **Folder Structure Breakdown:** A detailed explanation of the folder structure with example file names.\n* **Getting Started Prerequisites:** Basic understanding of TypeScript is required.\n* **Code Formatting and Linting:** Configured with Prettier and `.prettierrc` for consistent code style.\n* **Concise and Informative:** Clear and structured content for easy understanding.\n\n## Folder Structure\n\n```\nBackend Template TypeScript/\n├── node_modules/             # Dependencies\n├── public/                   # Static assets\n├── src/                      # Main source code\n│   ├── index.ts              # Entry point\n│   ├── app.ts                # Express app setup\n│   ├── constant.ts           # Constants file\n│   ├── controllers/          # Controller files\n│   │   └── user.controller.ts\n│   ├── db/                   # Database connection setup\n│   │   └── database.ts\n│   ├── middlewares/          # Middleware functions\n│   │   ├── auth.middleware.ts\n│   │   └── multer.middleware.ts\n│   ├── models/               # Data models\n│   │   └── user.model.ts\n│   ├── routes/               # Route handlers\n│   │   └── user.routes.ts\n│   └── utils/                # Utility functions\n│       ├── ApiError.ts\n│       ├── ApiResponse.ts\n│       ├── asyncHandler.ts\n│       └── cloudinary.ts\n├── .env                      # Environment variables\n├── .env.example              # Example .env file\n├── .eslintrc.json            # ESLint configuration\n├── .gitignore                # Git ignore file\n├── package-lock.json         # Locked dependencies\n├── package.json              # Project dependencies and scripts\n├── Readme.md                 # Project documentation\n└── tsconfig.json             # TypeScript configuration\n```\n\n## Getting Started\n\n### Prerequisites\n\n* **Node.js** (v14 or later)\n* **MongoDB** (local or cloud instance)\n* **Basic understanding of TypeScript**\n\n### Environment Variables\n\nCreate a `.env` file in the root directory and add the following:\n\n```\n# Example .env file\n\nPORT=4000\nMONGODB_URL=YourMongoDBURL\nCORS_ORIGIN=*\n\nACCESS_TOKEN_SECRET=Darshan\nACCESS_TOKEN_EXPIRY=1d\nREFRESH_TOKEN_SECRET=Dpvasani\nREFRESH_TOKEN_EXPIRY=10d\n\nCLOUDINARY_CLOUD_NAME=YourCloudName\nCLOUDINARY_API_KEY=YourApiKey\nCLOUDINARY_API_SECRET=YourApiSecret\n```\n\n### Installation\n\n1. Clone the repository:\n\n```bash\ngit clone https://github.com/dpvasani/Backend-Template-TypeScript\ncd Backend-Template-TypeScript\n```\n\n2. Install dependencies:\n\n```bash\nnpm install\n```\n\n3. Set up your MongoDB connection string and other environment variables in the `.env` file.\n\n### Start the Server\n\nTo run the development server:\n\n```bash\nnpm run dev\n```\n\nThis will start the development server.\n\n## Contributing\n\nFeel free to open issues or create pull requests if you have suggestions for improvements!\n\n## License\n\nThis project is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdpvasani%2Fbackend-template-typescript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdpvasani%2Fbackend-template-typescript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdpvasani%2Fbackend-template-typescript/lists"}