fsamapoor / product-review-service

I'm using the task to show how I would normally approach a Laravel project.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Laravel Logo

About Review Project

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.

Tools

GitHub workflows

  • Pint for code style checks.
  • Tests for running the test suite.
  • Static for running static analyzes workflows (PHPStan and Pest type coverage).

Setup

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Dependencies

Getting Started

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

API Endpoints

Method Route Description
GET /api/products Get all products.
POST /api/products/:productId/reviews Create a review for a product.

API Documentation

Visit APP_URL/docs to see the API documentation, generated by Scribe.

Testing

composer test

Admin panel credentials

Once the admin user is seeded, you can log in to the dashboard (APP_URL/admin/login) using:

TODOs:

  • 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.

About

I'm using the task to show how I would normally approach a Laravel project.


Languages

Language:PHP 55.9%Language:HTML 22.0%Language:Blade 9.3%Language:CSS 7.6%Language:JavaScript 5.3%