- Application Description
- User Roles
- App Usage Instructions
- Repository Structure
- System Architecture
- System Requirements
- Software Patterns
- Algorithms
- Installation
- Running the Application
- API Documentation
- Repository Statistics
- Contribution
- License
Government budget management system that allows different types of users to view, manage, and approve changes to the national budget.
SaveTheGovernment is a graphical application that manages the government budget.Includes data for budgets from year 2019 till 2026. The application supports multiple user types with different access rights and allows:
- Viewing the overall budget
- Viewing the change history
- Viewing statistics (distribution comparisons and time trend analysis, while estimating their future trajectory.)
- Managing budget items
- Submitting change requests
- Approving or rejecting change requests
- Recording all changes in a change log
The application supports four types of users with different access rights:
- View the overall budget
- View the change history
- View statistics
- Update personal information (username, password, name)
Includes all Citizen permissions, plus:
- Submit requests for budget fund modifications
- View the history of change requests
Includes all Government Member permissions, plus:
- Directly manage budget items
- View the overall budget
- View the change history
- View statistics
- Approve or reject pending change requests
Note: Only one Prime Minister can exist in the system (Singleton pattern).
- Register with your credentials and select your role (Citizen, GovernmentMember, PrimeMinister).
- Log in to an existing account. For convenience, the following accounts are already available:
- Citizen: username: lakis, password: Lakis123!
- GovMember (Finance Ministry): username: kammenos, password: Kammenos123!
- PrimeMinister: username: mitsotakis, password: Mitsotakis123!
- You can navigate the application using the sidebar.
- Remember that the application's features update dynamically depending on the user role.
- Select View Total budget from the sidebar
- Click on year and select a year to display the budget for that specific year. (default year: 2026)
- Click the button that appears at the top right to filter the budget table in various ways.
- After logging in exclusively as Finance Minister.
- Select View Total budget from the sidebar.
- Click edit on the budget item of your choice.
- Enter the new amount and click save to confirm your change.
- After logging in as a Government Member.
- Select View Pending Changes from the sidebar.
- Select Create New Request to request an amount change for a budget item in your ministry.
- Select My Requests to view only your own pending requests.
- Table filtering capability for pending changes is supported.
- Select View Statistics from the sidebar.
- Select the year for which you want to view statistics. Years 2019 - 2026 are supported with 2026 as default.
- Select the Budget Results category to view charts related to the overall budget picture. This category includes 4 charts.
- Select the Top Items category to view charts related to the most significant budget items. This category includes 6 charts.
- Select the buttons that appear in the corners of the charts to interact with them.
- Select View Change History to view the budget change log history.
- Filtering is supported for Change Log table.
- After logging in exclusively as Prime Minister.
- Select Manage Pending Changes
- Click the Approve button to approve the specific change. Click OK to confirm your selection.
- Click the Reject button to reject the specific change. Click OK to confirm your selection.
- Filtering is supported for Pending Changes table.
-
src/main/java/budget/- Main application source codebackend/- Backend logic and business layermodel/- Data models and entitiesservice/- Business logic servicesrepository/- Data access layerexceptions/- Custom exception classesutil/- Backend utility classes (validation, password hashing, paths, Regression Analysis)
frontend/- JavaFX GUIcontroller/- JavaFX controllers managing user interface interactions and screen navigationutil/- Frontend helper classes (charts, alerts, tables, window management)
constants/- Application constants and messages
-
src/test/java/budget/- Test suitebackend/- Backend unit testsmodel/- Tests for domain models and enumsservice/- Tests for business logic servicesrepository/- Tests for data access layerutil/- Tests for utility classes
frontend/- Frontend testsutil/- Tests for UI helper classes
constants/- Tests for application constants
-
src/main/resources/- Application resourcesview/- JavaFX layout filesimages/- Image assetsstyles/- CSS stylesusers.json- User data storagebill-ministry-map.json- Budget item to ministry mappingsbudget-changes.json- Approved changes historybudget.json- State budget data (2019-2026)pending-changes.json- Pending change requests
-
diagram/- UML diagrams and documentationclassDiagram.svg- Class diagram visualizationcontrollersDiagram.svg- Controllers diagram
-
pom.xml- Maven project configuration
Below is the class diagram that describes the structure of the backend and the organization of the packages.
π Diagram Source Code: File preview PlantUML
The following is the class diagram for the budget.frontend.controller package.
- The inheritance hierarchy of the Dashboards (Citizen, GovernmentMember, PrimeMinister) derived from the base DashboardController.
- The Navigation Flow from the Login screen to the corresponding application screens.
- The Dependencies, representing which controllers are dynamically loaded within the main Dashboards
π Diagram Source Code: View PlantUML file
- Java: Version 21 or latest
- Maven: Version 3.9.6 or latests
- Operating System: Windows, macOS, or Linux
- Singleton pattern: It is used for uniqueness Prime Minister
- DI (Dependency Injection): It is mainly used in the communication of the Services <-> Repositories
- Repository Design Pattern: For clear separation of data and business logic
- MVC Architecture (Model View Controller): For efficient management of the GUI
- Generic Programming: Type-safe repository interface
GenericInterfaceRepository<T, ID>allows flexible entity handling
- Type-Safe Enum Pattern: Enums with additional properties
UserRole,Ministry,Statusenums with display names and descriptions
- SHA-256: Cryptographic hashing algorithm for secure password storage in users.json
- Implemented in
PasswordUtils.java - Provides one-way encryption for user authentication
- Implemented in
- Linear Regression: Custom implementation for trend forecasting and budget prediction
- Implemented in
Regression.java - Calculates slope and intercept using least squares method
- Used for predicting future budget trends in statistics charts
- Implemented in
- Regular Expressions (Regex): Pattern matching for input validation
- Username validation: Alphanumeric characters and underscores
- Password strength: Minimum 8 characters, uppercase, lowercase, digits, special characters
- Full name validation: Latin characters, proper capitalization
- UUID format validation
- Implemented in
InputValidator.java
-
Filtering & Sorting: Dynamic table data manipulation
- Used in budget tables, pending changes, and change history views
- Supports multi-criteria filtering
-
Stream Processing: Java 8 Streams for efficient data aggregation
- Statistical calculations (sum, average, min, max)
- Budget item grouping by ministry
- Implemented across service layer
- JSON Parsing: Data serialization/deserialization with Gson library
- ArrayList/List: Sequential storage for entities (budgets, users, pending changes, logs)
- HashMap/Map<K,V>: Key-value pairs for bill-ministry mappings
- ObservableList: JavaFX observable collections for auto-updating UI tables and charts
- FilteredList: Dynamic table filtering with predicates
- Optional: Null-safe wrappers for repository operations
- Stream API: Functional data processing pipelines for filtering, mapping, and aggregation
- XYChart.Series/Data: Time-series structures for statistical charts and regression analysis
- PieChart.Data: Sectional data for budget distribution visualization
- synchronized blocks: Thread-safe access for concurrent file operations
git clone https://github.com/detandreas/SaveTheGoverment.git
cd SaveTheGovermentMake sure that you have installed Java 21 and Maven:
java -version # It should display the version 21
mvn -version # It should display the version 3.9.6 or latestmvn clean verify # Executes the full build lifecycle:
# - Runs all unit tests
# - Generates JaCoCo code coverage reports
# - Runs Checkstyle code quality checks
# - Generates project documentation
# - Compiles source files
./mvnw clean verifymvn test
./mvnw testmvn javafx:run # If you have Maven installed on your computer./mvnw javafx:run # Linux/macOS
mvnw.cmd javafx:run # WindowsThe project uses standard Javadoc comments for documenting its public API.
To generate the API documentation, run:
./mvnw javadoc:javadocopen target/site/apidocs/index.html - Total Lines: 20,696
- Code Lines: 14,874
- Pure Java: 11,025 lines
- java classes 92
- Backend Coverage: 97%
- Test Classes: 30
- tests run: 382
- Commits: ~800
- Contributors: 8
This application was developed as an assignment for the course PROGRAMMING II in the Department of Management Science and Technology in AUEB.
This project is licensed under the Apache License 2.0.
π See LICENSE for full details or visit the official Apache License page.