coding round solution for a FinTech startup
To start the project using docker (recommended)
To start the project directly
create virtual env python -m venv .venv
activate source .venv/bin/activate then install dependency pip install -r requirements.txt
python manage.py runserver
user can login and get token
Get all expensed added by him
Create expense
create group
get all groups
create friends
get friend
update friend
get expense for type: friend
Get overall expense in splitwise
settleup payment with a friend
Token Based Authentication
POST - localhost:8000/api/users/token/ - create or get token
payload
{
"username": "admin",
"password": "password"
}
Token 5121c747ea3ee0dff961cafcf812ac567800efb7
Authenticated API - send (Authorization: in header)
GET - localhost:8000/api/expense/ - to get all Expenses added by you
GET - localhost:8000/api/expense/ - Get all expensed
POST - localhost:8000/api/expense/ - Create Expense
payload
{
"amount": 200,
"payer": 1,
"payee": 2
}
POST - localhost:8000/api/group/ - create group
payload
{
"name": "Family",
"users": [
1,2
]
}
GET - localhost:8000/api/group/ - get all groups
POST - localhost:8000/api/friend/ - create friends
GET - localhost:8000/api/friend/ - get friends
PUT - localhost:8000/api/friend/1/ - update friend
GET - localhost:8000/api/expense/friend/ - get expense for type: friend
GET - localhost:8000/api/expense/overall/ - your overall expense in splitwise
POST - localhost:8000/api/expense/settleup/ - to settleup payment with a friend