Skip to content

swatipy/expense-sharing-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Expense Sharing API

A RESTful Java API that helps groups track and split shared expenses fairly. Ideal for roommates, friends traveling together, or teams managing shared costs.

🛠️ Features

  • Create users and groups
  • Add shared expenses with split logic
  • View who owes whom
  • Settle balances
  • Track group expenses over time

🚀 Getting Started

Tech Stack

  • Java 21.0.6
  • Spring Boot
  • REST API (Spring MVC)
  • MySQL (configured via application.yml)
  • JPA / Hibernate
  • Gradle

Prerequisites

  • Java 11+
  • Maven / Gradle
  • Any IDE like IntelliJ or Eclipse

Installation

Clone the repo:

git clone https://github.com/pinkish-code/expense-sharing-API.git

Run the App

./gradlew bootRun

The API will start on: http://localhost:8080

Project Structure

src/
├── main/
│   ├── java/
│   │   └── org.example
│   │       ├── controller/
│   │       ├── service/
│   │       ├── model/
│   │       └── repository/
│   └── resources/
│       └── application.yml
└── test/

Sample API Endpoints

Method Endpoint Description
POST /users Create a new user
POST /expenses Add an expense
POST /show Show balances

Example: Add Expense Payload json

{ "command": "EXPENSE", "userId": "u1", "expense": { "paidBy": "u1", "amountPaid": 200.0, "userIds": ["u1", "u2", "u3"], "splitType": "EXACT", "values": [40, 100, 60] } }

Contributions

Contributions welcome! Please open an issue or submit a pull request.

Run

java -Xms256m -Xmx700m -jar build/libs/Expense-sharing-API-1.0-SNAPSHOT.jar --spring.profiles.active=production

Deploy to Prod

scp -i ~/Downloads/expkey.pem /Users/swati.gupta/code/Expense-sharing-API/build/libs/Expense-sharing-API-1.0-SNAPSHOT.jar ubuntu@3.108.252.183:/home/ubuntu/

Login to instance

ssh -i ~/Downloads/expkey.pem ubuntu@3.108.252.183

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages