A small web application to convert currencies, fetching data from an API.
####Prerequisites This project runs best on Linux or MAC on PHP 7.1.
###How to get Started
- Clone the repository from GitHub
- Cd to the directory of the cloned project
- Copy
.env.dist
file and name it .env
- At the
DATABASE_URL
, replacedb_user
,db_password
anddb_name
with appropriate values (standardly, this isroot
,root
,Symfony
) - Run composer install (you might have to install Composer on your PC first) and provide standard values if prompted to do so.
Make sure the database name corresponds to the one provided in the
DATABASE_URL
in.env
- Run
php bin/console server:start
- To create the database, run:
php bin/console doctrine:database:create
- Done: check out the application on http://localhost:8000
- To stop the local webserver, simply run
php bin/console server:stop
###Documentation
I chose to realize this showcase in PHP 7.1 and Symfony 4 in combination with a Twig frontend to demonstrate my skills in this framework. The implementation of the Model View Controller (MVC) principles is also showcased within this project. The layout was provided by the free template Epilogue.
I chose to use the Fixer API because it returns a JSON object, which I find easier to process than XML.
The installation of bundles is done with the help of Composer. A fairly standard set of bundles was used in this project.
For development, the application runs under the Symfony-native localhost webserver on port 8000. In case of further development, a docker container could be included, but for the time being, the inbuilt functionalities of Symfony seem sufficient.
Authorization is done with the help of the FOSUser Bundle to facilitate authorization. For this, the FOSUser templates were not overridden for time reasons.
- Initial creation of project and setting up the template: ~0.5h
- Setting up FOSUserBundle for authentification: ~0.25h
- Creating and adapting entities for User (needed for authentification), Currency and ConverterFormType ~0.75h
- Form handling and debugging: ~ 1h
- Switching to a different API endpoint (from ?latest to ?convert) to increase userfriendliness: ~0.5h
- Writing this documentation ~ 0.25h