How bahri-adem/application-web-des-patients works
Project Type and Purpose
• This is a full-stack Java EE web application (“Application web qui centralise les données des patients”) built on Tomcat using Servlets/JSP (MVC), DAO pattern, a MySQL database, and front-end assets (HTML/CSS/JS/Bootstrap).
• Its goal is to centralize patient data and facilitate interactions among doctors, patients, pharmacies, laboratories, radiology centers, and clinics.
File-Structure Analysis
• Top-level:
• src/main/webapp: JSP pages, CSS, JS, images → presentation layer (UI)
• src/main/java/com/servelt: Servlets → controller layer
• src/main/java/com/DAO: DAO & Service classes → business & persistence layers
• src/main/java/com/javaBeans: domain model (POJOs)
• database/database.sql: schema definition
• Tests in src/main/java/test: unit tests for services and DB config.
• Configuration: WEB-INF/web.xml, MySQL connector JAR.
• Build output under build/classes.
Architecture Overview
• Pattern: MVC + DAO (separation of concerns).
• Layers:
a. Presentation (JSP, CSS, JS)
b. Controller (Servlets)
c. Service/DAO (business logic, data access)
d. Database (MySQL)
• Data flow: User → JSP → Servlet → Service → DAO → MySQL DB → back up the chain.
Main Components and Relationships
a. Presentation Layer
• JSP pages (under webapp/) + CSS/JS libraries (Bootstrap, custom scripts).
• Served by Tomcat HTTP server.
b. Controller Layer
• com.servelt.* Servlets handle HTTP requests, invoke service methods, forward to JSPs.
c. Business & Persistence Layer
• Service classes (e.g., AppointmentService) implement business workflows.
• DAO classes (e.g., AppointmentDAO) handle CRUD against MySQL via JDBC.
• Domain JavaBeans map DB tables to Java objects.
d. Database
• MySQL containing tables for users, patients, consultations, radiographies, analyses, prescriptions, etc.
e. External/Infra
• Tomcat application server, MySQL server, optional Docker container.
Architectural Patterns & Principles
• MVC: JSP = View, Servlets = Controller, Service/DAO = Model.
• DAO Pattern: isolates JDBC code.
• Layered Architecture: clear separation between UI, control flow, business logic, and data.
• Dependency Injection is manual (Servlets instantiate Services/DAOs).
• JUnit tests for service and DB config validation.
Detailed Elements
• MySQL connector JAR in the WEB-INF/lib.
• Build/test artifacts (optional side note).