A comprehensive full-stack expense management application with enterprise-grade security, built with Spring Boot (Java) and React (TypeScript). Features secure expense tracking, budget management, categorization, and detailed financial reports with interactive charts.
- Backend: Spring Boot 3.5.0 with Java 21, Spring Security 6.5.0, Argon2 password hashing, JWT authentication, H2/PostgreSQL database
- Frontend: React 18 with TypeScript, Vite, Tailwind CSS, Recharts for data visualization
- Security: TLS 1.3 encryption, AES-GCM data encryption, rate limiting, security audit logging
- Database: H2 (development), PostgreSQL (production)
Before running this application, ensure you have the following installed:
- Java 21 or higher
- Download from: https://adoptium.net/
- Verify:
java -version
- Node.js 18+ and npm
- Download from: https://nodejs.org/
- Verify:
node --versionandnpm --version
- Maven 3.6+ (usually comes with Java IDEs)
- Verify:
mvn --version
- Verify:
- Git for version control
- Visual Studio Code or IntelliJ IDEA for development
- Postman for API testing
git clone https://github.com/sreekanthvaripalli/expenseManager.git
cd expenseManagercd backend# Compile and run the Spring Boot application
mvn spring-boot:runThe backend will start on http://localhost:8080
- Open the
backendfolder in your IDE (IntelliJ IDEA recommended) - Run the
ExpenseManagerApplication.javamain class
cd frontendnpm installnpm run devThe frontend will start on http://localhost:5173
Open your browser and navigate to: http://localhost:5173
The application uses sensible defaults, but you can customize via application.yml:
# backend/src/main/resources/application.yml
spring:
datasource:
url: jdbc:h2:mem:expensedb
username: sa
password:
jpa:
hibernate:
ddl-auto: create-drop
show-sql: true
h2:
console:
enabled: true
server:
port: 8080
# JWT Configuration
jwt:
secret: your-secret-key-here (min 32 characters)
expiration: 86400000 # 24 hours in millisecondsYou can override JWT settings using environment variables:
export JWT_SECRET=your-custom-secret-key-minimum-32-characters
export JWT_EXPIRATION=86400000- Development: Uses H2 in-memory database (data resets on restart)
- Production: Configure PostgreSQL/MySQL in
application.yml
To access H2 console: http://localhost:8080/h2-console
- JDBC URL:
jdbc:h2:mem:expensedb - Username:
sa - Password: (leave empty)
- Open the application in your browser
- Click "Don't have an account? Sign up" on the login page
- Fill in your details:
- Full Name
- Email Address
- Password (minimum 6 characters)
- Confirm Password
- Click "Create account"
- You'll be automatically logged in and redirected to the dashboard
- On the login page, enter your registered email and password
- Click "Sign in"
- You'll be redirected to the main application
The dashboard provides:
- Total Spending: Summary of all expenses
- Category Breakdown: Visual representation of spending by category
- Budget Status: Current budget utilization with color-coded progress bars
- Monthly Trends: Interactive charts showing spending patterns
- Navigate to the "Expenses" page
- Click "Add Expense" (or the + button)
- Fill in expense details:
- Amount
- Date
- Category (choose from your categories)
- Description (optional)
- Recurring flag (optional)
- Click "Add Expense"
- On the Expenses page, find your expense in the table
- Click "Edit" to modify expense details
- Click "Delete" to remove the expense
- Confirm deletion when prompted
- Use the date range picker to filter expenses by date
- Select a category to view expenses for that category only
- Filters apply to both the table and summary calculations
- Go to Settings β Categories section
- Enter category name
- Choose a color (hex code or color picker)
- Click "Add Category"
- Find the category in the list
- Click the "Delete" button (trash icon)
- Confirm deletion
Note: Default categories are created automatically when you register. You can add custom categories or delete unused ones.
- Go to Settings β Budgets section
- Select the month and year (use navigation arrows)
- For each category, enter a budget limit
- Click "Add Budget" or "Update Budget"
- Dashboard: See budget progress bars and status
- Expenses Page: Budget warnings appear when approaching limits
- Settings: Detailed budget management with edit/delete options
- π’ Green: Under 80% of budget
- π‘ Orange: 80-99% of budget
- π΄ Red: Over 100% of budget
- View interactive bar charts showing spending across months
- Hover over bars to see exact amounts
- Charts update automatically as you add expenses
- Compare actual spending vs. budgeted amounts
- See budget utilization percentages
- Identify categories where you're over/under budget
The application supports multiple currencies:
- USD, EUR, GBP, JPY, CNY, INR, AUD, CAD, CHF, SEK, NZD, SGD
To change currency:
- Go to Settings
- Select your preferred currency from the dropdown
- All amounts will be displayed in the selected currency
Note: Currency selection is stored locally in your browser.
cd backend
mvn testcd backend
mvn test jacoco:reportOpen backend/target/site/jacoco/index.html in your browser
cd backend
mvn test -Dtest=AuthServiceTestcd backend
mvn test -DskipIntegrationTests=truecd frontend
npm testcd frontend
npm test -- --watchcd frontend
npm test -- --run --coverageOpen frontend/coverage/index.html in your browser
cd frontend
npm test -- --run LoginPage.test.tsx| Component | Coverage | Tests |
|---|---|---|
| Backend | 82% instructions, 80% lines | 98 tests |
| Frontend | 76% statements, 78% lines | 75 tests |
| Total | ~79% | 173 tests |
# Terminal 1 - Backend
cd backend && mvn test
# Terminal 2 - Frontend
cd frontend && npm test -- --run --coverageThe backend provides a comprehensive REST API. Access the Swagger documentation at:
http://localhost:8080/swagger-ui.html
POST /api/auth/register- User registrationPOST /api/auth/login- User login
GET /api/expenses- List expenses (with optional filters)POST /api/expenses- Create new expensePUT /api/expenses/{id}- Update expenseDELETE /api/expenses/{id}- Delete expenseGET /api/expenses/summary- Get expense summaryGET /api/expenses/summary/monthly- Get monthly summaries
GET /api/categories- List user categoriesPOST /api/categories- Create categoryDELETE /api/categories/{id}- Delete category
GET /api/budgets?year={year}&month={month}- List budgets with statusPOST /api/budgets- Create budgetPUT /api/budgets/{id}- Update budgetDELETE /api/budgets/{id}- Delete budget
- Change database configuration to PostgreSQL/MySQL
- Set strong JWT secret key
- Configure proper CORS origins
- Enable HTTPS
- Set up proper logging
cd frontend
npm run buildDeploy the dist folder to your web server.
docker build -t expensemanager backend/docker-compose up -d- Ensure Java 21+ is installed and JAVA_HOME is set
- Check that port 8080 is not in use
- Verify Maven installation
- Run
mvn clean compileto ensure dependencies are downloaded
- Ensure Node.js 18+ is installed
- Check that port 5173 is not in use
- Try deleting
node_modulesand runningnpm installagain
- Clear browser localStorage
- Check that backend is running on port 8080
- Verify JWT token hasn't expired (24 hours)
- Check browser console for CORS errors
- For H2 console access, ensure
spring.h2.console.enabled=true - Check database URL in application.yml
- Data resets on restart (H2 in-memory)
- Backend: Run
mvn clean testto refresh - Frontend: Delete
node_modulesand reinstall - Check Java version (needs 21+)
- Ensure ports 8080 and 5173 are free
- Check the browser developer console for frontend errors
- Check backend logs in the terminal where you ran
mvn spring-boot:run - Verify all prerequisites are installed correctly
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Add tests for new functionality
- Ensure all tests pass:
- Backend:
mvn test - Frontend:
npm test -- --run
- Backend:
- Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
expenseManager/
βββ backend/ # Spring Boot backend
β βββ src/
β β βββ main/
β β β βββ java/ # Java source code
β β β β βββ com/example/expensemanager/
β β β β βββ config/ # Security & JWT config
β β β β βββ controller/ # REST controllers
β β β β βββ dto/ # Data transfer objects
β β β β βββ model/ # Entity models
β β β β βββ repository/ # Data repositories
β β β β βββ service/ # Business logic
β β β βββ resources/
β β β βββ application.yml # App configuration
β β βββ test/ # Test files
β βββ pom.xml # Maven dependencies
β
βββ frontend/ # React frontend
β βββ src/
β β βββ components/ # Reusable React components
β β βββ contexts/ # React contexts (Auth, Currency)
β β βββ pages/ # Page components
β β βββ services/ # API service functions
β β βββ styles.css # Global styles
β βββ package.json # NPM dependencies
β βββ vite.config.ts # Vite configuration
β
βββ screenshots/ # Application screenshots
βββ README.md # This file
βββ COVERAGE_REPORT.md # Test coverage report
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with Spring Boot and React
- Charts powered by Recharts
- UI styling with Tailwind CSS
- Authentication with JWT and Spring Security
- Password hashing with Argon2