This project intends to implement a Review service. I'm using the task to show how I would normally approach a Laravel project. I also want to show my practices on Git flows, writing tests, using static analyzers, utilizing automatic code style checks, adding GitHub workflows as the CI and writing documentation for the project.
- Filament as admin panel builder.
- Laravel Pint as code style fixer.
- Pest for writing tests.
- PHPStan for running static analyzes.
- Pest's Type Coverage plugin for checking %100 type coverage.
- Scribe for generating API documentation.
- Pint for code style checks.
- Tests for running the test suite.
- Static for running static analyzes workflows (PHPStan and Pest type coverage).
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
git clone https://github.com/fsamapoor/product-review-service.git
cd review
composer install
cp .env.example .env
php artisan key:generate
php artisan migrate --seed
php artisan db:seed --class=ReviewSeeder
php artisan serve
Method | Route | Description |
---|---|---|
GET |
/api/products |
Get all products. |
POST |
/api/products/:productId/reviews |
Create a review for a product. |
Visit APP_URL/docs
to see the API documentation, generated by Scribe.
composer test
Once the admin user is seeded, you can log in to the dashboard (APP_URL/admin/login
) using:
- email address: admin@fsamapoor.dev
- password: FilamentRocks!
- Developing remaining REST endpoints.
- Improving the test-suite.
- Containerizing the application.
- Implementing authentication.
- Implementing authorization.
- Adding a new workflow to auto-generate API docs.
- Introducing caching layer to product index.
- Adding GitHub workflow for auto-generating Scribe documents.
- Adding the logic to buy the products.