{"id":16978879,"url":"https://github.com/braineanear/vidlyapi","last_synced_at":"2025-03-15T14:30:42.863Z","repository":{"id":37818685,"uuid":"323557899","full_name":"Braineanear/VidlyAPI","owner":"Braineanear","description":"This project is the backend of Vidly, an imaginary video rental app. ","archived":false,"fork":false,"pushed_at":"2024-05-26T20:35:11.000Z","size":1322,"stargazers_count":4,"open_issues_count":53,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-05-28T17:00:23.781Z","etag":null,"topics":["api","expressjs","javascript","jwt","mongodb","mongoose","nodejs","npm","rest-api"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/Braineanear.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":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-22T07:49:10.000Z","updated_at":"2023-05-24T10:59:05.000Z","dependencies_parsed_at":"2024-09-12T13:06:40.305Z","dependency_job_id":null,"html_url":"https://github.com/Braineanear/VidlyAPI","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/Braineanear%2FVidlyAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Braineanear%2FVidlyAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Braineanear%2FVidlyAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Braineanear%2FVidlyAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Braineanear","download_url":"https://codeload.github.com/Braineanear/VidlyAPI/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243742614,"owners_count":20340673,"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":["api","expressjs","javascript","jwt","mongodb","mongoose","nodejs","npm","rest-api"],"created_at":"2024-10-14T01:44:23.092Z","updated_at":"2025-03-15T14:30:42.314Z","avatar_url":"https://github.com/Braineanear.png","language":"JavaScript","readme":"\u003ch1 align=\"center\"\u003e\n  \u003cbr\u003e\n  Vidly Backend API Specifications\n  \u003cbr\u003e\n\u003c/h1\u003e\n\n\u003ch4 align=\"center\"\u003eBackend API for a movie rental service built on top of \u003ca href=\"https://nodejs.org/en/\" target=\"_blank\"\u003eNodeJS\u003c/a\u003e.\u003c/h4\u003e\n\n \u003cp align=\"center\"\u003e\n \u003ca href=\"#deployed-version\"\u003eDemo\u003c/a\u003e •\n  \u003ca href=\"#api-usage\"\u003eAPI Usage\u003c/a\u003e •\n  \u003ca href=\"#deployment\"\u003eDeployment\u003c/a\u003e •\n  \u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e •\n  \u003ca href=\"#build-with\"\u003eBuild With\u003c/a\u003e •\n  \u003ca href=\"#npm-packages\"\u003eNPM Packages\u003c/a\u003e •\n  \u003ca href=\"#demonstration\"\u003eDemonstration\u003c/a\u003e •\n  \u003ca href=\"#future-updates\"\u003eFuture Updates\u003c/a\u003e • \n  \u003ca href=\"#known-bugs\"\u003eKnown Bugs\u003c/a\u003e • \n\u003c/p\u003e\n\n## Deployed Version\nLive demo (Feel free to visit) 👉 : https://vidly-rental-api.herokuapp.com\n\n## API Usage\n\nCheck [Vidly API Documentation](https://documenter.getpostman.com/view/11050349/TVzRGxzR) for more info.\n\n## Deployment\nThe website is deployed with git into heroku. Below are the steps taken:\n```\ngit init\ngit add -A\ngit commit -m \"Commit message\"\nheroku login\nheroku create\nheroku config:set CONFIG_KEY=CONFIG_VALUE\ngit push heroku master\nheroku open\n```\n\n## Installation\nYou can fork the app or you can git-clone the app into your local machine. Once done that, please install all the dependencies by running\n```\n$ npm i\n$ npm start\n```\n## Build With\n\n* [Node.js](https://nodejs.org/en) - JS runtime environment\n* [VSCode](https://code.visualstudio.com) - Free source-code editor made by Microsoft\n* [Express](http://expressjs.com/) - The web framework used\n* [Mongoose](https://mongoosejs.com/) - Object Data Modelling (ODM) library\n* [MongoDB Atlas](https://www.mongodb.com/cloud/atlas) - Cloud database service\n* [Postman](https://www.getpostman.com/) - API testing\n* [Git](https://git-scm.com) - Open source distributed version control system\n* [MailTrap](https://mailtrap.io) - Email delivery platform\n* [Cloudinary](https://cloudinary.com/) - an end-to-end image and video management solution\n* [Heroku](https://www.heroku.com/) - Cloud platform\n\n\n## NPM Packages\n\n- [dotenv](https://github.com/motdotla/dotenv#readme)\n- [morgan](https://github.com/expressjs/morgan)\n- [multer](https://github.com/expressjs/multer)\n- [eslint](https://github.com/eslint/eslint)\n- [eslint-config-airbnb](https://github.com/airbnb/javascript)\n- [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier)\n- [eslint-plugin-import](https://github.com/prettier/eslint-config-prettier)\n- [eslint-plugin-jsx-a11y](https://github.com/evcohen/eslint-plugin-jsx-a11y)\n- [eslint-plugin-node](https://github.com/mysticatea/eslint-plugin-node)\n- [eslint-plugin-prettier](https://github.com/mysticatea/eslint-plugin-node)\n- [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react)\n- [ndb](https://github.com/GoogleChromeLabs/ndb)\n- [prettier](https://github.com/prettier/prettier)\n- [nodemon](https://github.com/remy/nodemon)\n- [chalk](https://github.com/chalk/chalk)\n- [slugify](https://github.com/simov/slugify)\n- [jsonwebtoken](https://github.com/auth0/node-jsonwebtoken)\n- [nodemailer](https://nodemailer.com/about)\n- [express-mongo-sanitize](https://github.com/fiznool/express-mongo-sanitize#readme)\n- [xss-clean](https://github.com/jsonmaur/xss-clean)\n- [helmet](https://github.com/helmetjs/helmet)\n- [hpp](https://github.com/analog-nico/hpp)\n- [express-rate-limit](https://github.com/nfriedly/express-rate-limit)\n- [cors](https://github.com/expressjs/cors)\n- [validator](https://www.npmjs.com/package/validator)\n- [compression](https://www.npmjs.com/package/compression)\n- [argon2](https://www.npmjs.com/package/argon2)\n- [cloudinary](https://www.npmjs.com/package/cloudinary)\n- [cookie-parser](https://www.npmjs.com/package/cookie-parser)\n- [moment](https://www.npmjs.com/package/moment)\n- [sharp](https://www.npmjs.com/package/sharp)\n- [streamifier](https://www.npmjs.com/package/streamifier)\n- [winston](https://www.npmjs.com/package/winston)\n\n## Demonstration\n### 1) Genres\n- Get All Genres\n  * This route will return all the genres in the database.\n  * Anyone can access this route.\n- Get Movie\n  * This route will return a specific genre's data by providing it's ID.\n  * Anyone can access this route.\n- Create New Movie\n  * This route will allow the user to create new genre by providing name.\n  * Only Logged in user can access this route.\n- Update Movie\n  * This route will allow the user to update a specific genre by providing it's ID.\n  * Only Logged in user can access this route.\n- Delete Move\n  * This route will allow the user to delete a specific genre by providing it's ID.\n  * Only Logged in user can access this route.\n  \n### 2) Customers\n- Get All Customers\n  * This route will return all the customers in the database.\n  * Anyone can access this route.\n- Get Movie\n  * This route will return a specific customers's data by providing it's ID.\n  * Anyone can access this route.\n- Create New Movie\n  * This route will allow the user to create new customer by providing name, phone and isGold(BOOLEAN true/false) Fields.\n  * Only Logged in user can access this route.\n- Update Movie\n  * This route will allow the user to update a specific customer by providing it's ID.\n  * Only Logged in user can access this route.\n- Delete Move\n  * This route will allow the user to delete a specific customer by providing it's ID.\n  * Only Logged in user can access this route.\n\n### 3) Movies\n- Get All Movies\n  * This route will return all the movies in the database.\n  * Anyone can access this route.\n- Get Movie\n  * This route will return a specific movie's data by providing it's ID.\n  * Anyone can access this route.\n- Create New Movie\n  * This route will allow the user to create new movie by providing it's title, genere ID, year, dailyRentalRate and numberInStock fields (optional fields: directors list / writers list / cast list).\n  * Only Logged in user can access this route.\n- Update Movie\n  * This route will allow the user to update a specific movie by providing it's ID.\n  * Only Logged in user can access this route.\n- Delete Move\n  * This route will allow the user to delete a specific movie by providing it's ID.\n  * Only Logged in user can access this route.\n  \n### 4) Rental\n- Get All Rentals\n  * This route will return all the rentals in the database.\n  * Anyone can access this route.\n- Get Rental\n  * This route will return a specific rental's data by providing the it's ID.\n  * Anyone can access this route.\n- Create New Rental\n  * This route will allow the user to create new rental by providing the Movie's ID and the Customer's ID.\n  * Only Logged in user can access this route.\n- Update Rental\n  * This route will allow the user to update a specific rental by providing it's ID.\n  * Only Logged in user can access this route.\n- Delete Rental\n  * This route will allow the user to delete a specific rental by providing it's ID.\n  * Only Logged in user can access this route.\n- Return Rental \n  * Returning a Rental and create a new document in the return collection in the database and update the rental document.\n  * Only Logged in user can access this route.\n \n### 5) Users \u0026 Authentication\n- User Login\n  * User can login by sending his correct email and password.\n  * Plain text password will compare with stored hashed password.\n  * JWT and cookie should expire in 30 days.\n  * Anyone can access SignIn route.\n  * Once logged in, a token will be sent along with a cookie (token = xxx).\n- User registration\n  * Register as a \"user\" or \"admin\"\n  * The user should enter the main data which is (name/email/role/password/passwordConfirm).\n  * Once registered, a token will be sent along with a cookie (token = xxx)\n  * Password is going to be hashed and saved into the database.\n  * A message sent to the user's own email with the activation token of his email.\n- User logout\n  * Cookie will be sent to set token = none.\n  * Only Logged in user can access this route.\n- Fogot Password\n  * When the user forget his password he can enter this route.\n  * User should send his email.\n  * The route will send an message to the user's email contains the reset password link (token).\n  * Anyone can access this route.\n- Reset Password\n  * User can request to reset password.\n  * A hashed token will be emailed to the users registered email address.\n  * A put request can be made to the generated url to reset password.\n  * The token will expire after 10 minutes.\n  * Only Valid Tokens will allow the user to reset his password.\n- Get current user data\n  * Route to get the currently logged in user (via token).\n  * Only Logged in user can access this route.\n- Update Current User Data\n  * This route allow the user to update his email and name only.\n  * Only Logged in user can access this route.\n- Delete Current User Data\n  * This route allow the user to remove himself from the database, so he cannot login again.\n  * Only Logged in user can access this route.\n- Update user info\n  * Separate route to update password.\n  * Only Logged in user can access this route.\n- Upload Current User Photo.\n  * This route allow the user to upload his own avatar to the cloud and the database.\n  * Only Logged in user can access this route.\n- Delete Current User Photo.\n  * This route allow the user to delete his own avatar from the cloud and the database.\n  * Only Logged in user can access this route.\n- Get User Avatar\n  * This route will allow you to get user's avatar by providing user's ID.\n- Confirm Email.\n  * This route allow the user to active and confirm his Email.\n  * Only user who have the confirmation token can active his email.\n- User CRUD\n  * Admin only can access these routes.\n\n## Future Updates\n\n* Create Front-End design for the api\n* Improve authentication and authorization\n* And More ! There's always room for improvement!\n\n## Known Bugs\nFeel free to email me at mle.mahmoud.yasser@gmail.com if you run into any issues or have questions, ideas or concerns.\nPlease enjoy and feel free to share your opinion, constructive criticism, or comments about my work. Thank you! 🙂\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbraineanear%2Fvidlyapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbraineanear%2Fvidlyapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbraineanear%2Fvidlyapi/lists"}