{"id":24194441,"url":"https://github.com/yarapolana/nodejs-auth-api-v2","last_synced_at":"2026-04-11T10:32:13.719Z","repository":{"id":44024382,"uuid":"228928548","full_name":"yarapolana/nodejs-auth-api-v2","owner":"yarapolana","description":"🗓 NodeJS Schedule Auth API","archived":false,"fork":false,"pushed_at":"2022-12-22T13:31:54.000Z","size":2261,"stargazers_count":1,"open_issues_count":17,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-13T18:42:25.399Z","etag":null,"topics":["bee-queue","express","jwt-authentication","mail","mongodb","multer","nodejs","postgresql","rocketseat-desafio-03","sentry","sequelize"],"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/yarapolana.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":"2019-12-18T22:00:09.000Z","updated_at":"2021-05-11T18:11:16.000Z","dependencies_parsed_at":"2023-01-30T10:15:17.306Z","dependency_job_id":null,"html_url":"https://github.com/yarapolana/nodejs-auth-api-v2","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/yarapolana%2Fnodejs-auth-api-v2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yarapolana%2Fnodejs-auth-api-v2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yarapolana%2Fnodejs-auth-api-v2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yarapolana%2Fnodejs-auth-api-v2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yarapolana","download_url":"https://codeload.github.com/yarapolana/nodejs-auth-api-v2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241623235,"owners_count":19992629,"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":["bee-queue","express","jwt-authentication","mail","mongodb","multer","nodejs","postgresql","rocketseat-desafio-03","sentry","sequelize"],"created_at":"2025-01-13T18:36:35.440Z","updated_at":"2025-11-28T14:06:17.078Z","avatar_url":"https://github.com/yarapolana.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg align=\"center\" src=\"https://miro.medium.com/max/4540/1*q9ww_u32hhpMaA-Q_s1ujw.png\" width=\"300\" /\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003e🗓NodeJS REST API Challenge V2\u003c/h1\u003e\n\u003cp\u003eThis is my third NodeJS server, part two of this \u003ca href=\"https://github.com/yarapolana/nodejs-auth-api\"\u003erepo\u003c/a\u003e and a code challenge from a class in Rocketseat's Bootcamp. The challenge involves creating a booking system REST API server from scratch using nodejs. \u003ca href=\"#description\" \u003eRead Description\u003c/a\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/github/package-json/dependency-version/yarapolana/nodejs-auth-api-v2/express.svg\" \u003e\n  \u003cimg src=\"https://img.shields.io/github/package-json/dependency-version/yarapolana/nodejs-auth-api-v2/bcryptjs.svg\" \u003e\n  \u003cimg src=\"https://img.shields.io/github/package-json/dependency-version/yarapolana/nodejs-auth-api-v2/jsonwebtoken.svg\" \u003e\n  \u003cimg src=\"https://img.shields.io/github/package-json/dependency-version/yarapolana/nodejs-auth-api-v2/pg.svg\" \u003e\n  \u003cimg src=\"https://img.shields.io/github/package-json/dependency-version/yarapolana/nodejs-auth-api-v2/sequelize.svg\" \u003e\n  \u003cimg src=\"https://img.shields.io/github/license/yarapolana/nodejs-auth-api.svg\" \u003e\n  \u003ca href=\"https://yarapolana.com\"\u003e\u003cimg src=\"https://img.shields.io/badge/createdby-yarapolana-red.svg\" \u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003ch2\u003e🚀Description \u003c/h2\u003e\n\u003cp id=\"description\"\u003e\n  Build an authentication service from scratch using \u003ca href=\"https://expressjs.com\"\u003e Express\u003c/a\u003e, \u003ca href=\"https://nodemon.io/\"\u003eNodemon\u003c/a\u003e, \u003ca href=\"https://sequelize.org\"\u003eSequelize\u003c/a\u003e, \u003ca href=\"https://jwt.io/\"\u003eJsonwebtoken\u003c/a\u003e, \u003ca href=\"https://github.com/jquense/yup\"\u003eYup\u003c/a\u003e and \u003ca href=\"https://www.postgresql.org\"\u003ePostgres\u003c/a\u003e. In this application I used linting standards with ESLint + Prettier + EditorConfig.\n\u003c/p\u003e\n\n### Routes\n\u003ci\u003eBookings\u003c/i\u003e\n- `GET /bookings`: This route displays an array of all bookings created by the authenticated user.\n\n- `GET /bookings/:id`: This route uses `id` as a parameter and displays a single booking.\n\n- `POST /bookings`: This route creates a new booking and receives `file_id`, `title`, `description`, `location` and `date` in the body. All fields are required. This request should return the user's id as the organizer's id.\n\n- `PUT /bookings/:id`: This route uses `id` as a parameter and this is where booking gets updated. Request receives any of these fields `file_id`, `title`, `description`, `location` and `date`, only the user who created the booking can edit it.\n\n- `DELETE /bookings/:id`: This route uses `id` as a parameter and deletes the booking, only the user who created the booking can delete it.\n\n\n\u003ci\u003eSubscriptions\u003c/i\u003e\n- `GET /subscriptions`: This route displays an array of all bookings that the authenticated user is subscribed to.\n\n- `POST /subscriptions`: This route creates a subscription to a meetup and must receive `name`, `email` and `password` in the body. You must validate the user where you state that all fields are required, `email` must be an email and password has a minimum of 8 characters.\n\n\u003ci\u003eOrganizer\u003c/i\u003e\n- `GET /organizer`: This is a test route you can send as response an `OK` message.\n\n\n\u003ci\u003eFiles\u003c/i\u003e\n- `POST /files`: This route creates a new file to be used in creating bookings and it must receive `file` in `multipart formdata`. The response should provide the name, url and the path to the file.\n\n### Rules\n\u003cp\u003e\n- On get bookings route, filter with a date query (not hour), it should display an array paginated by 10 items per page.\nThis query should come with the organizer's data.\n\nIn the below query example, it shows that on page 2 it should display meetups that happened on the 1st of July 2019.\n\n```http://localhost:3333/meetups?date=2019-07-01\u0026page=2```\n\n\nMake sure:\n- User can \u003cstrong\u003enot\u003c/strong\u003e create meetups with past dates.\n\n- User can only book meetups he does \u003cstrong\u003enot\u003c/strong\u003e organize.\n\n- User can \u003cstrong\u003enot\u003c/strong\u003e book past meetups.\n\n- User can \u003cstrong\u003enot\u003c/strong\u003e book the same meetup twice.\n\n- User can \u003cstrong\u003enot\u003c/strong\u003e book different meetups on the same time period.\n\n- User can only edit and cancel meetups that have not passed and that he organizes.\n\n- Send an email for every meetup booked, only applicable for users with organizer role.\n\n- Only display meetups that have not passed and order by closest as first on the list.\n\u003c/p\u003e\n\n### MVC\n\nDive deeper and explore the Model View Controler model.\n\n\n\u003ch2\u003eUsage\u003c/h2\u003e\n\u003cp\u003eTo run the application first install dependencies\u003c/p\u003e\n\n```\nyarn or npm install\n```\n\n\u003cp\u003eThis application uses Postgres so make sure to have that running too (with Docker recommended) then run the application\u003c/p\u003e\n\n```\nyarn dev\n```\n\n\u003cp\u003eYour code should be up and running here\u003c/p\u003e\n\n```http://localhost:3333```\n\n---\n\n\u003ch4\u003e Check out the fullstack version of this challenge \u003ca href=\"https://github.com/yarapolana/Meetapp\"\u003ehere\u003c/a\u003e.\u003c/h4\u003e\n\n---\n### License:\n\nThis project is made available under the [MIT LICENSE](LICENSE.md).\n\n### Authors:\n\n\u003cp\u003e\n  \u003ca href=\"https://github.com/yarapolana\"\u003e\n    \u003cimg src=\"https://avatars0.githubusercontent.com/u/19730118?s=460\u0026v=4\" width=\"50\" height=\"50\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://dotcode.is\"\u003e\n    \u003cimg src=\"https://dotcode.is/images/logo_dark.svg\" width=\"50\" height=\"50\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyarapolana%2Fnodejs-auth-api-v2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyarapolana%2Fnodejs-auth-api-v2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyarapolana%2Fnodejs-auth-api-v2/lists"}