{"id":19562509,"url":"https://github.com/alejandrobabio/cinema_booking_api","last_synced_at":"2026-04-15T16:32:31.593Z","repository":{"id":39694066,"uuid":"217559232","full_name":"alejandrobabio/cinema_booking_api","owner":"alejandrobabio","description":null,"archived":false,"fork":false,"pushed_at":"2023-03-17T02:32:39.000Z","size":47,"stargazers_count":1,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-26T08:46:34.162Z","etag":null,"topics":["dry-rb","grape-api","sequel"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/alejandrobabio.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":null,"support":null}},"created_at":"2019-10-25T15:07:58.000Z","updated_at":"2022-09-11T11:16:57.000Z","dependencies_parsed_at":"2023-02-16T13:16:15.073Z","dependency_job_id":null,"html_url":"https://github.com/alejandrobabio/cinema_booking_api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alejandrobabio/cinema_booking_api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alejandrobabio%2Fcinema_booking_api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alejandrobabio%2Fcinema_booking_api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alejandrobabio%2Fcinema_booking_api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alejandrobabio%2Fcinema_booking_api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alejandrobabio","download_url":"https://codeload.github.com/alejandrobabio/cinema_booking_api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alejandrobabio%2Fcinema_booking_api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31849748,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"ssl_error","status_checked_at":"2026-04-15T15:24:39.138Z","response_time":63,"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":["dry-rb","grape-api","sequel"],"created_at":"2024-11-11T05:14:50.500Z","updated_at":"2026-04-15T16:32:31.578Z","avatar_url":"https://github.com/alejandrobabio.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cinema Booking API\n\nTry this API working in `https://cinema-booking-api.herokuapp.com`.\n\n## Deployment\n\n### Production deployment to Heroku\n\n[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)\n\n### Development and Test Setup\n\nClone de repository, run `bundle install` and copy `config/database.yml.example` to `config/database.yml`.\n\nCreate test and development databases, `user` should be consistent with your `config/database.yml`\n\n```sh\n$ createuser -U postgres cinema_booking\n$ createdb -U postgres -O cinema_booking cinema_booking_test\n$ createdb -U postgres -O cinema_booking cinema_booking_development\n```\n\nRun migrations\n\n```sh\n$ bundle exec dev_up\n$ bundle exec test_up\n```\n\nRun tests\n\n```sh\n$ bundle exec rspec\n```\n\nStart the development server with `rerun` to get a server restart on any change of the source code:\n\n```sh\n$ rerun -- puma --port 3000 config.ru\n```\n\nOr, run bare server with:\n\n```sh\n$ puma --port 3000 config.ru\n```\n\nThen in development use the url: `http://localhost:3000` for all the endpoints.\n\n## Endpoints\n\nAll the endpoints expect `json` format, that should be set in headers via: `Content-Type: application/json`. Response is sent in `json` format too.\n\n### POST /movies\n\nCreate a new movie.\n\n*Fields:*\n- `name`: required, string\n- `description`: optional, string\n- `image_url`: optional, string, valid url for image\n- `days`: required, array of strings, valid values: \"Sun, Mon, Tue, Wed, Thu, Fri, Sat\", defined by ruby `Date::ABBR_DAYNAMES`\n\n*Example:*\n```sh\ncurl -d '{\"name\":\"Die Hard 3\",\"days\":[\"Mon\",\"Sat\"]}' \\\n  -H \"Content-Type: application/json\" \\\n  -X POST https://cinema-booking-api.herokuapp.com/movies\n```\n\nThe API respond with status `201`, or `JSON` error message.\n\n### GET /movies\n\nList all movies for a given day. It requires one filter param: `day`, which is one of the values defined by `Date::ABBR_DAYNAMES`\n\n*Example:*\n```sh\ncurl -X GET 'https://cinema-booking-api.herokuapp.com/movies?day=Mon' \\\n  -H 'Content-Type: application/json'\n```\n\nThe API respond with movies for that day, or error message if filter param is not correct.\n\n*Response for the example:*\n```json\n[\n  {\n    \"id\": 1,\n    \"name\": \"Die Hard 3\",\n    \"description\": null,\n    \"days\": [\n      \"Mon\",\n      \"Sat\"\n    ],\n    \"image_url\": null,\n  }\n]\n```\n\n### POST /bookings\n\nCreate a booking for a movie in a given date.\n\n*Fields:*\n- `booking_date`: required, string, format YYYY-MM-DD, should be in the future\n- `movie_id`: required, integer, the movie should exists with this id\n- `customer_name`: required, string\n\n*Example:*\n```sh\ncurl -d '{\"booking_date\":\"2019-11-02\",\"movie_id\":1,\"customer_name\":\"John Doe\"}' \\\n -H \"Content-Type: application/json\" \\\n -X POST https://cinema-booking-api.herokuapp.com/bookings\n```\n\nThe API respond with status `201`, or `JSON` error message.\n\n### GET /bookings\n\nList bookings between dates. It requires two filter params: `from` \u0026 `to`, that should be in format `YYYY-MM-DD`.\n\n*Example:*\n```sh\ncurl -H 'Content-Type: application/json' \\\n  -X GET 'https://cinema-booking-api.herokuapp.com/bookings?from=2019-11-01\u0026to=2019-11-10'\n```\n\nThe API responds with bookings between dates or error message if filter params are not correct.\n\n*Response for the example:*\n```json\n[\n  {\n    \"id\": 1,\n    \"booking_date\": \"2019-11-02\",\n    \"customer_name\": \"John Doe\",\n    \"movie\": {\n      \"id\": 1,\n      \"name\": \"Die Hard 3\",\n      \"description\": null,\n      \"days\": [\n        \"Mon\",\n        \"Sat\"\n      ],\n      \"image_url\": null,\n    }\n  }\n]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falejandrobabio%2Fcinema_booking_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falejandrobabio%2Fcinema_booking_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falejandrobabio%2Fcinema_booking_api/lists"}