{"id":22131744,"url":"https://github.com/javitocor/events-api-express","last_synced_at":"2026-04-12T05:36:02.971Z","repository":{"id":118467411,"uuid":"408092768","full_name":"javitocor/Events-API-Express","owner":"javitocor","description":"An API with authentication and permissions. Users can register/login and on role-based can perform different CRUD operations over users, events and tickets. Built with Express, Mongoose and JWT.","archived":false,"fork":false,"pushed_at":"2021-09-20T11:34:59.000Z","size":65,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-25T17:35:38.271Z","etag":null,"topics":["expressjs","jwt-authentication","mongoosejs","passport-jwt","passport-local","passportjs","permissions","role-based"],"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/javitocor.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":"2021-09-19T10:09:50.000Z","updated_at":"2021-09-30T12:12:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"b267471c-0015-4f1d-bf6b-370408d269e9","html_url":"https://github.com/javitocor/Events-API-Express","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/javitocor%2FEvents-API-Express","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javitocor%2FEvents-API-Express/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javitocor%2FEvents-API-Express/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javitocor%2FEvents-API-Express/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/javitocor","download_url":"https://codeload.github.com/javitocor/Events-API-Express/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245240913,"owners_count":20583123,"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":["expressjs","jwt-authentication","mongoosejs","passport-jwt","passport-local","passportjs","permissions","role-based"],"created_at":"2024-12-01T18:37:04.131Z","updated_at":"2025-12-30T23:27:52.740Z","avatar_url":"https://github.com/javitocor.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\n*** Thanks for checking out this README Template. If you have a suggestion that would\n*** make this better, please fork the repo and create a pull request or simply open\n*** an issue with the tag \"enhancement\".\n*** Thanks again! Now go create something AMAZING! :D\n--\u003e\n\n\u003c!-- PROJECT SHIELDS --\u003e\n\u003c!--\n*** I'm using markdown \"reference style\" links for readability.\n*** Reference links are enclosed in brackets [ ] instead of parentheses ( ).\n*** See the bottom of this document for the declaration of the reference variables\n*** for contributors-url, forks-url, etc. This is an optional, concise syntax you may use.\n*** https://www.markdownguide.org/basic-syntax/#reference-style-links\n--\u003e\n[![Contributors][contributors-shield]][contributors-url] \n[![Forks][forks-shield]][forks-url] \n[![Stargazers][stars-shield]][stars-url] \n[![Issues][issues-shield]][issues-url] \n![Hireable](https://cdn.rawgit.com/hiendv/hireable/master/styles/default/yes.svg) \n\n# Events-API-Express\n\n\u003e  An API with authentication and permissions. Users can register/login and on role based can perform different CRUD operations over users, events and tickets. Built with Express, Mongoose and JWT.\n\n\nAdditional description about the project and its features.\n\n## Built With\n\n- JAVASCRIPT\n- NPM\n- EXPRESS\n- MONGOOSE\n- PASSPORT\n- JWT\n- NODE\n- ESLINT\n- GITHUB ACTIONS\n- VSCODE\n\n### Usage\nTo have this app on your pc, you need to:\n* [download](https://github.com/javitocor/Events-API-Express/archive/main.zip) or clone this repo:\n  - Clone with SSH:\n  ```\n    git@github.com:javitocor/Events-API-Express.git\n  ```\n  - Clone with HTTPS\n  ```\n    https://github.com/javitocor/Events-API-Express.git\n  ```\n* Requirements:\n  - Nodejs and npm\n  ```\n    [Download Nodejs](https://nodejs.org/en/download/) and follow the instructions, npm is included in the package\n  ```\n* In the project directory, you can run:\n\n  - `$ npm install` - installs all the dependencies required by the project\n\n  - `$ npm run devstart` - runs the app in the development mode:\n    - The API will run in [http://localhost:3000](http://localhost:3000)\n    - You can use [Postman](https://www.postman.com/), [cURL](https://curl.se/) or any other tool of your choice to perform the API calls.\n\n### Documentation\n* Basic information\n  - This project is set up using Express js and Mongoose js, the authentication is based on Passport and JWT strategies. All the permissions to the different routes are set up in 'permissions.js' inside permissionsMiddleware folder.\n\n* Role based\n  The API is based on 4 different roles:\n  ```\n    Basic\n    ADMIN_BASIC\n    ADMIN_MANAGER\n    SUPERADMIN\n\n  ```\n\n* Endpoints\n  You can access the following endpoints depending on your user's role, by default a new user is assigned a 'Basic' role\n  ```\n    Register\n      post http://localhost:3000/signup (EVERYONE)\n    Login\n      post http://localhost:3000/login (Basic, ADMIN_BASIC, ADMIN_MANAGER, SUPERADMIN)\n    Logout\n      get http://localhost:3000/logout (Basic, ADMIN_BASIC, ADMIN_MANAGER, SUPERADMIN)\n    Get all users\n      get http://localhost:3000/users (ADMIN_BASIC, ADMIN_MANAGER, SUPERADMIN)\n    Get user detail\n      get http://localhost:3000/users/:id (ADMIN_MANAGER, SUPERADMIN)\n    Update user\n      put http://localhost:3000/users/:id (SUPERADMIN)\n    Delete user\n      delete http://localhost:3000/users/:id (SUPERADMIN)\n    Get all ongoing events\n      get http://localhost:3000/events/ (Basic, ADMIN_BASIC, ADMIN_MANAGER, SUPERADMIN)\n    Get all events\n      get http://localhost:3000/events/all (SUPERADMIN)\n    Get event detail\n      get http://localhost:3000/events/:id (Basic, ADMIN_BASIC, ADMIN_MANAGER, SUPERADMIN)\n    Create events\n      post http://localhost:3000/events/ (ADMIN_BASIC, ADMIN_MANAGER, SUPERADMIN)\n    Update events\n      put http://localhost:3000/events/:id (SUPERADMIN)\n    Delete events\n      delete http://localhost:3000/events/:id (SUPERADMIN)\n    Get tickets for an specific event\n      get http://localhost:3000/events/:id/tickets (ADMIN_BASIC, ADMIN_MANAGER, SUPERADMIN)\n    Create tickets for an specific event\n      post http://localhost:3000/events/:id/tickets (ADMIN_MANAGER, SUPERADMIN)\n    Update tickets for an specific event\n      put http://localhost:3000/events/:id/tickets/:id (ADMIN_BASIC, ADMIN_MANAGER, SUPERADMIN)\n    Delete tickets for a specific event\n      delete http://localhost:3000/events/:id/tickets/:id (SUPERADMIN)\n\n  ```\n* Bearer token authentication\n  - Once a user has signed up, can make a post request to the login endpoint, the response will be a bearer token that user will have to add to the headers in any other request    to the API to access the protected routes.\n* Seeding\n  You can seed the database with the following command:\n  ```\n    node ./seeder/seed.js\n  ```\n  In case the db is empty, with this command you will get the 4 basic roles with its user to start performing operations.\n  ```\n    users: 'Basic', 'ADMIN_BASIC', 'ADMIN_MANAGER', 'SUPERADMIN'\n    password: 'password' for all of them\n  ```\n\n* Database\n  - You can change the MongoDb database by changing the MONGODB_URI field in ./.env file.\n\n* Auth\n  - You can modify the different auth strategies by modifying the file 'auth.js' in the 'auth' folder.\n\n### Maintenance and Scalability\n\nThis project is no longer maintained, maybe in the future I might add some extra features or routes.\nFeel free to download it and adapt it to your own project, the project is easy to understand and it is a good starting point to develop larger backends.\nThe models, routes and authentication are scalable and easily maintenable.\n\n## Author\n\n👤 **Javier Oriol Correas Sanchez Cuesta**\n\n- Github: [@javitocor](https://github.com/javitocor) \n- Twitter: [@JavierCorreas4](https://twitter.com/JavierCorreas4) \n- Linkedin: [Javier Oriol Correas Sanchez Cuesta](https://www.linkedin.com/in/javier-correas-sanchez-cuesta-15289482/) \n\n## 🤝 Contributing\n\nContributions, issues and feature requests are welcome!\n\nFeel free to check the [issues page](https://github.com/javitocor/Events-API-Express/issues).\n\n## Show your support\n\nGive a ⭐️ if you like this project!\n\n## Acknowledgments 🚀\n\n- [Express Documentation](https://expressjs.com/)\n- [Passportjs](http://www.passportjs.org/)\n- [Jsonwebtoken](https://github.com/auth0/node-jsonwebtoken)\n- [Mongoosejs](https://mongoosejs.com/docs/guides.html)\n\n## 📝 License\n\nThis project is [MIT](lic.url) licensed.\n\n\u003c!-- MARKDOWN LINKS \u0026 IMAGES --\u003e\n\u003c!-- https://www.markdownguide.org/basic-syntax/#reference-style-links --\u003e\n[contributors-shield]: https://img.shields.io/github/contributors/javitocor/Events-API-Express.svg?style=flat-square\n[contributors-url]: https://github.com/javitocor/Events-API-Express/graphs/contributors\n[forks-shield]: https://img.shields.io/github/forks/javitocor/Events-API-Express.svg?style=flat-square\n[forks-url]: https://github.com/javitocor/Events-API-Express/network/members\n[stars-shield]: https://img.shields.io/github/stars/javitocor/Events-API-Express.svg?style=flat-square\n[stars-url]: https://github.com/javitocor/Events-API-Express/stargazers\n[issues-shield]: https://img.shields.io/github/issues/javitocor/Events-API-Express.svg?style=flat-square\n[issues-url]: https://github.com/javitocor/Events-API-Express/issues\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjavitocor%2Fevents-api-express","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjavitocor%2Fevents-api-express","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjavitocor%2Fevents-api-express/lists"}