{"id":22264257,"url":"https://github.com/nazim1971/backend-starter","last_synced_at":"2026-04-15T19:36:15.202Z","repository":{"id":265193116,"uuid":"894460692","full_name":"nazim1971/backend-starter","owner":"nazim1971","description":null,"archived":false,"fork":false,"pushed_at":"2024-11-28T06:49:26.000Z","size":48,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-25T14:14:20.215Z","etag":null,"topics":["eslint","express-js","module-pattern","prettier","typescript"],"latest_commit_sha":null,"homepage":"","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/nazim1971.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}},"created_at":"2024-11-26T11:52:12.000Z","updated_at":"2024-11-28T06:49:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"33d91e1b-4728-47ff-8bd4-e612a50df585","html_url":"https://github.com/nazim1971/backend-starter","commit_stats":null,"previous_names":["nazim1971/backend-starter"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nazim1971/backend-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nazim1971%2Fbackend-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nazim1971%2Fbackend-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nazim1971%2Fbackend-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nazim1971%2Fbackend-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nazim1971","download_url":"https://codeload.github.com/nazim1971/backend-starter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nazim1971%2Fbackend-starter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31857515,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"ssl_error","status_checked_at":"2026-04-15T15:24:39.138Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["eslint","express-js","module-pattern","prettier","typescript"],"created_at":"2024-12-03T10:08:19.517Z","updated_at":"2026-04-15T19:36:15.104Z","avatar_url":"https://github.com/nazim1971.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Here's a comprehensive guide to set up your project, along with a template for a `README.md` file. This will help you get started with a clean and well-structured environment for your Node.js application using TypeScript, Express, and other related tools.\n\n### **1. Project Setup**\n\n1. **Initialize the Project**\n   ```bash\n   npm init -y\n   ```\n\n2. **Install Required Dependencies**\n   ```bash\n   npm i cors dotenv express mongoose node zod\n   ```\n\n3. **Install Development Dependencies**\n   ```bash\n   npm i -D @types/cors @types/express@4.17.21 @types/mongoose @types/node rimraf typescript nodemon\n   ```\n\n4. **Initialize TypeScript Configuration**\n   ```bash\n   tsc --init\n   ```\n\n5. **Adjust `tsconfig.json` file**\n   - Ensure the TypeScript configuration (`tsconfig.json`) is set up as required. You can add specific settings like the following:\n     ```json\n     {\n       \"compilerOptions\": {\n         \"target\": \"ES6\",\n         \"module\": \"CommonJS\",\n         \"esModuleInterop\": true,\n         \"skipLibCheck\": true,\n         \"forceConsistentCasingInFileNames\": true,\n         \"outDir\": \"./dist\",\n         \"rootDir\": \"./src\"\n       },\n       \"include\": [\"src/**/*\"],\n       \"exclude\": [\"node_modules\"]\n     }\n     ```\n\n6. **Create `.gitignore` file**\n   - Add `node_modules` and `.env` to `.gitignore` to avoid committing sensitive information or dependencies:\n     ```\n     node_modules\n     .env\n     ```\n\n7. **Create `.env` file**\n   - Add your secure keys and environment variables to `.env`:\n     ```env\n     DATABASE_URI=your-database-uri\n     PORT=5000\n     ```\n\n8. **Create Folder Structure**\n   - Create the following directory structure:\n     ```\n     src\n     ├── app.ts\n     ├── server.ts\n     └── app\n         ├── config\n         ├── utilities\n         ├── errors\n         └── modules\n             └── student\n                 ├── student.controller.ts\n                 ├── student.interface.ts\n                 ├── student.model.ts\n                 ├── student.route.ts\n                 ├── student.service.ts\n                 └── student.zodValidation.ts\n     ```\n\n9. **Modify `package.json` Scripts**\n   - Add these scripts to the `package.json` file:\n     ```json\n     \"scripts\": {\n       \"dev\": \"nodemon src/server.ts\",\n       \"build\": \"rimraf dist \u0026\u0026 tsc\",\n       \"start\": \"node dist/server.js\",\n       \"lint\": \"eslint src\",\n       \"lint:fix\": \"eslint src --fix\",\n       \"pretty:fix\": \"prettier --write src\",\n       \"pretty\": \"prettier --ignore-path .gitignore --write ./src/**/*.{js,ts,json}\"\n     }\n     ```\n\n### **2. Install and Configure ESLint**\n\n1. **Install ESLint and Related Plugins**\n   ```bash\n   npm install eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin --save-dev\n   ```\n\n2. **Initialize ESLint Configuration**\n   ```bash\n   npx eslint --init\n   ```\n\n   During setup, choose:\n   - To use TypeScript.\n   - For your preferred style (you can select \"Airbnb\" or configure your own rules).\n   - Follow the prompts to create the `.eslintrc.mjs` file.\n\n3. **Install ESLint Prettier Config to Avoid Conflicts**\n   ```bash\n   npm install --save-dev eslint-config-prettier\n   ```\n\n4. **Adjust `eslint.config.mjs` file**\n\n   Ensure your ESLint configuration includes `eslint-config-prettier` to avoid conflicts with Prettier:\n   ```javascript\n   import pluginJs from '@eslint/js';\n   import eslintConfigPrettier from 'eslint-config-prettier';\n\n   export default [\n     pluginJs.configs.recommended,\n     eslintConfigPrettier,\n   ];\n   ```\n\n### **3. Install Prettier**\n\n1. **Install Prettier**\n   ```bash\n   npm i -D prettier\n   ```\n\n2. **Create `.prettierrc.json` File**\n\n   Add your Prettier configuration in `.prettierrc.json`:\n   ```json\n   {\n     \"semi\": true,\n     \"singleQuote\": true,\n     \"trailingComma\": \"all\",\n     \"tabWidth\": 2,\n     \"printWidth\": 80\n   }\n   ```\n\n### **4. Create a Professional README.md File**\n\nHere’s a sample template for your `README.md` file:\n\n```markdown\n# Backend Starter Template\n\n## Overview\nThis is a backend starter template built with TypeScript, Express, and MongoDB. It is configured with tools like ESLint, Prettier, and Zod for input validation. This template is ready to be used for building scalable and maintainable backend applications.\n\n## Features\n- TypeScript support\n- Express.js for building APIs\n- MongoDB for database management\n- Zod for schema validation\n- ESLint and Prettier for code linting and formatting\n- Dotenv for managing environment variables\n\n## Installation\n\n1. Clone the repository:\n   ```bash\n   git clone \u003crepository-url\u003e\n   ```\n\n2. Install dependencies:\n   ```bash\n   npm install\n   ```\n\n3. Create a `.env` file in the root directory and add the following environment variables:\n   ```env\n   DATABASE_URI=your-database-uri\n   PORT=5000\n   ```\n\n## Available Scripts\n\n- `npm run dev` - Runs the server with Nodemon (development mode).\n- `npm run build` - Builds the project using TypeScript.\n- `npm run start` - Runs the built server (production mode).\n- `npm run lint` - Lint the codebase using ESLint.\n- `npm run lint:fix` - Automatically fix linting issues.\n- `npm run pretty` - Format the codebase using Prettier.\n- `npm run pretty:fix` - Automatically fix Prettier formatting issues.\n\n## Folder Structure\n```\nsrc/\n├── app.ts\n├── server.ts\n└── app/\n    ├── config/\n    ├── utilities/\n    ├── errors/\n    └── modules/\n        └── student/\n            ├── student.controller.ts\n            ├── student.interface.ts\n            ├── student.model.ts\n            ├── student.route.ts\n            ├── student.service.ts\n            └── student.zodValidation.ts\n```\n\n## Author\n**Md. Nazim Uddin**  \nEmail: [nazimmuddin10@gmail.com](mailto:nazimmuddin10@gmail.com)\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n```\n\n---\n\n### **Final Notes:**\n- **Ensure sensitive data** is stored securely in `.env`, and never commit `.env` to your version control system.\n- Regularly **run linting and formatting scripts** (`npm run lint` and `npm run pretty`) to maintain consistent code style throughout the project.\n- This setup can be easily extended for various modules, routes, and services as needed.\n\nThis structure and configuration will help you maintain a clean, scalable, and industry-standard backend project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnazim1971%2Fbackend-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnazim1971%2Fbackend-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnazim1971%2Fbackend-starter/lists"}