{"id":17028539,"url":"https://github.com/mcalthrop/auth-mongo-express-node","last_synced_at":"2026-02-14T07:01:45.056Z","repository":{"id":150164744,"uuid":"88369164","full_name":"mcalthrop/auth-mongo-express-node","owner":"mcalthrop","description":"Express server with MongoDB and authentication and authorisation","archived":false,"fork":false,"pushed_at":"2023-02-01T00:28:53.000Z","size":159,"stargazers_count":2,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-04T17:55:55.619Z","etag":null,"topics":["apidoc","authorisation","es6","eslint","jasmine","json-api","learning","learning-materials","mongo","mongodb","mongoose","passport-js","supertest","yarn"],"latest_commit_sha":null,"homepage":"","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/mcalthrop.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-15T19:18:33.000Z","updated_at":"2018-05-09T22:18:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"7d3cea52-25e7-435d-9387-68e121247b1a","html_url":"https://github.com/mcalthrop/auth-mongo-express-node","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mcalthrop/auth-mongo-express-node","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcalthrop%2Fauth-mongo-express-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcalthrop%2Fauth-mongo-express-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcalthrop%2Fauth-mongo-express-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcalthrop%2Fauth-mongo-express-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mcalthrop","download_url":"https://codeload.github.com/mcalthrop/auth-mongo-express-node/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcalthrop%2Fauth-mongo-express-node/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29438977,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T05:24:35.651Z","status":"ssl_error","status_checked_at":"2026-02-14T05:24:34.830Z","response_time":53,"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":["apidoc","authorisation","es6","eslint","jasmine","json-api","learning","learning-materials","mongo","mongodb","mongoose","passport-js","supertest","yarn"],"created_at":"2024-10-14T07:54:54.596Z","updated_at":"2026-02-14T07:01:45.039Z","avatar_url":"https://github.com/mcalthrop.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/mcalthrop/auth-mongo-express-node.svg?branch=master)](https://travis-ci.org/mcalthrop/auth-mongo-express-node)\n\n# mongo-express-node-auth\n\n_Express server with MongoDB and authentication and authorisation_\n\n## Overview\n\nThis is a codebase that can be used as a starting point for an API that provides endpoints for authentication.\n\n### Routes\n\n- `/api/signup` – create a new user account\n- `/api/login` – log in to an existing account\n- `/api/logout` – log out\n\nAdditionally, two routes are provided that require authorisation:\n\n- `/api/me` – allow logged-in user (with any role) to read and update their details\n- `/api/users` – allow a user with the `admin` role to see a list of all users (further routes can be added to implement full CRUD functionality)\n\nSee [API docs](#api-docs) for full details.\n\n### Features\n\nThe following features and technologies are used:\n\n- [Yarn](https://yarnpkg.com/en/)\n- [ES2015/ES6](https://babeljs.io/learn-es2015/)\n- [Eslint](http://eslint.org/)\n- MVC implementation using [Node](https://nodejs.org/en/), [Express](http://expressjs.com/), [Mongo](https://www.mongodb.com/) and [Mongoose](http://mongoosejs.com/)\n- [Travis](https://travis-ci.org/mcalthrop/auth-mongo-express-node) for CI testing\n- JSON data returned in [JSON API](http://jsonapi.org/) format\n- [PassportJS](http://passportjs.org/) for authentication and [Permission](https://www.npmjs.com/package/permission) for authorisation\n- [APIDOC](http://apidocjs.com/) for documenting the API endpoints\n- [Jasmine](https://jasmine.github.io/) and [Supertest](https://www.npmjs.com/package/supertest) for testing the API endpoints\n\n## Setup\n\n### Install yarn\n\nFollow the instructions here:\n\n[yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install)\n\n### Install NodeJS packages\n\nInstall the NodeJS packages:\n\n``` sh\n$ yarn\n```\n\n### Install Mongo\n\nFollow the instructions here:\n\n[www.mongodb.com/download-center#community](https://www.mongodb.com/download-center#community)\n\n## Running the API\n\n\u003e API code is in the `api` directory.\n\n### During development\n\nIn a terminal tab, start the MongoDB daemon:\n\n``` sh\n$ mongod\n```\n\nIn another terminal tab, you can use `nodemon`:\n\n``` sh\n$ yarn nodemon\n```\n\nTo check if the API is running, browse to:\n\n[localhost:4001/api](http://localhost:4001/api)\n\n### Once deployed\n\nEnsure that the following environment variables are set in the deployed environment:\n\n- `MONGODB_URI` \u0026ndash; points to a valid MongoDB instance\n- `APP_SECRET` \u0026ndash; a randomly-generated secret (see [passwordsgenerator.net/](https://passwordsgenerator.net/))\n\nTo start the API:\n\n``` sh\n$ yarn start\n```\n\n## Tests\n\n### All\n\nTo run all tests:\n\n``` sh\n$ yarn test\n```\n\n### Linting\n\n\u003e Check the `.eslint` file for the Eslint rules.\n\nThe Javascript code can be linted as follows:\n\n``` sh\n$ yarn lint\n```\n\nAnd to auto-correct any errors that can be corrected:\n\n``` sh\n$ yarn lint:fix\n```\n\n### API\n\n\u003e API tests are in the `spec` directory.\n\nTo run the API tests:\n\n``` sh\n$ yarn jasmine\n```\n\n## API docs\n\nTo generate the documentation for the API endpoints:\n\n``` sh\n$ yarn apidoc\n```\n\nAnd to view the output, open the `apidocs/index.html` file in your browser.\n\n## Seeding the database\n\n\u003e Database-related code is in the `db` directory.\n\nTo seed the Mongo database with sample data:\n\n``` sh\n$ yarn db:seed\n```\n\nWhen developing locally, running the following command will seed the local database:\n\n``` sh\n$ yarn db:seed:local\n```\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcalthrop%2Fauth-mongo-express-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmcalthrop%2Fauth-mongo-express-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcalthrop%2Fauth-mongo-express-node/lists"}