In this recruitment task you will have to add a few new features to a cryptocurrency exchange application. In the current revision, users are able to display a list of available crypto assets.
The application can be run directly on the host machine or using a Docker environment.
.env
file must be created in the main folder (you can base on .env.example
).
From the main folder run the following command:
docker-compose up -d
Containers with the application and database will be created. After that install required Composer libraries:
docker exec -it snowdog-academy_php_1 sh -c 'composer install'
The application will be accessible via http://127.0.0.1:8000.
To remove the containers run:
docker-compose down
Requirements:
In the main folder run a command to install required Composer packages:
composer install
After that start PHP built-in server:
php -S 0.0.0.0:8000 -t web/
The application will be accessible via http://127.0.0.1:8000.
Database configuration is placed in the config.ini
file - it can be created based on config.ini.example
and filled with proper values to your environment.
When the application is up and running for the first time, you have to run a script that will create all necessary tables in the database and will fill them with some data.
For Docker-based environment:
docker exec -it snowdog-academy_php_1 sh -c 'php console.php migrate_db'
For environment running on the host machine (run from the mail folder):
php console.php migrate_db
Create a fork of this repository and commit all changes there. Each task should be a separate, properly described commit.
Add possibility to buy selected cryptocurrency.
Add possibility to sell selected cryptocurrency.
Add fetching current prices of cryptocurrencies from API CoinCap, CoinGecko or any other chosen by you using the php console.php update_prices
command. In these two APIs, id
field in cryptocurrencies
table matches the asset ID in these two systems.
Add a new menu item named Add Funds. After clicking on it, the app should display a simple form that allows you to add funds to your account (one input field for amount and one submit button).
If you think the code needs refactoring or something can be done better or be optimised - do it. For sure, it will affect the score.