{"id":21400056,"url":"https://github.com/shubhansu-kr/backend-nodejs-template","last_synced_at":"2026-04-17T08:02:41.287Z","repository":{"id":235228787,"uuid":"790336822","full_name":"shubhansu-kr/BackEnd-NodeJS-Template","owner":"shubhansu-kr","description":"Auth Template for Backend Projects","archived":false,"fork":false,"pushed_at":"2025-06-04T16:04:03.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-31T19:43:30.433Z","etag":null,"topics":["api","backend","express-js","jwt-authentication","nodejs","tempate"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/shubhansu-kr.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-04-22T17:38:38.000Z","updated_at":"2025-06-04T16:04:05.000Z","dependencies_parsed_at":"2024-04-22T19:04:07.798Z","dependency_job_id":"438905ed-d6cd-4c61-83e0-977282053743","html_url":"https://github.com/shubhansu-kr/BackEnd-NodeJS-Template","commit_stats":null,"previous_names":["shubhansu-kr/backend-nodejs-template"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/shubhansu-kr/BackEnd-NodeJS-Template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shubhansu-kr%2FBackEnd-NodeJS-Template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shubhansu-kr%2FBackEnd-NodeJS-Template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shubhansu-kr%2FBackEnd-NodeJS-Template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shubhansu-kr%2FBackEnd-NodeJS-Template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shubhansu-kr","download_url":"https://codeload.github.com/shubhansu-kr/BackEnd-NodeJS-Template/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shubhansu-kr%2FBackEnd-NodeJS-Template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31920518,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T18:22:33.417Z","status":"online","status_checked_at":"2026-04-17T02:00:06.879Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["api","backend","express-js","jwt-authentication","nodejs","tempate"],"created_at":"2024-11-22T15:17:49.548Z","updated_at":"2026-04-17T08:02:41.267Z","avatar_url":"https://github.com/shubhansu-kr.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Express Backend Template with JWT Auth\n\nA clean, scalable starter template for backend projects using **Node.js**, **Express**, and **JWT authentication** — built for speed, structure, and security.\n\n---\n\n## Features\n\n✅ Structured project architecture  \n✅ JWT-based authentication (login \u0026 protected routes)  \n✅ Environment-based config management  \n✅ Middleware for errors, auth, and logging  \n✅ Modular routing and controller pattern  \n✅ Ready-to-use `User` model (MongoDB)  \n✅ Built-in input validation  \n✅ Easily extendable for any backend API\n\n---\n\n## Project Structure\n\n```yaml\n/\n├── config/ # App \u0026 DB config (env, connection setup)\n├── controllers/ # Route handlers (business logic)\n├── middleware/ # Auth, error handling, and custom middleware\n├── models/ # Mongoose models (e.g., User)\n├── routes/ # Modular API route definitions\n├── utils/ # Utility functions (e.g., token generation)\n├── .env.example # Sample environment variables\n├── server.js # Entry point of the application\n└── README.md\n```\n\n---\n\n## Authentication Overview\n\n- Users authenticate via email/password\n- JWT token is issued on login\n- Protected routes validate JWT before granting access\n\n---\n\n## Built With\n\n- **Node.js**\n- **Express.js**\n- **MongoDB + Mongoose**\n- **jsonwebtoken**\n- **dotenv**\n- **bcryptjs**\n- (Optional: Add any others used)\n\n---\n\n## Getting Started\n\n### 1. Clone the repo\n\n```bash\ngit clone https://github.com/\u003cyour-username\u003e/\u003crepo-name\u003e.git\ncd \u003crepo-name\u003e\n```\n\n2. Install dependencies\n```bash\nnpm install\n```\n\n4. Setup environment variables\nCopy .env.example to .env and fill in the values:\n```\nPORT=5000\nMONGO_URI=your_mongodb_uri\nJWT_SECRET=your_secret_key\n```\n\n5. Run the app\n```bash\nnpm run dev\n```\n\nServer will start at: http://localhost:5000\n\n## API Endpoints\nAuth\nPOST /api/auth/register – Register a new user\n\nPOST /api/auth/login – Login and receive JWT\n\nUser (Protected)\nGET /api/user/profile – Get user details (requires JWT)\n\nMore routes can be added easily following the same pattern.\n\n## Extend This Template\nAdd other models (e.g., Post, Product)\n\nAdd roles/permissions\n\nPlug in Redis, PostgreSQL, or other services\n\nIntegrate with frontend (React, Vue, etc.)\n\n## Best Practices Followed\nFolder separation by concern\n\nMinimal but robust auth flow\n\nEnvironment-based config\n\nError and exception handling\n\nModular design for scalability\n\n## License\nThis project is open-source and available under the MIT License.\n\n## Author\nMaintained by shubhansu-kr\nPull requests, issues, and forks are welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshubhansu-kr%2Fbackend-nodejs-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshubhansu-kr%2Fbackend-nodejs-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshubhansu-kr%2Fbackend-nodejs-template/lists"}