From ef7462837dcd483ddbafe465df0e0b8874b4c81f Mon Sep 17 00:00:00 2001 From: John Ahlroos Date: Mon, 3 Nov 2025 18:27:44 +0100 Subject: [PATCH] Added schema architecture for Smart Clinic --- .../schema-architecture.md | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 SmartClinicManagementSystem/schema-architecture.md diff --git a/SmartClinicManagementSystem/schema-architecture.md b/SmartClinicManagementSystem/schema-architecture.md new file mode 100644 index 0000000..3ecca9b --- /dev/null +++ b/SmartClinicManagementSystem/schema-architecture.md @@ -0,0 +1,24 @@ +# Architecture summary + +This Spring Boot application uses both MVC and REST controllers. + +Thymeleaf templates are used for the Admin and Doctor dashboards, while REST APIs serve all other modules. + +The application interacts with two databases—MySQL (for patient, doctor, appointment, and admin data) and MongoDB (for prescriptions). + +All controllers route requests through a common service layer, which in turn delegates to the appropriate repositories. MySQL uses JPA entities while MongoDB uses document models. + +# Numbered flow of data and control + +1. User accesses AdminDashboard or Appointment pages. +2. The action is routed to the appropriate Thymeleaf or REST controller. +3. The controller calls the service layer to fetch data to display or execute a user initiated operation +4. The service layer deduces what data is required for the business logic and either accesses the MySQL repositories or + MongoDB repositories as needed. +5. Both the Mysql and MongDB repositories translate the data JPA queries to database queries (SQL for + MySQL, and NOSQL for MongoDB) and executes them as database transactions on the actual databases using the database + drivers +6. The database queries are executed on the entity models defined for the databases and the data is retrieved from + the database +7. Finally, the data traverses back up via each layer up to either the Thymleaf template where it is rendered as + HTML or to the REST Controller where the data is served as JSON. \ No newline at end of file