Restful API to fetch stocks price based on Financialmodelingprep.
- PHP >= 7.3
- Composer >= 1.9.x
- Node.js >= 10.x
- Yarn >= 1.19.x
-
git clone https://github.com/oachoor/stocks-price-widget.git && cd stocks-price-widget
(Skip for zipped) -
composer install
-
cd build && yarn install
Run the following commands (Make sure ports 8000 & 3000 are not used)
php -S localhost:8000
cd build && yarn start
On success you'll get redirected to http://localhost:3000
To make a live widget on a page with current stocks prices of most active companies on the market. A widget should include:
- a name of a company
- a current price
- a time of an update
Every 10 seconds the widget should show a different company stocks price (random choice).
The backend solution should include at least one class with chosen OOP pattern (this choice should be justified). The code should include tests. Any Composer packages could be used.
Get a list of tickers of companies could get from this API URL - https://financialmodelingprep.com/developer/docs#Most-Active-Stock-Companies A current price of stocks could get from this API URL - https://financialmodelingprep.com/developer/docs#Stock-Price.
composer test