{"id":18587461,"url":"https://github.com/ricardocanelas/node-express-mongodb-restful-example","last_synced_at":"2025-04-10T14:30:29.263Z","repository":{"id":44117929,"uuid":"156547564","full_name":"ricardocanelas/node-express-mongodb-restful-example","owner":"ricardocanelas","description":"Simple RESTful API implementation on Node.js + Express + MongoDB.","archived":false,"fork":false,"pushed_at":"2023-01-23T23:24:23.000Z","size":978,"stargazers_count":10,"open_issues_count":15,"forks_count":6,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-24T21:51:11.485Z","etag":null,"topics":["express","mongodb","mongoose","nodejs","restful"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/ricardocanelas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-07T13:05:53.000Z","updated_at":"2024-09-21T07:29:11.000Z","dependencies_parsed_at":"2023-01-30T06:30:46.796Z","dependency_job_id":null,"html_url":"https://github.com/ricardocanelas/node-express-mongodb-restful-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricardocanelas%2Fnode-express-mongodb-restful-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricardocanelas%2Fnode-express-mongodb-restful-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricardocanelas%2Fnode-express-mongodb-restful-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricardocanelas%2Fnode-express-mongodb-restful-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ricardocanelas","download_url":"https://codeload.github.com/ricardocanelas/node-express-mongodb-restful-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248233946,"owners_count":21069493,"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":["express","mongodb","mongoose","nodejs","restful"],"created_at":"2024-11-07T00:39:08.142Z","updated_at":"2025-04-10T14:30:28.878Z","avatar_url":"https://github.com/ricardocanelas.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 😃 Node.js - Express - MongoDB - RESTful\n\nSimple RESTful API implementation on Node.js + Express + MongoDB.\n\nDepedencies:\n\n- ✔️ Express *4.16*\n- ✔️ Mongoose *5.3*\n- ✔️ Passport *0.4*\n- ✔️ Babel *7.1*\n- ✔️ Mocha *5.2*\n- ✔️ Chai *4.2*\n- ✔️ Nyc *13.1*\n- ✔️ Husky *1.1.3*\n- ✔️ Eslint *5.8*\n- ✔️ Prettier *1.14*\n\n---\n\n## 👉🏻 Prerequisites\n\n### MongoDB\n\n- [Step by Step](https://docs.mongodb.com/manual/administration/install-community/)\n- [Download](https://www.mongodb.com/download-center/community)\n- [Guide](https://mongoosejs.com/docs/guide.html)\n- [Mongo Compass](https://www.mongodb.com/products/compass)\n- [Tutorial](https://developer.mozilla.org/en-US/docs/Learn/Server-side/Express_Nodejs/mongoose)\n\nDo not forget to add location of MongoDB's bin folder to PATH env variable.\n\n```bash\nmongod --version\n```\n\n### NodeJs\n\n- [Download](https://nodejs.org/en/)\n\n```bash\nnode --version\n```\n\n### Yarn\n\n```\nnpm install -g yarn\n```\n\n---\n\n## 👉🏻 Getting Started\n\nRun *mongod* in a separate shell to keep an instance of the MongoDB Daemon running\n\n```bash\nmongod\n```\n\nClone the repo and use `yarn` to install dependecies\n\n```bash\ngit clone https://github.com/ricardocanelas/node-express-mongodb-restful-example\ncd node-express-mongodb-restful-example\nyarn install\n```\n\nStart server\n\n```\nyarn start\n```\n\nThen visit `http://localhost:3001/api/posts` for example.\n\n**Test**\n\n```\n# Run tests\nyarn test\n\n# Run test along with code coverage\nyarn test:coverage\n```\n\n**Lint**\n\n```\n# Lint code with ESLint\nyarn lint\n\n# Run lint on any file change\nyarn lint:fix\n```\n\n**Deployment**\n\n```\nyarn build\nyarn serve\n```\n\n**Seed**\n\n```\nyarn seed\n```\n\n* email: admin@mail.com\n* password: secret\n\n---\n\n## 👉🏻 API Endpoint\n\nPOSTS\n\n* `GET api/posts` - Get all of the posts\n* `GET api/posts/count` - Get the quantity of the posts\n* `GET api/posts/:id` - Get the details of a single post\n* `POST api/posts/` - Add a new post.\n* `PUT api/posts/:id` - Edit the details of an existing post\n* `DELETE api/posts/:id` - Delete a single post\n\nUSERS\n\n* `POST api/signin` - Sign In\n* `POST api/signup` - Sign Up\n* `GET api/users` - Get All of the users **(required auth)**\n* `GET api/users/count` - Get the quantity of the users\n* `GET api/users/:id` -  Get the details of an user\n* `PUT api/users/:id` - Edit the details of an existing user\n* `DELETE api/users/:id` - Delete an user\n\n---\n\n### 👏 My Inspirations\n\n\nDemos\n\n- https://florianholzapfel.github.io/express-restify-mongoose/#express-4-app\n- https://github.com/DavideViolante/Angular-Full-Stack\n- https://github.com/kunalkapadia/express-mongoose-es6-rest-api\n- https://github.com/madhums/node-express-mongoose-demo\n- https://github.com/diegohaz/rest-api\n\nDocumentations\n\n- https://bocoup.com/blog/documenting-your-api\n- https://github.com/udacity/reactnd-project-readable-starter\n- https://gist.github.com/rxaviers/7360908\n\nTests\n\n- https://dev.to/bnorbertjs/my-nodejs-setup-mocha--chai-babel7-es6-43ei\n- https://dev.to/asciidev/testing-a-nodeexpress-application-with-mocha--chai-4lho\n- https://medium.com/@hdeodato/teste-automático-de-api-rest-usando-com-node-js-mocha-chai-6aec4613d100\n- https://imasters.com.br/back-end/desenvolvendo-tdd-em-node-js-com-mocha-chai\n\nValidations\n\n- https://github.com/leepowellcouk/mongoose-validator\n- https://github.com/chriso/validator.js\n\n\nAuthentication\n\n- https://medium.freecodecamp.org/learn-how-to-handle-authentication-with-node-using-passport-js-4a56ed18e81e\n- https://github.com/AntonioErdeljac/passport-tutorial","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fricardocanelas%2Fnode-express-mongodb-restful-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fricardocanelas%2Fnode-express-mongodb-restful-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fricardocanelas%2Fnode-express-mongodb-restful-example/lists"}