{"id":18244143,"url":"https://github.com/tomijuarez/volcano","last_synced_at":"2026-05-04T07:39:18.974Z","repository":{"id":152504808,"uuid":"165575291","full_name":"tomijuarez/Volcano","owner":"tomijuarez","description":"Campsite booking system","archived":false,"fork":false,"pushed_at":"2019-01-14T03:11:03.000Z","size":37,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-08T18:37:36.733Z","etag":null,"topics":["hibernate","java","rest-api","spring-boot"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tomijuarez.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-14T01:25:20.000Z","updated_at":"2019-01-14T03:11:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"78b9a5b7-a7c2-4a7b-baad-1fd74a670dd1","html_url":"https://github.com/tomijuarez/Volcano","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tomijuarez/Volcano","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomijuarez%2FVolcano","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomijuarez%2FVolcano/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomijuarez%2FVolcano/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomijuarez%2FVolcano/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomijuarez","download_url":"https://codeload.github.com/tomijuarez/Volcano/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomijuarez%2FVolcano/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32599408,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T22:12:39.696Z","status":"online","status_checked_at":"2026-05-04T02:00:06.625Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["hibernate","java","rest-api","spring-boot"],"created_at":"2024-11-05T09:15:36.110Z","updated_at":"2026-05-04T07:39:18.938Z","avatar_url":"https://github.com/tomijuarez.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Volcano\nSimple API for campsite booking.\n## Documentation\n\n### Setup\n\n#### Requirements\n - Docker [https://docs.docker.com/install/]\n - Docker Compose [https://docs.docker.com/compose/install/]\n\n#### Run the application\n\nIn order tu run the application you'll need to generate a jar file containing the application so you can deploy it and start using the endpoints. The jar generation can be achieved by running `mvn clean package` and it will generate the jar file into `./target` folder. Once we have that done, we can build a docker image and expose the API inside the container. For that process a `Dockerfile` and a `docker-compose` file were created. All you need to do is to run `docker-compose build` and `docker-compose run`.\n\nNote that the Dockerfile does not create the jar file, since that is not a good practice. It's recommended to generate the jar file (or any kind of bundle in any programming language) by using a Continous Integration tool. For simplicity reasons I've created the jar and I kept the `./target` folder in this repo even if that is not a good practice (is highly recommended to ignore that kind of files and folders), so you don't need to install Maven locally. So, as a recap, you need to run the following commands to keep the application up and running:\n\n - `docker-compose build`\n - `docker-compose up`\n\nIf you want to delete the `./target` folder, you need to run `mvn clean package` first and then run the previous commands.\n\nThis application uses JPA + H2 (in-memory database because its simplicity), spring-boot and mockito. 12 unit tests are available in this project.\n\nBy default, I've setted the configuration to map the docker port to your local port `8080`. You can reach the API at `http://localhost:8080/booking`. Note that the root '/' doesn't do anything, since I wanted to give to the booking resource an specific URI, starting at `/booking` for semantic reasons. You can apply several methods to this resource, which are listed below.\n\n**NOTE**: all responses have the same format: `{ error: ..., payload: ... }`. If the system returns an error status code, then `error` will have some error message and `payload` will be `null`. If the system process the request succesfully, `payload` *may* have some content, and error will be `null`.\n\n### Get\n\nTwo options are available when applying the GET method:\n\n - `booking/` returns all registered bookings from a range of dates. Those dates `from` (beginning) and `to` (end) should be passed as parameters to the endpoint. If a date is not present, the API will assume you want the bookings from the next day and one month ahead.\n - `booking/{id}` returns the data for an specific booking. Id is the `uuid` that was returned when a booking is created via a `POST` method. It returns a list of bookings if you select a booking with more than 1 day.\n\n#### Examples:\n - **Request #1:** *http://localhost:8080/booking/?from=2019-01-16\u0026to=2019-01-17*\n - **Response #1:**\n     ```\n     {\n        \"error\": null,\n        \"payload\": [\n            {\n                \"uuid\": \"f0693b89-2e4e-4aba-abfe-117fa254817e\",\n                \"from\": \"2019-01-17\",\n                \"to\": \"2019-01-17\"\n            },\n            {\n                \"uuid\": \"f0693b89-2e4e-4aba-abfe-117fa254817e\",\n                \"from\": \"2019-01-18\",\n                \"to\": \"2019-01-18\"\n            },\n            {\n                \"uuid\": \"f0693b89-2e4e-4aba-abfe-117fa254817e\",\n                \"from\": \"2019-01-19\",\n                \"to\": \"2019-01-19\"\n            }\n        ]\n    }\n     ```\n - **Request #2:** *http://localhost:8080/booking/f0693b89-2e4e-4aba-abfe-117fa254817e*\n - **Response #2:**\n     ```\n     {\n    \"error\": null,\n    \"payload\": [\n        {\n            \"uuid\": \"f0693b89-2e4e-4aba-abfe-117fa254817e\",\n            \"from\": \"2019-01-17\",\n            \"to\": \"2019-01-17\"\n        },\n        {\n            \"uuid\": \"f0693b89-2e4e-4aba-abfe-117fa254817e\",\n            \"from\": \"2019-01-18\",\n            \"to\": \"2019-01-18\"\n        },\n        {\n            \"uuid\": \"f0693b89-2e4e-4aba-abfe-117fa254817e\",\n            \"from\": \"2019-01-19\",\n            \"to\": \"2019-01-19\"\n        }\n    ]\n}\n     ```\n \n\n### Post\n\nThis method expect a body with a JSON media-type which should contains 5 keys: `email`, `name`, `lastName`, `date` (beginning) and `dateTo` (end). Is important to know that both `date` and `dateTo` should have the format `YYYY-MM-DD`. If the creation of the resource is succesful you will get an object containing the booking UUID. Dates are inclusive, this means that 2019-01-17 and 2019-02-19 will be taken as a 3-days booking.\n\n#### Examples:\n\n - **Request:** *http://localhost:8080/booking*.\n     ```\n    {\n        \"email\": \"tomasjuarez@gmail.com\",\n        \"name\": \"Tomas\",\n        \"lastName\": \"Juarez\",\n        \"date\": \"2019-01-17T21:23:41.114\",\n        \"dateTo\": \"2019-01-19T21:23:41.114\"\n    }\n     ```\n - **Response:**\n    ```\n    {\n        \"error\": null,\n        \"payload\": {\n            \"uuid\": \"6487b38d-f9aa-45d4-9578-5e1589c5f6f9\",\n            \"from\": \"2019-01-17\",\n            \"to\": \"2019-01-19\"\n        }\n    }\n    ```\n\n### Patch\nThis method expects a path parameter like `/booking/{id}` which should contain a valid booking UUID returned by `POST`. Also, you need to attach a simple json in the body containing two keys: `date` (beginning) and `dateTo` (end) with the format `YYYY-MM-DD`. The dates are inclusive numbers: this means that 2019-01-17 and 2019-02-19 will be taken as a 3-days booking.\n\nNote that if your booking was created with 3-days length, then if you update the dates, you should send 3 consecutive days. The same if you created a 2-days booking.\n\n#### Examples:\n - **Request:** *http://localhost:8080/booking/6487b38d-f9aa-45d4-9578-5e1589c5f6f9*\n     ```\n     {\n    \t\"date\": \"2019-01-14\",\n    \t\"dateTo\": \"2019-01-16\"\n    }\n     ```\n - **Response:** *blank response with 204 (no-content) status.*\n\n### Delete\n\nThis method expects a path parameter containing a valid UUID for a previous created booking in the form of `booking/{id}`.\n\n#### Examples:\n - **Request:** *http://localhost:8080/booking/6487b38d-f9aa-45d4-9578-5e1589c5f6f9*\n - **Response:** *blank response with 204 (no-content) status.*","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomijuarez%2Fvolcano","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomijuarez%2Fvolcano","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomijuarez%2Fvolcano/lists"}