The Centimate API is a Spring Boot-based expense tracker designed to help users manage their financial transactions. It provides secure user authentication with JWT and endpoints for expense management.
- User authentication with signup and login.
- Expense tracking with CRUD operations.
- Expense categorization (e.g., GROCERIES, HEALTH, LEISURE).
- Integration with PostgresSQL.
- Dockerized for deployment and management.
git clone git@github.com:nicolendless/centimate.git
cd centimateCreate a .env file in the project root with the following:
POSTGRES_DB=centimate_db
POSTGRES_USER=local
POSTGRES_PASSWORD=password
JWT_SECRET=<your-generated-secret>Important:
-
Replace
<your-generated-secret>with a securely generated key. -
You can generate a secure key using:
openssl rand -hex 32
make build
make run| Command | Description |
|---|---|
make build |
Build the application and Docker image. |
make run |
Start the application and services using Docker Compose. |
make test |
Run all tests with Maven. |
make stop |
Stop the Docker Compose services. |
make clean |
Clean project artifacts and remove Docker containers/volumes. |
make logs |
View the logs for the application service. |
To use the Centimate API, follow these steps:
- Signup: Register a new user via
/auth/signup. - Login: Obtain an authentication token via
/auth/login. - Authenticate: Include the token in your requests as a Bearer Token.
- Access Endpoints: Use the available endpoints to manage expenses.
For detailed API endpoint information, refer to the API Documentation.
Run the following command to execute tests:
make testTo stop the services:
make stopTo stop and remove all containers, volumes, and networks:
make cleanTrade-offs
❌ Expenses are not user-specific -- All users can see all expenses.
✅ Solution: Associate expenses with a user so each user only sees their own expenses.
❌ Tests are incomplete and failing -- The failures are due to a configuration issue, not a logic error.
✅ Solution: Debug the test setup to ensure proper execution.
❌ Users cannot create categories -- Categories are predefined and cannot be customized.
✅ Solution: Allow users to create and manage their own categories.
❌ No logout endpoint -- There's no way to invalidate a user's session.
✅ Solution: Add a logout endpoint to properly handle session termination.
❌ Expense DTO includes unnecessary details -- The DTO returns notes in list views, making responses larger than necessary.
✅ Solution: Use a shorter DTO for lists and include notes only in detailed views.
Future Improvements
Total Spending API -- Add an endpoint to calculate total spending over a selected period.
Expense Visualization -- Implement charts to display spending trends and insights.
Budgeting Feature -- Introduce a class to set budget limits, helping users track and manage expenses within predefined limits.