The Enterprise Expense Management System is a robust backend application designed to manage and track enterprise expenses.
It streamlines expense handling with features for employees, managers, and administrators, including:
- ✅ Expense submission & tracking
- ✅ Multi‑level approval workflow
- ✅ Analytics & reporting for insights
Built with Spring Boot and secured with JWT authentication, the system ensures scalability, maintainability, and enterprise‑grade security.
The application is now organized as a modular monolith inside a single Spring Boot deployable:
com.main.trex.identity: authentication, users, roles, JWT/security, password resetcom.main.trex.expense: expenses, approvals, invoices, documents, analyticscom.main.trex.catalog: expense categoriescom.main.trex.notification: in-app notificationscom.main.trex.support: audit logs, contact requests, mail, admin support endpointscom.main.trex.shared: shared config, exception handling, common payloads, infrastructure utilities
This keeps one codebase and one deployment unit while making module ownership explicit in the package structure.
- User Authentication & Role-Based Access — secured with JWT
- Employee Expense Submissions — with receipt/file attachments
- Manager & Admin Approval Workflows — multi-level verification
- Expense Reports & Analytics Dashboards — department/monthly trends
- Audit Logs & Activity Tracking — compliance & transparency
- RESTful APIs — easy frontend & third-party integration
- PDF Report Generation — expense lists & summaries
- Email Delivery of Reports — automated mailing of expense reports
- Work in Progress — new features coming soon, open for collaboration 🤝
- Backend Framework: Spring Boot (Java)
- Database: PostgreSQL (or MySQL as alternative)
- Authentication: JWT (JSON Web Token)
- Build Tool: Maven/Gradle
- Deployment: Supports Docker, Docker Compose, and cloud platforms (AWS/GCP/Azure)
- Java 17+
- Maven or Gradle
- PostgreSQL/MySQL running locally or on cloud
- Docker (optional, for containerized setup)
git clone https://github.com/sagarboyal/enterprise-expense-tracker-backend.git Open the cloned repository in your favorite editor (e.g., IntelliJ IDEA, VS Code).
Create a .env file in the root project folder:
Here’s a sample .env configuration (replace with your values):
# =======================================
# 🗄️ Database Configuration
# =======================================
DB_URL=jdbc:postgresql://localhost:5432/postgres
DB_USERNAME=postgres
DB_PASSWORD=postgres
DRIVER_CLASS=org.postgresql.Driver
DB_DIALECT=org.hibernate.dialect.PostgreSQLDialect
# =======================================
# 🔐 JWT Configuration
# =======================================
JWT_SECRET=your_jwt_secret_key
JWT_EXP_TIME=3600000 # 1 hour (ms)
# =======================================
# 📧 Mail Configuration
# =======================================
MAIL_USERNAME=your_email@example.com
MAIL_PASSWORD=your_email_password
# =======================================
# 🌐 Frontend Integration (optional)
# =======================================
FRONT_END_URL=http://localhost:5173
# =======================================
# ☁️ Cloudinary Setup
# =======================================
CLOUD_NAME=your_cloud_name
API_KEY=your_api_key
API_SECRET=your_api_secret
MAX_FILE_SIZE=2MBlike in inteliJ
Then click on Modify option
Enable Environment Variable
Add Class Path where u place the .env file
You’ve successfully set up and configured the Enterprise Expense Management System - Backend.
Now you can run your application and start managing expenses with ease:
./mvnw spring-boot:runThe repository now includes a docker-compose.yml that starts:
db: PostgreSQL 16pgadmin: pgAdmin 4 for database access
- Copy
.env.docker.exampleto.envor update your existing.env. - Make sure
DB_USERNAME,DB_PASSWORD,JWT_SECRET, mail, and Cloudinary values are set. - Start the stack:
docker compose uppgAdmin is exposed on http://localhost:5050 by default. Sign in with PGADMIN_DEFAULT_EMAIL and PGADMIN_DEFAULT_PASSWORD, then register the database server with:
- Host:
db - Port:
5432 - Username:
DB_USERNAME - Password:
DB_PASSWORD