In this project we have created a RESTful API backend for expense management application, based on PHP 8 symfony framework.
This application allows you to manage expenses with all API that you might need to build a front end application.
Now let's jump into the project testing :D
- Docker and docker-compose installed in minimal version 1.24. You can check version with docker-compose -v If you're missing this requirement please refer docker-installation.md file.
- Clone this repository by running the following command in the desired directory:
git clone https://github.com/mhmdmousawi/ems-symfony.git
- Change directory to access the root folder of the project:
cd ems-symfony
- Run the docker container to start the project:
docker-compose up -d --build
later you can only use docker-compose up -d
inside your root directory
Once you can access the web application throw the port defined in .env
file port :8101
and the database throw port :33016
(also you can access phpmyadmin webpage for DB managing throw port: 8102
)
- Access the container:
docker exec -it ems-symfony-server bash
- Run the migrations inside the container, and then clear the cache:
php bin/console doctrine:migrations:execute --up 'DoctrineMigrations\Version20211211142232'
php bin/console doctrine:migrations:execute --up 'DoctrineMigrations\Version20211211151003'
php bin/console doctrine:migrations:execute --up 'DoctrineMigrations\Version20211211151010'
php bin/console doctrine:migrations:execute --up 'DoctrineMigrations\Version20211211160334'
- Configuration is already done. But in case you want to change anything please feel free to update the
.env
file before running the containers.
APP_NAME=ems-symfony
APP_PORT=8101
APP_DB_ADMIN_PORT=8102
DB_PORT=33016
MYSQL_ROOT_PASS=superSecr3t
MYSQL_USER=app_user
MYSQL_PASS=t3rceS
MYSQL_DB=ems-symfony
Now that you have set your project up, it's time for fun testing.
Since this is a Back End application, so you will have to download Postman (https://www.postman.com/downloads/)
Now to help you check all the API endpoints, I have prepared a Postman Collection that you can download as well: https://drive.google.com/drive/folders/1Vnksa2_blbvARvoXKTopnYExG6LvQo-3?usp=sharing
Happy Testing! :)
Of course this project can be enhanced a lot, where it can have:
- User authentication
- List filtering
- List pagination
- etc ..