REST based interface for Splitwise
NOTE
names have been used as unique ids just for the sake of presentation, real world app should be based on UUID.
- Docker Based
- Docker
- run command
docker-compose --build
docker-compose up -d
This will expose 0.0.0.0:8000 port for API.
- Local Setup
- Python 3.9
- Pip
pip install -r requirements.txt
- Run the command
python manage.py makemigrations && python manage.py migrate && python manage.py runserver 8000
This will start the server at localhost:8000
Import the collection to postman and you will be able to see the endpoints and use them Also set an environment variable in postman
Variable Name = url
Variable Value = http://127.0.0.1:8000/api [local setup] or http://0.0.0.0:8000/api [for docker setup]
- Create User [/createUser]
- Create Group [/createGroup]
- Add member to group [/addUserToGroup]
- Add personal expense between 2 existing users [/addExpense]
- Add group expense [/addExpense]
- Show Group Expenses [/groupDetails]
- Show Group Members [/showGroupMembers]
- Show the user details [/userDetails]
- Record a personal payment [/recordPayment]
- Record a group payment [/recordPayment]
- Delete a user [/deleteUser]
- Delete a group [/deleteGroup]
Test cases are available in splitwise/tests.py
To run the test cases, run the command python manage.py test