How xlisden/sistemadegestiondocumentaria works
1. What this repository is
- A Java Swing desktop application for document management (“Sistema de Gestión Documentaria”).
- It is built as a layered monolith: UI forms on top, service/repository layers in the middle, and JPA/Hibernate persistence at the bottom.
2. Startup and application shell
- The main entry points are Main.java and SistemaDeGestionDocumentaria.java, with additional frame classes like NewJFrame.java.
- The UI is a traditional desktop shell, not a web frontend: forms, tabs, drawers, login screen, and modal-style panels.
3. UI layer
- All user interaction lives under ui/raven.
- Major UI pieces include:
- login/Login.java
- form/FormDocumentos.java, FormOficios.java, FormTipoDocumento.java
- tabbed/* for tab container behavior
- drawer/MyDrawerBuilder.java for navigation
- The presence of .form files indicates the UI was built with NetBeans GUI Builder.
4. Document-centered domain model
- The core domain is organized around document workflows.
- Main entities include Documento, Oficio, Memorandum, ActaSustentacionTesis, Sustentacion, Expediente, Persona, Administrativo, TipoDocumento, Estado, and supporting detail entities.
- DocumentoDto and DocumentoAtributos suggest some UI-friendly projection or data-transfer shaping on top of the persisted entities.
5. Business/service layer
- The service package provides the application’s business façade.
- Each major entity or workflow has a corresponding service class, such as DocumentoService, OficioService, MemorandumService, ExpedienteService, PersonaService, and TipoDocumentoService.
- This layer is where validation, orchestration, and document-specific rules are likely centralized before persistence.
6. Repository/persistence layer
- The repository package is the data-access boundary.
- There is a generic Repository base plus entity-specific repositories like DocumentoRepository, PersonaRepository, ExpedienteRepository, OficioRepository, etc.
- This layer isolates JPA/Hibernate operations from the service and UI layers.
7. Database and ORM configuration
- Persistence is configured through src/main/resources/META-INF/persistence.xml.
- config/HibernateConfig.java indicates Hibernate is used as the ORM/bootstrap layer.
- The README identifies the database as SistemaDeGestionDocumentaria, so the app depends on an external relational database for runtime state.
8. Validation boundary
- Input checks are separated into validations/Validation.java and ValidationException.java.
- This suggests validation is treated as a cross-cutting concern between forms and services, rather than being embedded directly in UI code.
9. UI support libraries
- The repo vendors several Swing UI libraries under libs/raven, including:
- swing-toast-notifications
- swing-glasspane-popup
- swing-crazy-panel
- datechooser-swing
- raven-bean-pack
- These are not backend dependencies; they shape the desktop UX with toasts, popups, date pickers, and custom panels.
10. Theming and static assets
- src/main/resources/Tema contains FlatLaf theme property files for dark, light, and default styling.
- Icons and Imagenes are bundled assets used by the Swing UI.
11. Primary data flow
- User action in a form → UI component builds/loads a domain object → service applies rules/validation → repository persists or queries via Hibernate → database responds → service returns results to the UI for display.
- This is the key architectural flow to show in a diagram.
12. Overall boundary map
- Presentation boundary: ui/raven, Main, NewJFrame
- Application/business boundary: service, validations
- Persistence boundary: repository, config/HibernateConfig, persistence.xml
- Domain boundary: entity
- External dependencies: relational database, vendored Swing libraries, theme/assets
Main entry points: DocumentoService.java Services · FormDocumentos.java Document forms · MyDrawerBuilder.java Drawer nav · Repository.java Repositories
Components 17
Presentation
Desktop shell and Swing forms
- App shell · Desktop application entry and frame bootstrap
src/main/java/com/unu/sistemadegestiondocumentaria/Main.java - Login · Authentication and first-screen access
src/main/java/com/unu/sistemadegestiondocumentaria/ui/raven/login/Login.java - Document forms · Main document CRUD screens
src/main/java/com/unu/sistemadegestiondocumentaria/ui/raven/form/FormDocumentos.java - Oficio form · Oficio-specific workspace
src/main/java/com/unu/sistemadegestiondocumentaria/ui/raven/form/FormOficios.java - Tipo form · Document type management screen
src/main/java/com/unu/sistemadegestiondocumentaria/ui/raven/form/FormTipoDocumento.java - Drawer nav · Sidebar navigation builder
src/main/java/com/unu/sistemadegestiondocumentaria/ui/raven/drawer/MyDrawerBuilder.java - Tabbed shell · Tabbed desktop workspace coordination
src/main/java/com/unu/sistemadegestiondocumentaria/ui/raven/tabbed/WindowsTabbed.java
Application
Services and validation
- Services · Orchestrates document workflows and use cases
src/main/java/com/unu/sistemadegestiondocumentaria/service/DocumentoService.java - Validation · Shared input and rule checks
src/main/java/com/unu/sistemadegestiondocumentaria/validations/Validation.java
Persistence
Repositories and ORM setup
- Repositories · JPA repository boundary for entities
src/main/java/com/unu/sistemadegestiondocumentaria/repository/Repository.java - Hibernate · JPA/Hibernate bootstrap and persistence unit config
src/main/java/com/unu/sistemadegestiondocumentaria/config/HibernateConfig.java - Database · External relational database used at runtime
src/main/resources/META-INF/persistence.xml
Domain
Entities and document model
- Documents · Core document entities and workflow variants
src/main/java/com/unu/sistemadegestiondocumentaria/entity/Documento.java - People & refs · Person, staff, status, and lookup entities
src/main/java/com/unu/sistemadegestiondocumentaria/entity/Persona.java - DTO model · UI-facing document projections and attribute shaping
src/main/java/com/unu/sistemadegestiondocumentaria/entity/DocumentoDto.java
Support
Bundled UI libraries and static resources
- Themes & assets · FlatLaf themes, icons, and images
src/main/resources/Tema/FlatDarkLaf.properties - Swing libs · Bundled Swing UI libraries for toasts, popups, panels, and date picking
libs/raven/toast/swing-toast-notifications/1.0.1/swing-toast-notifications-1.0.1.jar
Connections 21
- App shell → Login: opens · Application starts in the login/UI shell
- App shell → Tabbed shell: hosts · Main frame hosts the tabbed workspace
- Tabbed shell → Drawer nav: navigates · Drawer controls access to module screens
- Drawer nav → Document forms: opens · Navigation routes to document management screens
- Drawer nav → Oficio form: opens · Navigation routes to oficio workflow screens
- Drawer nav → Tipo form: opens · Navigation routes to type management screens
- Document forms → Services: uses · Forms delegate document actions to services
- Oficio form → Services: uses · Oficio UI calls application services
- Tipo form → Services: uses · Type screens use service layer operations
- Login → Validation: checks · Login and form inputs are validated before actions
- Document forms → Validation: checks · Document inputs pass through shared validation
- Services → Documents: coordinates · Business rules operate on document entities
- Services → People & refs: coordinates · Services manage people, status, and reference data
- Services → DTO model: projects · Services expose UI-friendly document views
- Services → Repositories: persists via · Services call repository boundary for CRUD and queries
- Repositories → Hibernate: uses · Repositories rely on JPA/Hibernate bootstrap
- Hibernate → Database: connects to · Persistence unit connects to the relational database
- Documents → Repositories: stored by · Document entities are persisted through repositories
- People & refs → Repositories: stored by · Reference entities are persisted through repositories
- Document forms → Swing libs: renders with · UI uses vendored Swing libraries for enhanced interaction
- Tabbed shell → Themes & assets: skins with · Tabbed desktop UI uses bundled themes and graphics