Ruby 2.7.2
Rails 6.0.3.4
NodeJS 12.18.3
Yarn 1.22.4
- Trader is able to create a account.
- Trader is able to login his credentials so that he can access his account on the app.
- Trader is able to receive a notification email after creating an account.
- Trader is able to receive a notification email upon account approval.
- Trade is able to buy or sell stocks (only after his account is approved).
- Trader is able to see his transactions history.
- Admin is able to manually create an account for traders.
- Admin is able to edit/update a trader's account details.
- Admin is able to view a specific trader's details.
- Admin is able to see all registered traders.
- Admin is able to see all pending account registrations.
- Admin is able to a pending registration so a trader can start buying stocks.
- Admin is able to see all transactions to monitor it's flow on the application.
Part of scope of this project is utilizing the IEX Gem (IEX Cloud API), the team implemented the solutions below to mitigate the risk of exceeding the number of calls allowed for free tier accounts.
- All stocks list are seeded on the database upon deployment.
- Once a user navigates on stock page to see the stocks list, corresponding prices are fetched for the external API.
- Before fetching, price are checked if they were fetched within the last five minutes. If so, prices are not fetched anymore as they are deemed as updated. Otherwise, the second step from this flow is runs.
- When a user visits a specific stock, the prices of that stock is checked if it is updated within the last five minutes. If the price is not updated, a call the API will run to fetch the latest price.
- A user may stay on the specific stock page for more than five minutes without doing any transaction. In this scenario, whenever a user tries to create a transaction (buy/sell stocks), a check on the stock price is done to determine if it is updated within the last five minutes. If the price is not updated, the transaction will fail, and a call to the API will run to update the price. The user will then be prompted to transact again with the updated price.
Upon approval of the trader account registration by the admin, a virtual wallet associated with him is created with an initial amount of $ 1-Million.
Live Demo : https://trading-app-avion.herokuapp.com/
Trader:
email: user@email.com
password: password
Admin:
email: admin@email.com
password: password