How ricardomolinacoronel/prueba-tecnica-tia-is works
Project Overview and Purpose
• This is a technical test project (“Prueba tecnica TIA S.A”) implemented in Java using Spring Boot for the backend, Maven for dependency/build management, and Swing for the graphical user interface (GUI).
• There is an SQL schema file (inteligencia_militar_schema.sql) indicating the database structure, and an external Python script (in the script directory) that interacts with the Java application (via HTTP calls) to perform specific tasks (likely reading an “Enemigos.txt” file and triggering processes at runtime).
• This is essentially a full-stack (backend and desktop GUI) application that also demonstrates integration with external scripts.
Main Components & Layers
A. Java Spring Boot Application:
• Spring Boot Server: The central server runs on port 8081 (as noted in the README) and hosts the core business logic.
• MVC Layers:
• Controller Layer: Contains classes like EnemigosController and TropasController that handle HTTP requests and possibly Swing GUI events.
• Service Layer: Example is ReporteService which processes business logic.
• Repository Layer: Classes like PotenciaRepository and TropasRepository, which encapsulate persistence logic against a database.
• Model Layer: Domain classes (Potencia, Tropas) that represent the data.
• Utility and Integration:
• ExcelGenerator for generating report files.
• AppContextProvider for potential dependency management or application configuration.
B. User Interface (GUI):
• Swing-Based UI: Found in the “ui” package (MainUI and its corresponding form file). This provides the graphical interface that the user interacts with.
C. Database:
• Persistence Store: The SQL schema file and the application.properties (within the resources) indicate a relational database. The project uses Spring Data (via the Repository layer) for persistence.
D. External Components:
• Python Script: In the “script” directory, the script_peticiones.py (backed by requirements.txt and .env file) is designed to make HTTP requests to the Java application likely to trigger certain functionalities (such as reading data from a text file from the user’s Downloads/Descargas folder).
Relationships and Interactions
• The Java application (backend) exposes endpoints handled by controllers for data requests from both the Swing GUI and external API calls (e.g., from the Python script).
• The controllers call the service layer to process business logic before retrieving or persisting data with repository classes.
• The service layer may also make use of utilities (like ExcelGenerator) to formulate report outputs.
• The external Python script interacts with the Java application over HTTP (using pre-configured port 8081) to potentially trigger operations or fetch reports.
• Configuration files (.env and application.properties) are used to configure environment variables and DB connections respectively.
Architectural Patterns and Technologies
• MVC Pattern: Clearly visible in the separation between controllers, services, and repositories (typical in Spring Boot applications).
• Layered Architecture: The project cleanly separates UI, business logic, data access, and configuration.
• Integration of Desktop and Web: Unique aspect here is the use of a Swing-based GUI within a Spring Boot context alongside REST controllers.
• Technologies: Java JDK 17, Spring Boot, Maven, Swing, and a relational database (SQL); plus Python for external scripting.