How shabarish2311/webmedicalmanagement works
Project Type and Purpose
• This is a full-stack web application: a pharmacy management system (“Web Medical Management System”) built with Java Servlets/JSP on the server side, a MySQL relational database, and HTML/CSS/Javascript on the client side.
• Purpose: Manage medicine inventory, pharmacists, billing, and generate sales/inventory reports with dynamic charts.
File Structure Analysis
• Top level:
• src/main/java – Java packages:
– DBUtility (DBConnection.java)
– dao (DAO interfaces for Bill, BillItem, Medicine, Sales, User)
– daoImpl (concrete implementations of the DAOs)
– model (POJOs: Bill, BillItem, Medicine, Sale, User)
– servlets (controller layer: AddMedicineServlet, LoginServlet, GenerateBillServlet, etc.)
– test (Main.java)
• src/main/webapp – JSP views, static assets (CSS, JS), WEB-INF (web.xml, libraries).
• build/classes – compiled classes mirror src structure.
• Key external libraries under WEB-INF/lib: MySQL Connector, iText (PDF generation), JFreeChart (charts), supporting libs.
README Insights
• Tech Stack reaffirmed (Java, JSP, Servlets, MySQL, HTML, CSS).
• Normalized MySQL schema for medicines, users, sales, bills.
• Dynamic analytics: top-selling medicines, trends, pharmacist contributions.
a. Main Components
1. Client Browser – JSP pages, CSS, JS
2. Web Server / Servlet Container – Java Servlets handle HTTP requests
3. Controller Layer – Servlets mapped in web.xml
4. Service/DAO Layer – DAO interfaces + implementations for persistence
5. Model Layer – Business entities (Medicine, User, Sale, Bill, BillItem)
6. Database – MySQL storing normalized tables
7. Reporting Engine – JFreeChart for chart generation; iText for PDF export
b. Relationships & Data Flow
• User interacts with JSP → submits form to a Servlet
• Servlet invokes DAO → Model objects → DB
• DAO returns model instances → Servlet forwards to JSP for view
• Reporting Servlets fetch data, hand off to JFreeChart/iText libraries → generate charts/PDF → return to client
c. Architectural Patterns & Principles
• MVC-style separation: JSP (View), Servlets (Controller), DAOs/Models (Model)
• Layered architecture: Presentation → Controller → Service/DAO → Data source
• Dependency inversion: DAOs referenced via interfaces (BillDAO, MedicineDAO, etc.)
• Single responsibility: Each servlet handles one use case (login, generate bill, update stock).
d. Key Technologies & Frameworks
• Java Servlets/JSP – request handling and view rendering
• MySQL – data persistence
• JDBC via DAO layer – data access
• JFreeChart – dynamic charting
• iText – PDF generation
• JavaScript/CSS – client-side interactivity and styling
Detail
• Schema grouping: Medicines, Users, Sales, Bills tables under the DB.
• DBConnection utility as the entry point for all JDBC connections.
• Don’t overcrowd: group similar components but list all five DAO pairs and model classes.