This application provides an API (Application Programming Interface) and performs ordering process.
The project structure is as bellow
- .assets
The assets of the readme file are placed here
- .web
The nginx configurations are placed here
- .backend
The backend application configurations are placed here
- backend
The backend application itself is placed here
- .frontend
The frontend application configurations are placed here
- frontend
The frontend application itself is placed here
- .gitignore
The assets that should be ignored by git
- docker-compose.yml
docker compose configuration
- Makefile
This file is here to help working with the project
You need docker
and docker-compose
in order to run this application.
If you don't have make
on your operating system for running the application,
you need to read Makefile
and do as up
method says, otherwise you just need
to follow Running section.
- docker you need to have docker installed and running on your system, and be able to run the program without using sudo command.
- docker-compose you need to have docker compose installed on your os.
- make in order to use the make command you need to have this package installed, chances are you have this package already installed on your os, specially if you are a linux user, if you don't have it, and you are not willing to install it, you can open the Makefile located in the projects root, and run the commands yourself line by line based on what command you need.
In this section working with the application is described.
For running application you need to execute up
method using make
command
like bellow:
make up
You can add options like --build to rebuild the images again or --remove-orphans for removing unused made services by the up command like bellow.
make up options="--build --remove-orphans"
If you need to check the project's container states, you can do so by one of the bellow commands.
make ps
make status
You can stop the project using bellow command.
make down
If you wish to destroy the project's allocated volumes and containers you can do so like this.
make destroy
You can log into the container using bellow command.
make shell
You can also run your command directly outside the container like bellow.
make shell run="composer fix"
And you can log into another container like web or database with bellow command.
make shell service=web run=ash
You can check the docker logs using bellow command.
make logs
You can follow the logs like bellow too.
make logs follow
And last but not least, you are able to define your considered service like bellow.
make logs service="web"
And for following also, you just need to tell it to follow too, like bellow.
make logs service="web" follow
You can run tests outside the application's container by make
tool using
bellow command.
make test
You can get a nice test coverage report from the PHPUnit by running this command.
make coverage
The telescope is added to the project, so you can see the notification for changed order status is being processed and send to the user in the system which in this case all mails are Logged instead of being truly send to anyone.
For handling queues the laravel built-in tool called queue
is being used and after the backend
container did run, an execution command is triggered to run the queue:work
command as an os
background job.
You can have a postman collection of the apis.