https://github.com/emmyaniedev/library_management_api_version
This project is a versioned RESTful API built with Laravel, designed to support multiple versions (v1 and v2) while maintaining backward compatibility. The application is containerized using Docker to ensure consistency and scalability. With Docker Compose, the project runs seamlessly in multiple containers for the app, PostgreSQL, and NGINX.
https://github.com/emmyaniedev/library_management_api_version
api-versioning docker docker-compose docker-container docker-image dockerfile nginx restful-api
Last synced: 19 days ago
JSON representation
This project is a versioned RESTful API built with Laravel, designed to support multiple versions (v1 and v2) while maintaining backward compatibility. The application is containerized using Docker to ensure consistency and scalability. With Docker Compose, the project runs seamlessly in multiple containers for the app, PostgreSQL, and NGINX.
- Host: GitHub
- URL: https://github.com/emmyaniedev/library_management_api_version
- Owner: EmmyAnieDev
- Created: 2025-01-10T16:10:07.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-12T21:01:53.000Z (over 1 year ago)
- Last Synced: 2025-01-28T21:36:41.478Z (about 1 year ago)
- Topics: api-versioning, docker, docker-compose, docker-container, docker-image, dockerfile, nginx, restful-api
- Language: PHP
- Homepage:
- Size: 79.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README-V2.md
Awesome Lists containing this project
README
## Introduce API Version 2 for Books
- Added `BookV2` model for API version 2 under `App\Models\v2`.
- Created a new `books_v2` table with updated structure:
- Fields updated:
- `name` → `title`
- `owner` → `author`
- `about` → `description`
- `category_id` field remains unchanged and continues to reference the `categories` table.
## Updated relationships:
- `Book` v2 still references the same `Category` model from version 1.
- Added API routes for version 2 (`/api/v2/books`) in `routes/api.php`.
- Created new controller `App\Http\Controllers\Api\v2\BookV2Controller` for handling version 2 book-related logic.
- Ensured backward compatibility with version 1 API (`/api/v1/books`) for existing users.