A serverless application to manage and split group expenses.
Built with Node.js, TypeScript, and AWS Lambdas, emulated locally using LocalStack.
To run this project locally, ensure you have:
- Node.js v20+
- npm
- Docker
- LocalStack
-
Start the PostgreSQL locally and run the database migration
docker-compose up -d
-
Start LocalStack and deploy AWS components
npm run start:local
To execute all unit tests and generate a coverage report:
npm run testThe coverage report will be generated in lcov format.
All endpoints are exposed via LocalStack's API Gateway on:
http://localhost:4566/restapis/<generated API ID>/local/_user_request_
Endpoint: POST /groups
Description: Create a new group to organize shared expenses.
curl --location 'http://localhost:4566/restapis/api-id-example/local/_user_request_/groups' --header 'Content-Type: application/json' --data '{
"name": "Amigos do futebol"
}'Endpoint: POST /group-member
Description: Register a member to a group so they can create and split expenses.
curl --location 'http://localhost:4566/restapis/api-id-example/local/_user_request_/group-member' --header 'Content-Type: application/json' --data-raw '{
"name": "Gustavo Macedo",
"email": "gstvo@macedo.com",
"groupId": "c6184ddc-8c39-4e9f-b8ab-cc8d9476a42c"
}'Endpoint: POST /expenses
Description: Create a shared expense and assign it to members of a group.
curl --location 'http://localhost:4566/restapis/api-id-example/local/_user_request_/expenses' --header 'Content-Type: application/json' --data '{
"name": "Refri 2L",
"amount": 10.11,
"groupId": "c6184ddc-8c39-4e9f-b8ab-cc8d9476a42c",
"splitToMembersIds": ["831665f7-47f4-47b2-8b2b-973a47efd1e8", "7479e4bf-61b4-441d-bd9c-2a529b698d1a"],
"payerId": "831665f7-47f4-47b2-8b2b-973a47efd1e8"
}'- AWS Lambda (Functions)
- SNS (Expense notifications)
- SES (Email notifications)
- CloudWatch (Logs)
- CloudFormation (Resource deployment)