Skip to content

nasservb/WorldTravel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This project implements a simple PHP-backed application for searching for travel and booking a ticket for a customer.

  • The application architecture is MVC and implemented with PHP pure (without framework).
  • The front-end application used Vue.js to implement the customer panel and require.js to manage JavaScript library loading in the browser.
  • The database is MySQL, and the relationships between the tables are defined.
  • The ORM is a simple PHP file that any other SQL-compatible database can replace by implementing a database interface. DB providers use a strategy pattern to switch between database drivers.
  • The event-driven architecture is implemented with the RabbitMQ driver.
  • You could see simple events and consumers in the code base.
  • Security is so simple and powered by JWT tokens that can be kept for 1 hour each.
  • The router is implemented with an elementary PHP class.
  • The application used Docker Compose to run all components.
  • The integration tests are implemented by using the PHPUnit library.

Table of Contents

Class Diagram

Setup environment

we could run environment with

docker-compose up

Build backend

build data base tables and default data :

docker-cmpose exec app sh 
composer i
php cli.php
 

and select "7. Init DB(essential at first time running )" from menu

Build frontend

build front end application :

docker-cmpose exec front sh 
npm i
npm run prod
 

now you can open the "http://127.0.0.1:4000/" url in your browser and test app

Tests

run tests:

php vendor/bin/phpunit  --testdox  tests/ 

Rabbitmq consumer

run rabbitmq consumer for email :

docker-cmpose exec app sh 
php src/Consumers/Mail.php
 

About

php-pure + vuejs+tests+orm+router+event-driven

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published