How vulnx1/hospital works
Project type and purpose
• This is a full-stack Hospital Management System:
• Frontend: React SPA (with Tailwind CSS) under frontend/.
• Backend: Spring Boot monolith under src/main/java/com/hospital/.
• Database layer: MySQL (or H2 for dev) via Spring Data JPA.
• External service: OpenAI GPT-3.5 for AI chatbot.
• Purpose: manage users (Admin/Doctor/Patient), appointments, records, prescriptions, inventory, billing, plus chat assistant.
File structure
• Top-level directories:
• frontend/: React code, components, pages, contexts, hooks, services.
• src/main/java/com/hospital/: backend MVC layers:
– config/: security & WebSocket config
– controller/: REST/WebSocket endpoints
– dto/: request/response models
– entity/: JPA entities
– repository/: Spring Data repositories
– service/: business logic, including OpenAIService
– service/impl/: service implementations
• src/main/resources/: application props, SQL scripts, static assets, templates
• pom.xml & Maven wrapper: build orchestration
• .gitignore, .gitattributes: version control rules
Insights from README
• Layered architecture with role-based auth (JWT planned)
• APIs for each domain (Auth, Doctors, Patients, Appointments, Billing, Inventory, MedicalRecords, Chat)
• Uses HTTP REST + WebSockets for real-time chat
• Centralized exception handling (@ControllerAdvice)
• Technology stack: Java 17, Spring Boot, Spring Security, Spring Data JPA, MySQL/H2, React, Tailwind, OpenAI API
Detail
• Two distinct communication channels: REST (synchronous) vs WebSocket (real-time chat)
• How the OpenAIService sits inside your service layer and bridges to the external API