This application monitors a directory for USSD event files and loads them into a PostgreSQL database.
- Java 21
- Docker and Docker Compose (Optional)
- IntelliJ IDEA or VS Code with Spring Boot plugins/extensions
git clone https://github.com/Phinart98/file-loader-service.git
cd file-loader-service
docker-compose up -d
This starts:
- PostgreSQL database on port 5432
- pgAdmin web interface on http://localhost:5050
The application is configured to monitor a specific directory for new files. You have two options:
- Create directories for input and processed files:
mkdir -p C:/ussd/input C:/ussd/processed
- Copy sample files to the input directory:
cp sample-data/input/* C:/ussd/input/
Edit src/main/resources/application.properties
to set your preferred directories:
file.monitoring.directory=YOUR_INPUT_DIRECTORY_PATH
file.monitoring.processed-directory=YOUR_PROCESSED_DIRECTORY_PATH
Open the project in your IDE (IntelliJ IDEA or VS Code) and run the application directly.
The application will:
- Connect to the PostgreSQL database
- Monitor the configured directory for new files
- Process files and load records into the database
- Open http://localhost:5050 in your browser
- Login with:
- Email: admin@admin.com
- Password: admin
- Create a new server connection:
- Name: Any name you want
- Host: localhost (or postgres if inside Docker network)
- Port: 5432
- Username: postgres
- Password: postgres
Place USSD log files in the directory configured in application.properties
(default: C:/ussd/input).
When finished:
docker-compose down
If you prefer to run the application directly:
- Start a PostgreSQL database.
- Update
application.properties
with your database connection details - Run the application directly from your IDE:
- In IntelliJ: Click the Run button
- In VS Code: Use the Spring Boot Dashboard to run the application
Key settings in application.properties
:
file.monitoring.directory
: Directory to monitor for new filesfile.monitoring.processed-directory
: Directory for processed filesfile.monitoring.interval
: Polling interval in milliseconds (default: 60000)