https://github.com/mrprotocoll/api-boilerplate-laravel
This Laravel 11 API boilerplate provides a structured foundation for building robust backend applications with Laravel, integrating essential features and tools.
https://github.com/mrprotocoll/api-boilerplate-laravel
boilerplate boilerplate-laravel laravel-11 laravel-11-boilerplate laravel-boi
Last synced: 5 months ago
JSON representation
This Laravel 11 API boilerplate provides a structured foundation for building robust backend applications with Laravel, integrating essential features and tools.
- Host: GitHub
- URL: https://github.com/mrprotocoll/api-boilerplate-laravel
- Owner: mrprotocoll
- Created: 2024-07-05T20:13:59.000Z (about 1 year ago)
- Default Branch: 0.1
- Last Pushed: 2024-12-15T15:25:04.000Z (7 months ago)
- Last Synced: 2025-01-15T10:59:22.269Z (6 months ago)
- Topics: boilerplate, boilerplate-laravel, laravel-11, laravel-11-boilerplate, laravel-boi
- Language: PHP
- Homepage:
- Size: 177 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
๐น๏ธ๐น๏ธ Laravel API Boilerplate๐น๏ธ๐น๏ธ
# ๐ Table of Contents
- [๐ About the Project](#about-project)
- [๐ Built With](#built-with)
- [Tech Stack](#tech-stack)
- [๐ Links](#api-docs)
- [Features](#features)
- [๐ป Getting Started](#getting-started)
- [Setup](#setup)
- [Prerequisites](#prerequisites)
- [Usage](#usage)
- [๐ค Contributing](#contributing)A robust, modular Laravel 11 API boilerplate built using a Domain-Driven Design (DDD) approach. This boilerplate provides a scalable foundation for modern API development with essential features like role-based access, versioning, Google OAuth integration, and more..
### Features
- Domain-Driven Architecture: Organized modules and shared resources for scalability.
- Versioning: Supports multiple API versions with structured routing.
- Role-Based Access Control: Integrated roles and permissions with easy extensibility.
- Google OAuth: Simplified OAuth 2.0 authentication setup.
- Modular Components: Independent modules for Auth, User, and more.
- Enums and Helpers: Centralized, reusable enums and helper methods.
- Custom Middlewares: Pre-configured middlewares for JSON responses, caching, logging, and preventing duplicate requests.
- Optimized Exception Handling: Friendly and consistent error responses.
- Custom Base Model: A UUID-enabled base model for consistency across entities.
- Seeders and Factories: Simplified data seeding with predefined roles.
- Rate Limiting: API throttling to prevent abuse.
- Fully Documented: Swagger/OpenAPI support for API documentation.### Architecture Overview
#### Domain-Driven Design (DDD)
The project structure is organized to separate concerns:`src/modules`: Contains feature-specific modules, e.g., Auth and User.
`src/shared`: Shared resources like helpers, enums, and base classes.#### Versioning
Version-specific modules and routes are located in the `V1` directory for flexibility.To access the documentation goto the below link
- Link to api routes
```
http://localhost:8000/v1
```
- Link to documentation
```
http://localhost:8000/v1/documentation
```
To get a local copy up and running, follow these steps.
### Prerequisites
In order to run this boilerplate, you need:
1. PHP ^8.2
use the following link to setup `PHP` if you dont have it already installed on your computer2. Composer
use the following link to Download `Composer` if you dont have it already installed on your computer## Install
clone the repository:
```
git clone [email protected]:mrprotocoll/api-boilerplate-laravel.git
```Install dependencies:
```
composer install
```## Setup
create .env file, change using the .env.example file and update the Database, Google Oauth (optional), and Email credentials.
```
cp .env.example .env
```Generate keys, Run the migration and seed roles:
```
php artisan key:generate
php artisan migrate --seed
```### Usage
The following command can be used to run the application.
```sh
php artisan serve
```## Contributing
Feel free to fork the repository, make changes, and submit pull requests. Feedback is always welcome!## License
This project is licensed under the MIT License.