This project is a personal code study developed using the Laravel framework, with the goal of practicing back-end architecture and applying modern coding principles. The focus has been on clean code, maintainability, and understanding how to structure scalable APIs.
-
SOLID Principles
- Single Responsibility: separated services, repositories, and controllers
- Dependency Inversion: designed for abstraction using interfaces
- Open/Closed: used enums and clean class extensions
-
Design Patterns
- Repository Pattern for clean data access
- Service Layer for encapsulating business logic
- Factory Pattern for model generation in testing
- Transformer Pattern via Laravel Resources
-
Clean Architecture Practices
- Validation through custom Form Requests
- Custom exceptions for clearer error handling
- Middleware for securing internal dev routes
-
RESTful API Design
- Token-based authentication using Laravel Sanctum
- Well-structured endpoints for user actions and transactions
This project uses:
- Laravel 12
- PHP 8.2
The API request collection is available in the documentations folder.
📌 Postman Collection – Digital Wallet
- Install Composer dependencies:
composer install- Copy the .env.example file to
.env:
cp .env.example .env
- Generate the application key:
php artisan key:generate
-
Configure the environment variables in the .env file, making sure to set up the database.
-
Run the database migrations and seeders:
Laradock will create a MySQL container. If you're not using Laradock, start the database using your preferred method.
php artisan migrate
php artisan db:seed
- * Start the local server:
php artisan serve
- Run automated tests:
php artisan test
It's recommended to run this project using Laradock.
- Inside the project root folder, run the following command:
git clone https://github.com/Laradock/laradock.git
- Navigate to the Laradock folder inside the project.
cd laradock
- Copy the .env.example file to
.env:
cp .env.example .env
- Open
.envand search for### PHP Version. - Change the
PHP_VERSIONvariable to8.2. - Run the following command:
docker-compose up -d nginx mysql workspace redis
- By default, the database connection should be configured as follows (Inside Laravel's .env):
DB_CONNECTION=mysql
DB_HOST=mysql
DB_PORT=3306
DB_DATABASE=your_schema_name
DB_USERNAME=root
DB_PASSWORD=root