Skip to content

Laravel Lumen Best Practice Sample code base including API Documentaion, PHPUnit test and Code Coverage

Notifications You must be signed in to change notification settings

Jobinjose01/Lumen-RestAPI-Code

Repository files navigation

Usage

To get started, make sure you have Docker installed on your system, and then clone this repository.

Next, navigate in your terminal to the directory you cloned this, and spin up the containers for the web server by running docker-compose up -d --build site.

  • nginx - :81
  • mysql - :3307
  • php - :9000

Setup

Write Permission for logs folder

Run the below commands from the project_folder/src of the project using CLI

chmod -R 777 storage/

.env Copy

Run the below commands from the project_folder/src of the project using CLI

cp .env.example .env

Migrate the DB schema and Seed the tables

Run the below commands from project_folder/src

docker-compose run --rm artisan migrate

docker-compose run --rm artisan db:seed

Users & Groups Seeded are

The Users are admin,john, jane, ronald,sam,susie

The Groups are House Rent, Tour Club, Weekend Party

First two users are assigned to the first group as well

Swagger API

API Documentation

Generate Documentation From code base

docker-compose run --rm artisan swagger-lume:generate

MYSQL Database

Database can be access using the below link

DataBase

Host : mysql DB : splitwise User : root Pass : root

PHPUnit Test

docker-compose run --rm php vendor/bin/phpunit

Code Coverage Reports

Can access the code coverage report and Graph

docker-compose run --rm php vendor/bin/phpunit --coverage-html public/coverage/

Front End

Front end of the appliation is not developed , but the API documentation is done with Swagger Package, so you can try out all from that.

Access The CLI

docker ps

docker exec -it redis-cli

MYSQL Access

docker exec -it bash root@containerID:/# mysql -u root -p

Technology stack

PHP - 8.1.4 (Lumen Framework), MySQL - 5.7.9

About

Laravel Lumen Best Practice Sample code base including API Documentaion, PHPUnit test and Code Coverage

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages