This application automates the setup of a Finerac by using a simple utility that uploads Excel template files to a Fineract API instance to initialize a microfinance system. It's designed to be easy to understand and maintain, with clear separation of concerns.
The application follows a clean, service-oriented architecture:
- Main entry point that implements CommandLineRunner
- Coordinates the overall process of uploading template files
- Handles application lifecycle (graceful shutdown)
- Tracks success/failure counts and reports results
- Maps template files to their corresponding API endpoints
- Manages the list of templates to be processed
- Coordinates the template processing workflow
- Loads template files directly from the classpath
- Validates Excel files using Apache POI
- Converts Excel files to proper XLS format when needed
- Handles all communication with the Fineract API
- Manages authentication and request headers
- Implements retry logic for resilient API communication
- Handles different types of HTTP errors appropriately
-
Ensure your Fineract instance is running
-
Configure the application.yml with your Fineract API details
-
Run the application:
java -jar target/microfinance-init-1.0-SNAPSHOT.jar
The application will automatically upload all template files to initialize your Fineract instance.