Skip to content

LutviP19/backend-php

Repository files navigation

Backend PHP

  • Simple framework built with php, focus for microservices.

Requirement

  • PHP 8.2+
  • Redis CLI
  • RabbitMQ
  • MySQL / SQLite
  • OpenSwoole 22.x
  • Docker Desktop
  • Reserved Ports: 8008, 8080, 9501, 9502

Setup the app up and running

  • Install depedencies.
    composer install
  • Create new .env file.
    cp .env.example .env
  • Migrate database (mysql dump file) create table users : storage/database/migrations/mysql/user.sql create sample user : storage/database/seeders/mysql/insert_user.sql
  • Docker Compose (Supported services).

redis :

docker compose up docker-compose/redis/docker-compose.yaml

rabbitmq :

docker compose up docker-compose/rabbitmq-python/docker-compose.yaml

mailpit :

docker compose up docker-compose/mailpit/docker-compose.yml

dashboard :

docker compose up docker-compose/dashboard/docker-compose.yml
  • Run server.
php -S localhost:8000 -t public/
  • Or using swoole.
# Frontend
php servers/web-server.php

# Rest Api
php servers/http-server.php
  • Api Server (Open Swoole).
php servers/api-server.php

Console App

  • Listen Message (param: userid).
     php bin/console app:testing 1
  • Get app info (param: userid).
     php bin/console app:info 1
  • Setup app (planned)
     php bin/console app:setup

Console Tools

  • Create Self Signed Development Certificates
     bin/mkcert
  • Benchmarking OpenSwoole server performance
     php bin/benchmark
  • Running Pest unit test on this framework
     php bin/pest
  • Third party binary files to Support this framework performance (coming soon)
     bin/ffi/*

Logs

Basepath of logs at: storage/logs

error log: storage/logs/app_error.log

debug log: storage/logs/app_debug.log

info log: storage/logs/app_info.log

Demo

Please read DEMO.txt

Development Process

Please read DEV.txt

Please note this framework is still under development and requires some manual enhancements in a production environment.

Releases

No releases published

Packages

 
 
 

Contributors