https://github.com/leninpaulino/hotels-api
Hotels API built using Laravel applying TDD practices.
https://github.com/leninpaulino/hotels-api
hotels-api laravel rest-api tdd testing
Last synced: 5 months ago
JSON representation
Hotels API built using Laravel applying TDD practices.
- Host: GitHub
- URL: https://github.com/leninpaulino/hotels-api
- Owner: leninpaulino
- Created: 2020-03-05T12:10:55.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-04-12T15:10:23.000Z (about 6 years ago)
- Last Synced: 2025-03-09T05:38:50.995Z (over 1 year ago)
- Topics: hotels-api, laravel, rest-api, tdd, testing
- Language: PHP
- Homepage:
- Size: 170 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Hotels API
Create a basic Hotel API - Coding Challenge
## Installation
Use [Valet](https://laravel.com/docs/6.x/valet) or [Homestead](https://laravel.com/docs/6.x/homestead) to run this project.
## Usage
```bash
docker-compose up -d
```
Visit [`localhost:8081`](http://localhost:8081/) to see the OpenAPI Specification. Use any HTTP Client tool you want for interacting with the API.
## TO-DO
The workflow I'm using for building every feature of this API is:
1. Design the API using the OpenAPI Spec
2. Write tests according to the API Specification
3. Write the code needed for making those tests pass
- [x] Create project scaffolding
- [x] Add SwaggerUI to docker-compose
- [x] Add Accommodation schema to yml
- [x] Add user authentication via API
- [x] Add Accommodations model, migration and factory
- [x] Add Locations model, migration and factory
- [x] Make users able to post an accommodation
- [x] Make users able to retrieve all accommodations
- [x] Make users able to retrieve a single accommodation
- [x] Make users able to update accommodations
- [x] Make users able to delete accomodations
- [x] Add booking endpoint than whenever is called reduces the accommodation availability, and that fails if there is no availability.
- [x] Make all errors and exceptions to follow the RFC7807 spec
- [x] Add tests for each validation
- [x] Add installation instructions