{"id":30453505,"url":"https://github.com/devsafix/mern-backend-template","last_synced_at":"2026-04-13T14:33:25.238Z","repository":{"id":310564029,"uuid":"1040347167","full_name":"devsafix/mern-backend-template","owner":"devsafix","description":"A ready-to-use MERN Backend Template with TypeScript, modular structure, MVC pattern, Redis, Mongoose, authentication, user management, email/OTP verification, global error handling, and more. Clone, configure, and build production-ready apps faster!","archived":false,"fork":false,"pushed_at":"2025-09-04T09:13:20.000Z","size":81,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-06T02:26:42.006Z","etag":null,"topics":["brcypt","cookie-parser","cors","ejs-templates","expressjs","jwt","mongoose","nodejs","nodemailer","redis","typescript","zod"],"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/devsafix.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":"2025-08-18T20:48:48.000Z","updated_at":"2025-09-04T09:13:23.000Z","dependencies_parsed_at":"2025-08-18T23:38:36.354Z","dependency_job_id":null,"html_url":"https://github.com/devsafix/mern-backend-template","commit_stats":null,"previous_names":["devsafix/mern-backend-template"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/devsafix/mern-backend-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devsafix%2Fmern-backend-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devsafix%2Fmern-backend-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devsafix%2Fmern-backend-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devsafix%2Fmern-backend-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devsafix","download_url":"https://codeload.github.com/devsafix/mern-backend-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devsafix%2Fmern-backend-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31757479,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T13:27:56.013Z","status":"ssl_error","status_checked_at":"2026-04-13T13:21:23.512Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["brcypt","cookie-parser","cors","ejs-templates","expressjs","jwt","mongoose","nodejs","nodemailer","redis","typescript","zod"],"created_at":"2025-08-23T16:00:52.027Z","updated_at":"2026-04-13T14:33:25.219Z","avatar_url":"https://github.com/devsafix.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MERN Backend Template\n\nA production-ready **MERN backend template** built with **TypeScript**, designed to save development time with pre-configured setups and best practices.  \nJust clone, configure, and start building scalable backend applications with ease.\n\n---\n\n## Features\n\n- **Project Structure**\n\n  - Modular folder structure (MVC pattern + feature-based modules)\n  - Pre-configured `Auth` \u0026 `User` modules (controllers, services, routes, validations, interfaces, models)\n\n- **Development Setup**\n\n  - TypeScript configuration\n  - ESLint + Prettier setup for clean \u0026 consistent code\n  - Environment variables configuration\n\n- **Database**\n\n  - Mongoose setup with models \u0026 interfaces\n  - Auto **Admin user creation** on first run\n\n- **Core Utilities**\n\n  - Global error handling middleware\n  - Custom utility functions\n  - Request validation with Zod/Yup (if using)\n  - Redis setup for caching, sessions, or OTPs\n\n- **Email \u0026 Authentication**\n\n  - User authentication module\n  - OTP verification via email\n  - Secure password handling with hashing\n  - JWT authentication (access/refresh tokens)\n\n- **Ready-to-Extend**\n  - Routes, middlewares, and service layers already set up\n  - Easy to create new modules\n  - Clone \u0026 rename for instant project setup\n\n## Folder Structure\n\n```\n\nmern-backend-template/\n├── app/\n│   ├── config/         # Env, Redis configs\n│   ├── errorHelpers/\n│   ├── routes/\n│   ├── interfaces/\n│   ├── helpers/\n│   ├── modules/\n│   │   ├── auth/       # Auth controllers, routes, services, validation\n│   │   ├── user/       # User controllers, routes, services, validation\n│   ├── middlewares/    # Error handler, auth guard, etc.\n│   ├── utils/          # Helper functions\n│   ├── app.ts          # Express app setup\n│   └── server.ts       # Entry point\n├── .env.example        # Example env variables\n├── tsconfig.json       # TypeScript config\n├── .eslintrc.json      # ESLint rules\n├── package.json\n└── README.md\n\n```\n\n---\n\n## Getting Started\n\n### Clone the repository\n\n```bash\nhttps://github.com/devsafix/mern-backend-template\ncd mern-backend-template\n```\n\n### Install dependencies\n\n```bash\nnpm install\n```\n\n### Configure environment variables\n\nRename `.env.example` → `.env` and update values:\n\n### Start the server\n\n```bash\nnpm run dev\n```\n\nYour server will start on `http://localhost:5000`\n\n---\n\n## Scripts\n\n```bash\nnpm run dev     # Start in development with ts-node-dev\nnpm run build   # Build TypeScript to JavaScript\nnpm start       # Run production build\nnpm lint        # Run ESLint checks\n```\n\n---\n\n## Contributing\n\nContributions are welcome! Feel free to fork this repo, open issues, and submit PRs.\n\n---\n\n## Author\n\n**Kawser Ferdous Safi** – [devsafix.vercel.app](https://devsafix.vercel.app)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevsafix%2Fmern-backend-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevsafix%2Fmern-backend-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevsafix%2Fmern-backend-template/lists"}