The application “Expense tracking” can be used by users in order to track personal finance situation: expenses and income, as well operations across various accounts (bank cards, cash etc.)
The target audience of this project are people who want to track their expenses and income and have an overview of the current financial situation. They are not satisfied by existing solutions and want to have more clear and user-friendly interface and synchronization between different devices (web, mobile). The usage of the project provides following of benefits: operations are categorized and recorded in a clear manner; different reports are generated to present an actual situation etc.
From a domain driven design perspective, the application is divided into 4 core domains: Users, Payment accounts, Categories, Operations.
The application is a standard Java application that is packaged as fat jar and therefore can run on any environment where you can install Java (local, popular PaaS solutions, any cloud server).
System requirements are:
- Java JDK v.21+
- PostgreSQL server v.16+
This section describes how to run application using the development configuration (for local testing) and the production configuration
In order to quickly run the application locally:
- Create the PostgreSQL database
- Database name
expense_tracking
- Username
expense_tracking
- Password:
secret
- Database name
- Open terminal and navigate to the root folder of the project
- Run Maven to generate a fat jar
- If you have a local Maven installation:
mvn clean install
- If you do not have a local Maven installation:
./mvnw clean install
- If you have a local Maven installation:
- Run the fat jar
java -jar target/expense-tracking-0.0.1-SNAPSHOT.jar
- Open your browser and navigate to
http://localhost:8080
The previous section shows how to quickly get the application up and running. If you want to run the application in production mode (for example, deploy it to the VPS), you need to run the prod
profile.
In order to do this please first set following environment variables:
DATABASE_URL
= the jdbc url to the PostgreSQL databaseDATABASE_USER
= the database usernameDATABASE_PASSWORD
= the database passwordFLYWAY_USER
= the username used by Flyway to run migrationsFLYWAY_SECRET
= the password used by Flyway to run migrationsHTTP_PORT
= the HTTP port number for the application server
Once all these values are provided, the same sequence of steps applies:
- Navigate to the root folder for the project
- Run Maven to generate a fat jar
- If you have a local Maven installation:
mvn clean install
- If you do not have a local Maven installation:
./mvnw clean install
- If you have a local Maven installation:
- Run the fat jar
java -Dspring.profiles.active=prod -jar target/expense-tracking-0.0.1-SNAPSHOT.jar
- Open your browser and navigate to
http://localhost:{YourPortNumber}
The application comes with some mock data that you can use. There are 5 mock users that have some data populated (such as accounts and operations). All data was created using FakeNameGenerator.com and Email Generator websites and these are users are not real people!
Test data is integrated into the project using migrations. This means that you do not need to complete any additional steps in order to import it! Just use any of these email accounts to log in to the app:
All users have the password secret1234
.
If you do not use any mock data to be imported, just remove the src/main/resources/db/migration/V2__testdata.sql
file before running the application against the database.
(C) 2024 Iurii Mednikov [email protected]
The code is delivered under terms of the MIT software license. For more information, check the LICENSE.txt
file.