Skip to content

aronnebrivio/a-lumen-blog

Repository files navigation

Blog backend

CI/CD codecov shepherd LICENSE

Lumen project providing an API to a blog environment, with Users, Posts and Comments.

Documentation can be found here.

Requirements

Installation

  • cd in project directory
  • Create .env file with cp .env.example .env and fill all missing variables
  • Start Lumen and Database containers with docker-compose up -d
  • Install required dependencies with docker exec -it blog-lumen bash -c "composer install"
  • Generate JWT Secret with docker exec -it blog-lumen bash -c "php artisan jwt:secret"
  • Run migrations with docker exec -it blog-lumen bash -c "php artisan migrate:fresh --seed"
  • Profit

Notes

APIs will be available at http://localhost:PHP_HOST_PORT, where PHP_HOST_PORT is declared in .env file.
You can enable or disable XDebug using the XDEBUG_MODE environment variable.

Test

Tests are under /tests folder, run it with phpunit:

docker-compose run --rm blog-lumen bash -c "composer test"

Or, if you like coverage:

docker-compose run --rm blog-lumen bash -c "composer test:coverage"

PHPUnit coverage report will be accessible at private/tmp/index.html.

ToDo

  • Upgrade to Lumen 8.x
  • Upgrade to Composer 3
  • Automated PHP-CS-Fixer
  • Redis cache
  • Clean up local Docker environment
  • Review CI Docker environment
  • Use Github workflow
  • Setup a simple production environment
  • Containerized infrastructure for server
  • Pagination
  • Notifications
  • Upgrade to PHP 8.0

License

Copyright (c) 2020 Aronne Brivio. Released under the MIT License. See LICENSE for details.