{"id":13990834,"url":"https://github.com/ngduc/node-rem","last_synced_at":"2025-04-06T07:10:34.060Z","repository":{"id":34220974,"uuid":"150382618","full_name":"ngduc/node-rem","owner":"ngduc","description":"Node REM - NodeJS Rest Express MongoDB and more: typescript, passport, JWT, socket.io, HTTPS, HTTP2, async/await, nodemailer, templates, pagination, docker, etc. Live Demo: https://node-rem-ngduc.vercel.app","archived":false,"fork":false,"pushed_at":"2023-03-06T17:28:25.000Z","size":8553,"stargazers_count":245,"open_issues_count":31,"forks_count":50,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-30T06:04:27.919Z","etag":null,"topics":["boilerplate","es2017","es6","express","express-boilerplate","microservices","mongodb","mongoose","nodejs","rest-api","typescript"],"latest_commit_sha":null,"homepage":"","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/ngduc.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2018-09-26T07:01:21.000Z","updated_at":"2025-03-15T06:02:21.000Z","dependencies_parsed_at":"2024-01-18T05:17:07.252Z","dependency_job_id":"a2e61289-ad35-44e0-a361-9a3280e296da","html_url":"https://github.com/ngduc/node-rem","commit_stats":{"total_commits":189,"total_committers":6,"mean_commits":31.5,"dds":"0.34391534391534395","last_synced_commit":"d488838e41ed039eda497826ab6d637490a622d5"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngduc%2Fnode-rem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngduc%2Fnode-rem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngduc%2Fnode-rem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngduc%2Fnode-rem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ngduc","download_url":"https://codeload.github.com/ngduc/node-rem/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247445669,"owners_count":20939958,"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","es2017","es6","express","express-boilerplate","microservices","mongodb","mongoose","nodejs","rest-api","typescript"],"created_at":"2024-08-09T13:03:21.981Z","updated_at":"2025-04-06T07:10:34.037Z","avatar_url":"https://github.com/ngduc.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# Node REM\n\nNodeJS Rest Express MongoDB (REM) - a production-ready lightweight backend setup.\n\n[![Build Status](https://travis-ci.org/ngduc/node-rem.svg?branch=master)](https://travis-ci.org/ngduc/node-rem) [![Maintainability](https://api.codeclimate.com/v1/badges/11155b15b675ef311f72/maintainability)](https://codeclimate.com/github/ngduc/node-rem/maintainability)\n\n[Live Demo](https://node-rem-ngduc.vercel.app/) (login with a test user: user1@example.com, user111 - inspect API calls to learn more)\n\n🌟 It rains ~~cats and dogs~~ features:\n\n```\n  Typescript      Express   CORS     Helmet    DotEnv   joi (validation)   forever\n  Mongoose        Passport  JWT      Await\n  Tslint          Apidoc    Docker   Husky    Morgan    Travis   Unix/Mac/Win (Powershell)\n  Tests\n            Mocha  Chai     Sinon    istanbul\n  MORE:\n            HTTPS           HTTP2 (spdy)      Socketio 2.1       Init DB Data\n            Slack message   Nodemailer        Mailgun            Email Templates    Forgot Password\n            VSCode Debug    Dependabot        Codacy             File upload (multer)\n      API\n            API response    (data, meta: limit, offset, sort)    Transform res\n            apiJson         Pagination query\n            Regex query     Whitelist fields in response         Populate deep fields\n            mstime          API response time     Stack trace in Response\n      UI Example\n            CRA, Typescript, React-router, Axios, PostCSS, Tailwind. Components: Login, Home, ItemView.\n            Portable-react\n```\n  - More details in [Documentation / Features](src_docs/features.md)\n\n### 📦 Installation\n\nRequire: `MongoDB` and `NodeJS v8.12.0 +`\n\nClone this project:\n```\ngit clone https://github.com/ngduc/node-rem.git your-app\ncd your-app\nrm -rf .git   (remove this github repo's git settings)\nyarn\n```\n- Update `package.json` and `.env` file with your information.\n- Run `yarn dev`, it will create a new Mongo DB \"node-rem\"\n- Verify `yarn test` can run all unit tests.\n- Verify: use Postman to POST http://localhost:3009/api/v1/auth/register to create a new user. (set payload to have email, password)\n```\ncurl -k -d '{\"email\": \"example1@email.com\", \"password\": \"testpsw\"}' -H \"Content-Type: application/json\" -X POST http://localhost:3009/api/v1/auth/register\n```\n\n### 🔧 Commands\n\n```\n- Start MongoDB first. Verify .env variables.\n\nyarn dev      launch DEV mode\nyarn start    launch PROD mode\nyarn stop\n\nyarn test     Run tests   (requires MongoDB)\n```\n\n#### Frontend Example - uses this node-rem backend:\n```\n- First, start the Backend with: yarn dev\n\n- Then, start UI:\ncd ./ui\nyarn\nyarn start    (then open http://localhost:3000 - login with a test user: user1@example.com, user111)\n```\n\n### 📖 Features\n\nYour simple `API Route Handler` will have a nice syntax like this: (packed with ~~vitamins~~ cool stuffs)\n```js\nexports.list = async (req: Request, res: Response, next: NextFunction) =\u003e {\n  try {\n    const data = (await User.list(req)).transform(req); // query \u0026 run userSchema.transform() for response\n    apiJson({ req, res, data, model: User }); // return standard API Response\n  } catch (e) {\n    next(e);\n  }\n};\n```\n\nAPI Response is similar to [JSON API](http://jsonapi.org/examples/#pagination) standard:\n\n```js\nGET http://localhost:3009/api/v1/users?fields=id,email\u0026email=*user1* (get id \u0026 email only in response)\nGET http://localhost:3009/api/v1/users?page=1\u0026perPage=20 (query \u0026 pagination)\nGET http://localhost:3009/api/v1/users?limit=5\u0026offset=0\u0026sort=email:desc,createdAt\n{\n    \"meta\": {\n        \"limit\": 5,\n        \"offset\": 0,\n        \"sort\": {\n            \"email\": -1,\n            \"createdAt\": 1\n        },\n        \"totalCount\": 4,\n        \"timer\": 3.85,\n        \"timerAvg\": 5.62\n    },\n    \"data\": [\n        {\n            \"id\": \"5bad07cdc099dfbe49ef69d7\",\n            \"name\": \"John Doe\",\n            \"email\": \"john.doe@gmail.com\",\n            \"role\": \"user\",\n            \"createdAt\": \"2018-09-27T16:39:41.498Z\"\n        },\n        // more items...\n    ]\n}\n```\nExample of generated API Docs (using `apidoc`) - https://node-rem.netlify.com\n\n### 📖 Documentation\n\n- [Documentation / Features](src_docs/features.md)\n- [Build System](src_docs/build.md)\n- [Dependencies Notes](src_docs/dependencies.md)\n- [Change Log](CHANGELOG.md)\n\n### 🙌 Thanks\n\nAll contributions are welcome!\n\nUI Example uses [Portable-react](https://github.com/ngduc/portable-react)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fngduc%2Fnode-rem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fngduc%2Fnode-rem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fngduc%2Fnode-rem/lists"}