|
|
|
<div align="center">
|
|
|
|
<img src="https://raw.githubusercontent.com/Jobsity/ReactChallenge/main/src/assets/jobsity_logo_small.png"/>
|
|
|
|
</div>
|
|
|
|
|
|
## Description
|
|
## Description
|
|
|
|
This Challenge is designed to test your abilities building backend web projects in PHP. Show us your best skills and knowledge in good practices and standards.
|
|
|
|
|
|
## Assignment
|
|
## Assignment
|
|
|
|
The objective of this challenge is to create a REST API application that the user can use to track the value of stocks in the stock market. The base application presented here uses a simple implementation of [Slim Framework](https://www.slimframework.com/docs/v3/)
|
|
|
|
|
|
|
|
You may use the [Stooq](https://stooq.com/q/l/?s={stock_code}&f=sd2t2ohlcvn&h&e=csv) API service.
|
|
|
|
|
|
## Mandatory Features
|
|
## Mandatory Features
|
|
|
|
- The application must use a SQL database to store users and record logs of past requests. Check out the Slim documentation if you would like to use [Eloquent](https://www.slimframework.com/docs/v3/cookbook/database-eloquent.html), [Doctrine](https://www.slimframework.com/docs/v3/cookbook/database-doctrine.html) or [Atlas](https://www.slimframework.com/docs/v3/cookbook/database-atlas.html).
|
|
|
|
- The application must be able to authenticate registered users.
|
|
|
|
|
|
|
|
The application must have these three endpoints:
|
|
|
|
|
|
|
|
- An endpoint to create a new User, storing the email and information to log in later.
|
|
|
|
- An endpoint to request a stock quote, like this:
|
|
|
|
|
|
|
|
`GET /stock?q=aapl.us`
|
|
|
|
|
|
|
|
```
|
|
|
|
{
|
|
|
|
"name": "APPLE",
|
|
|
|
"symbol": "AAPL.US",
|
|
|
|
"open": 123.66,
|
|
|
|
"high": 123.66,
|
|
|
|
"low": 122.49,
|
|
|
|
"close": 123
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
The same endpoint must additionally send an email with the same information to the user who requested the quote. To send the email, you may use [SwiftMailer](https://swiftmailer.symfony.com/docs/introduction.html) with [the wrapper included](app/services.php), or use your own implementation.
|
|
|
|
- An endpoint to retrieve the history of queries made to the API service by that user. The endpoint should return the list of entries saved in the database, showing the latest entries first:
|
|
|
|
|
|
|
|
`GET /history`
|
|
|
|
|
|
|
|
```
|
|
|
|
[
|
|
|
|
{"date": "2021-04-01T19:20:30Z", "name": "APPLE", "symbol": "AAPL.US", "open": "123.66", "high": 123.66, "low": 122.49, "close": "123"},
|
|
|
|
{"date": "2021-03-25T11:10:55Z", "name": "APPLE", "symbol": "AAPL.US", "open": "121.10", "high": 123.66, "low": 122, "close": "122"},
|
|
|
|
...
|
|
|
|
]
|
|
|
|
```
|
|
|
|
|
|
## Bonus features
|
|
## Bonus features
|
|
|
|
The following features are optional to implement, but if you do, you'll be ranked higher in our evaluation process.
|
|
|
|
|
|
|
|
- Add unit tests for the bot and the main app.
|
|
|
|
- Use RabbitMQ to send the email asynchronously.
|
|
|
|
- Use JWT instead of basic authentication for endpoints.
|
|
|
|
|
|
## Considerations |
|
## Considerations |