A full-stack expense tracker built with Java Spring Boot. Ledger lets users record expenses, review spending patterns, and get AI-powered category suggestions and financial insights from Groq.
The live Render deployment is currently unavailable. The link below is a recorded walkthrough, so it shows the app but does not provide a live app to use. To try Ledger interactively, follow the local setup instructions below.
- Add and manage expenses with preset or custom categories
- Automatic category suggestions suggests a preset category from the description; you can change it
- Google login each user sees only their own data
- Monthly and yearly views with spending totals and comparisons
- Charts for category breakdown and monthly trends
- AI Insights with spending patterns and savings suggestions
- MySQL database data persists across sessions
| Layer | Technology |
|---|---|
| Backend | Java 17, Spring Boot 4.0.6, Spring Data JPA |
| Database | MySQL |
| Frontend | HTML, CSS, Vanilla JavaScript |
| Auth | Spring Security + Google OAuth2 |
| Charts | Chart.js |
| AI | Groq API (model configured with groq.model; defaults to openai/gpt-oss-120b) |
| Architecture | MVC — Controller → Service → Repository |
- Java 17+
- MySQL
- Groq API key (free at console.groq.com)
1. Clone the repository
git clone https://github.com/Krshm10/Ledger.git
cd Ledger2. Create MySQL database
CREATE DATABASE expensedb;3. Configure application.properties
Copy the example file, then fill in your MySQL, Groq, and Google OAuth credentials:
cp src/main/resources/application.properties.example src/main/resources/application.propertiesspring.datasource.url=jdbc:mysql://localhost:3306/expensedb
spring.datasource.username=root
spring.datasource.password=YOUR_MYSQL_PASSWORD
groq.api.key=YOUR_GROQ_API_KEY
# Optional; defaults to openai/gpt-oss-120b
groq.model=openai/gpt-oss-120b
spring.security.oauth2.client.registration.google.client-id=YOUR_GOOGLE_CLIENT_ID
spring.security.oauth2.client.registration.google.client-secret=YOUR_GOOGLE_CLIENT_SECRET
server.port=8080
spring.web.resources.static-locations=classpath:/static/For Google login, create an OAuth client ID in the Google Cloud Console. Add this authorized redirect URI: http://localhost:8080/login/oauth2/code/google.
Category suggestions and AI Insights use the same Groq key and model. Suggestions use the app's existing preset categories. If Groq is unavailable or returns an unrecognized category, the form keeps its current selection and lets you choose a category yourself.
4. Run the application
.\mvnw.cmd spring-boot:run5. Open Ledger in your browser
http://localhost:8080/index.html