How nicomargo/centroeducativodew works
Project type and purpose
• This is a full-stack Java EE web application (“centroEducativoDEW”) for managing educational center data (students, courses, professors).
• The UI is rendered with JSPs and static assets (CSS/JS), the server uses Servlets + Filters, business logic in a service layer, and it calls an external “Centro” service via HTTP.
File structure
• Top level:
• scriptCragarDatosLanzaAplicacion.sh – helper script to load data and launch the app
• README.md – minimal project description
• cucu – (ignore or legacy file)
• NOL/ – the Eclipse-based webapp project root
• Under NOL/src/main/java/dew:
• filter/ – servlet filters (authentication, logging, debug)
• main/ – Servlet controllers (AlumnoServlet, AsignaturaServlet)
• service/ – business services (AlumnoService, AsignaturaService, CentroClient)
• helper/ – utilities (InputValidator)
• models/ – domain objects (Alumno, Asignatura, Profesor, AuthResult)
• Under NOL/src/main/webapp:
• WEB-INF/web.xml and credentials.properties – deployment/configuration
• WEB-INF/jsp – error pages
• jsp folders (alumno, asignatura) and top-level JSPs (login.jsp, index.jsp)
• static assets: css/, js/, img/, includes/
README
• Very brief: “Trabajo final centro educativo … Desarrollo Web.”
Main components
a. Presentation Layer
• Client Browser (HTML/CSS/JS)
• Static assets served by the container
b. Web Layer (Deployed in a Servlet container like Tomcat)
• Servlet Container / Web Server
• Filter Chain:
• DataAuthFilter (authorization)
• DebugFilter (debug logging)
• LogsFilter (request/response logging)
• Controllers: AlumnoServlet, AsignaturaServlet
• web.xml & credentials.properties (configuration)
c. Business Layer
• Service classes: AlumnoService, AsignaturaService
• Helper: InputValidator
d. Integration Layer
• CentroClient – HTTP client calling external Centro Educativo API
• Dependencies: Apache HttpClient, Gson for JSON binding, RxJava for reactive streams
e. Data/External Services
• External “Centro” REST API (authentication & data provider)
• No local database – relies on external service
Interactions and data flow
1. User sends HTTP request from browser → Web Server
2. Request passes through Filters in order → Filters perform auth, debug, logging
3. Filter forwards to corresponding Servlet (based on URL mapping)
4. Servlet validates input (InputValidator), invokes Service layer
5. Service calls CentroClient → makes REST HTTP call → receives JSON → parses with Gson → returns domain models
6. Service returns data/model to Servlet → Servlet selects JSP view → populates JSP with model → JSP renders HTML
7. Response travels back through Filters (for any post-processing logs) → delivered to browser
Architectural patterns & design principles
• MVC (Model-View-Controller):
• Controller = Servlets
• View = JSP + static resources
• Model = domain objects + service results
• Filter Chain for cross-cutting concerns (auth, logging, debug)
• Layered Architecture: clear separation between presentation, business, integration
• Use of Reactive Streams (RxJava) in HTTP client for non-blocking calls (if leveraged)
Be detailed
• Every filter in the chain
• Sequence of calls from Servlet → Service → CentroClient → External API
• Don’t omit any top-level lib or folder that plays a role in runtime (e.g., lib/*.jar)