Moneybag is a tool for managing personal finances that allows users to create and categorize records, analyze income and expenses, and manage multiple accounts.
The backend was written in Java using the Spring framework and uses a MySql database for data persistence. The frontend is a single-page application connected via REST API and built with TypeScript, Vue.js, and Vuetify.
I created this project for several reasons. Firstly, I wanted to experiment with various technologies. Secondly, I aimed to experience all stages of the software development cycle. Additionally, I intended to add work to my portfolio that would demonstrate my development skills.
To begin, I made a list of the necessary features and selected the appropriate technologies, and then started developing the backend server.
I developed the backend in Java and Spring framework and chose the MySql database for data persistence. The application utilizes the MVC architecture. The database runs in a Docker container. Authentication and authorization are provided by JWT token using Spring Security. The API generates Open Api documentation automatically. Additionally, I created documentation for the API using Postman, which includes example requests and responses.
- Multiple financial accounts
- Add records and categorize them
- Analytic of categories, incomes, expenses, cash flow...
- Charts
- Responsive web interface
During the development, I encountered some issues. One of them was adding filtering and sorting parameters to the "get all records" endpoint. To solve this problem, I used the specification-arg-resolver library which can map request parameters to Jpa specifications and extended the record repository by PagingAndSortingRepository, and JpaSpecificationExecutor.
I originally planned to create a much smaller project but finished with a larger one. I gained new knowledge during development - for instance, how to elegantly add filtering parameters to the API endpoint or use JPQL for more complex database queries. So, I am satisfied with the result of my work.
- Java 17
- Docker, Docker compose
git clone https://github.com/babakjan/Moneybag-BE.git
cd Moneybag-BE/
docker compose up -d
-
Set the development environment. The app will connect to the local database.
export spring_profiles_active=dev
-
Create database schema - open
./src/main/resources/application.yml
set the value ofspring.jpa.hibernate.ddl-auto
tocreate
. -
Run the app (app will run on http://localhost:8000/api)
./mvnw spring-boot:run
-
If you want to initiate the database with test data, stop the app and undo the changes you've done in the application properties file (set
create
tonone
), plus make sure, that thespring.sql.init.mode
has valuealways
. -
run the app again
./mvnw spring-boot:run
-
If you want to run the app repeatedly, change the previously added
always
tonever
line because you don't want to insert test data every time you restart the app. -
Swagger documentation of running app can be found at http://localhost:8000/api/swagger-ui/index.html