npm install
npm run dev
open http://localhost:3000
### API Endpoints for Testing (assuming server runs on http://localhost:3000)
#### Add Expense - Dinner (₹600, paid by Shantanu)
```bash
curl -X POST http://localhost:3000/api/expenses \
-H "Content-Type: application/json" \
-d '{
"amount": 600,
"description": "Dinner",
"paidBy": "Shantanu",
"participants": ["Shantanu", "Sanket", "Om"],
"splitType": "equal"
}'
curl -X POST http://localhost:3000/api/expenses \
-H "Content-Type: application/json" \
-d '{
"amount": 450,
"description": "Groceries",
"paidBy": "Sanket",
"participants": ["Shantanu", "Sanket", "Om"],
"splitType": "equal"
}'curl -X POST http://localhost:3000/api/expenses \
-H "Content-Type: application/json" \
-d '{
"amount": 300,
"description": "Petrol",
"paidBy": "Om",
"participants": ["Shantanu", "Sanket", "Om"],
"splitType": "equal"
}'curl -X POST http://localhost:3000/api/expenses \
-H "Content-Type: application/json" \
-d '{
"amount": 500,
"description": "Movie Tickets",
"paidBy": "Shantanu",
"participants": ["Shantanu", "Sanket", "Om"],
"splitType": "equal"
}'curl -X POST http://localhost:3000/api/expenses \
-H "Content-Type: application/json" \
-d '{
"amount": 280,
"description": "Pizza",
"paidBy": "Sanket",
"participants": ["Shantanu", "Sanket", "Om"],
"splitType": "equal"
}'curl http://localhost:3000/api/expensesReplace YOUR_EXPENSE_ID_HERE with the actual ID obtained from listing expenses.
curl -X PUT http://localhost:3000/api/expenses/YOUR_EXPENSE_ID_HERE \
-H "Content-Type: application/json" \
-d '{
"amount": 350,
"description": "Petrol",
"paidBy": "Om",
"participants": ["Shantanu", "Sanket", "Om"],
"splitType": "equal"
}'Replace YOUR_EXPENSE_ID_HERE with the actual ID obtained from listing expenses.
curl -X DELETE http://localhost:3000/api/expenses/YOUR_EXPENSE_ID_HEREcurl http://localhost:3000/api/peoplecurl http://localhost:3000/api/balancescurl http://localhost:3000/api/settlementscurl -X POST http://localhost:3000/api/expenses \
-H "Content-Type: application/json" \
-d '{
"amount": -50,
"description": "Invalid Negative Amount Test",
"paidBy": "TestUser",
"participants": ["TestUser"],
"splitType": "equal"
}'curl -X POST http://localhost:3000/api/expenses \
-H "Content-Type: application/json" \
-d '{
"amount": 100,
"description": "",
"paidBy": "TestUser",
"participants": ["TestUser"],
"splitType": "equal"
}'curl -X POST http://localhost:3000/api/expenses \
-H "Content-Type: application/json" \
-d '{
"amount": 100,
"description": "Missing PaidBy Test",
"participants": ["TestUser"],
"splitType": "equal"
}'curl -X PUT http://localhost:3000/api/expenses/NON_EXISTENT_ID \
-H "Content-Type: application/json" \
-d '{
"amount": 100,
"description": "Attempt to update non-existent",
"paidBy": "TestUser",
"participants": ["TestUser"],
"splitType": "equal"
}'curl -X DELETE http://localhost:3000/api/expenses/NON_EXISTENT_IDcurl http://localhost:3000/api/balances