- Python 3.7+
- Install dependencies
pip install -r requirements.txt
- Start FastAPI process
python main.py
- Open local API docs http://localhost:8000/docs
-
The API is hosted at localhost:8000 with the following HTTP's methods:
- GET: Get points the user has in their account based on the payer they were added through at "/balance"
- POST:
- Add a new transaction to transaction history at "/add"
- Update the payers' balance based on number of points user spent at "/spend"
-
The documentation for the above HTTP's methods is hosted at localhost:8000/docs
-
You can try sending the above requests by:
-
Open local API docs http://localhost:8000/docs
-
Click "Execute" and see the following output (status code, response body, etc.)
-
The challenge was built by Khoa Cao, any reuse of the code should have Khoa's permission.