A comprehensive medical clinic management system built with Java and JavaFX
Features • Architecture • Installation • Usage • Documentation
- About
- Features
- Architecture
- Technologies
- Project Structure
- Installation
- Configuration
- Usage
- Documentation
- Contributing
- License
- Contact
Eye Clinic Management System is a comprehensive desktop application designed to streamline the operations of eye clinics and optometry practices. Built as an Object-Oriented Programming (OOP) project, this system provides a complete solution for managing patients, appointments, prescriptions, inventory, and financial operations.
The application follows modern software architecture principles with a clear separation between the presentation layer (JavaFX UI) and business logic layer (Mini-Boot backend), ensuring maintainability, scalability, and testability.
- Course: Object-Oriented Programming (OOP)
- Institution: Post and Telecommunications Institute of Technology (PTIT)
- Instructor: Nguyen Manh Son
- Academic Year: 2024-2025
- Team Members:
- Dương Trí Dũng
- Trần Văn Hậu
- Phan Minh Hiếu
- Nguyễn Minh Toàn
- Nguyễn Thành Trung
- 🔐 Multi-role Authentication System
- Admin, Doctor, Nurse, Customer
- Secure login with JWT token authentication
- Password encryption using SHA256
- 👥 Account Management
- User registration and profile management
- Password reset and change functionality
- Role-based access control (RBAC)
- 📝 Patient Records
- Comprehensive patient information management
- Medical history tracking
- Patient search and filtering
- 📅 Appointment System
- Schedule patient appointments
- Doctor availability management
- Time slot booking
- Appointment notifications
- 🔬 Examination Process
- Record examination results
- Prescription management
- Treatment history
- Medical reports generation
- 📦 Stock Management
- Medicine and equipment tracking
- Low stock alerts
- Expiry date monitoring
- ➕ Inventory Operations
- Add, edit, and delete inventory items
- Stock level adjustments
- Supplier management
- 📊 Reports
- Inventory status reports
- Usage statistics
- Export to Excel
- 🧾 Invoice Generation
- Automated invoice creation
- Service and medication billing
- Tax calculations
- 💳 Payment Processing
- Multiple payment methods
- Payment history tracking
- Receipt generation (PDF)
- 📈 Financial Reports
- Revenue reports
- Payment analytics
- Export to Excel and PDF
- 📉 Real-time Statistics
- Patient statistics
- Appointment metrics
- Revenue tracking
- 📅 Schedule Management
- Doctor schedules
- Working hours management
- Holiday and leave tracking
The system follows a modular multi-tier architecture with clear separation of concerns:
┌─────────────────────────────────────────┐
│ Presentation Layer │
│ (JavaFX UI - oop_ui module) │
│ - Controllers │
│ - FXML Views │
│ - CSS Styling │
└──────────────┬──────────────────────────┘
│
↓ REST API / Service Layer
┌──────────────────────────────────────────┐
│ Business Logic Layer │
│ (Mini-Boot - mini-boot module) │
│ - Services │
│ - Business Rules │
│ - Authentication & Authorization │
└──────────────┬───────────────────────────┘
│
↓ Data Access Layer
┌──────────────────────────────────────────┐
│ Database Layer │
│ (PostgreSQL / MS SQL) │
│ - Data Models │
│ - Repositories │
└──────────────────────────────────────────┘
- MVC (Model-View-Controller): Separation of UI and business logic
- Repository Pattern: Data access abstraction
- Service Layer Pattern: Business logic encapsulation
- Singleton Pattern: Database connection management
- Factory Pattern: Object creation
- Observer Pattern: Event handling in JavaFX
- JavaFX 21.0.2 - Modern desktop UI framework
- FXML - UI markup language
- CSS - Custom styling and themes
- ControlsFX 11.2.1 - Extended JavaFX controls
- Java 21 - Latest LTS version
- Custom Mini-Boot Framework - Lightweight backend framework
- JWT (java-jwt 4.4.0) - Authentication tokens
- BCrypt - Password hashing
- HikariCP 5.1.0 - High-performance connection pool
- PostgreSQL - Primary database (Supabase)
- MS SQL Server - Alternative database support
- Maven 3.8+ - Dependency management and build tool
- Gson 2.10.1 - JSON serialization
- Jackson 2.17.2 - JSON processing
- Apache POI 5.2.5 - Excel export functionality
- iText 7.2.5 - PDF generation
- Jakarta Mail 2.0.1 - Email functionality
- Log4j 2.20.0 - Logging framework
BTL_OOP/OOP/
├── 📄 pom.xml # Parent Maven configuration
├── 📄 README.md # This file
│
├── 📁 mini-boot/ # Backend module
│ ├── 📄 pom.xml # Backend dependencies
│ ├── 📄 Dockerfile # Docker configuration
│ ├── 📄 docker-compose.yml # Docker Compose setup
│ ├── 📄 application.properties.example
│ └── 📁 src/main/java/org/miniboot/
│ └── app/ # Backend application code
│
├── 📁 oop_ui/ # Frontend module (JavaFX)
│ ├── 📄 pom.xml # Frontend dependencies
│ ├── 📁 src/main/
│ │ ├── 📁 java/org/example/oop/
│ │ │ ├── 📁 Control/ # Controllers (MVC)
│ │ │ ├── 📁 Model/ # Data models
│ │ │ ├── 📁 Service/ # Service layer
│ │ │ ├── 📁 Utils/ # Utility classes
│ │ │ ├── 📁 config/ # Configuration
│ │ │ └── 📄 Main.java # Application entry point
│ │ │
│ │ └── 📁 resources/
│ │ ├── 📁 FXML/ # UI layouts
│ │ │ ├── Login.fxml
│ │ │ ├── Dashboard/
│ │ │ ├── Employee/
│ │ │ ├── Inventory/
│ │ │ └── PatientAndPrescription/
│ │ │
│ │ ├── 📁 css/ # Stylesheets
│ │ │ ├── global-styles.css
│ │ │ ├── dashboard.css
│ │ │ ├── forms.css
│ │ │ └── tables.css
│ │ │
│ │ ├── 📁 Image/ # Images and icons
│ │ └── 📄 error_messages.properties
│ │
│ └── 📁 data/ # Test data
│ └── ScheduleTestData/
│
└── 📁 UML/ # Documentation
├── 📁 Activity/ # Activity diagrams
├── 📁 Class/ # Class diagrams
├── 📁 Database/ # Database schema
├── 📁 Sequence/ # Sequence diagrams
│ ├── Account/
│ ├── Examination/
│ ├── Inventory/
│ └── Payment/
└── 📁 Usecase Diagram/ # Use case diagrams
Before you begin, ensure you have the following installed:
-
☕ Java Development Kit (JDK) 21 or higher
java -version # Should show version 21 or higher -
📦 Apache Maven 3.8+
mvn -version
-
🗄️ PostgreSQL 15+ (or MS SQL Server)
- Or use a cloud database service like Supabase
-
🔧 Git (optional, for cloning)
git clone https://github.com/Sagitoaz/BTL_OOP.gitOr download and extract the ZIP file.
Option A: Using Supabase (Recommended)
- Create a free account at Supabase
- Create a new project
- Navigate to SQL Editor and execute the schema from
UML/Database/database.dbml - Copy your database connection string
Option B: Using Local PostgreSQL
- Install PostgreSQL
- Create a new database:
CREATE DATABASE eye_clinic_db;
- Run the SQL schema provided in the UML/Database directory
- Navigate to
mini-boot/directory - Copy the example configuration:
cp application.properties.example application.properties
- Edit
application.propertieswith your database credentials:db.url=jdbc:postgresql://your-host:5432/your-database db.username=your-username db.password=your-password jwt.secret=your-secret-key
From the root directory:
mvn clean installThis will:
- Download all dependencies
- Compile both modules (mini-boot and oop_ui)
- Run tests
- Package the application
Option A: Using Maven
cd oop_ui
mvn javafx:runOption B: Using Executable JAR
cd oop_ui/target
java --module-path /path/to/javafx-sdk/lib --add-modules javafx.controls,javafx.fxml -jar oop_ui-1.0-SNAPSHOT.jarEdit mini-boot/application.properties:
# Database Configuration
db.url=jdbc:postgresql://localhost:5432/eye_clinic_db
db.username=postgres
db.password=your_password
db.driver=org.postgresql.Driver
# Connection Pool Settings
db.pool.maximumPoolSize=10
db.pool.minimumIdle=5
db.pool.connectionTimeout=30000
# JWT Configuration
jwt.secret=your-secret-key-change-this-in-production
jwt.expiration=86400000 # 24 hours in milliseconds
# Email Configuration (for password reset)
mail.smtp.host=smtp.gmail.com
mail.smtp.port=587
mail.username=your-email@gmail.com
mail.password=your-app-passwordFor production deployment, use environment variables instead of hardcoding:
export DB_URL=your-database-url
export DB_USERNAME=your-username
export DB_PASSWORD=your-password
export JWT_SECRET=your-secret-keyAfter initial setup, use these default credentials:
Admin Account:
- Username:
admin_account - Password:
admin_password
Doctor Account:
- Username:
doctor1 - Password:
doctor123
⚠️ Security Note: Change these default passwords immediately after first login!
| Role | Permissions |
|---|---|
| Admin | Full system access, user management, system configuration |
| Doctor | Patient examination, prescription, view appointments |
| Nurse | Patient management, examination assistance |
| Customer | Patient examination, prescription, view appointments |
- Login as Receptionist
- Navigate to Appointments → New Appointment
- Select patient (or register new patient)
- Choose doctor and available time slot
- Confirm booking
- Login as Doctor
- View Today's Appointments
- Select patient
- Record examination findings
- Create prescription
- Complete examination
- Login as Cashier
- Navigate to Payments → Generate Invoice
- Select patient and services
- Calculate total amount
- Record payment method
- Print receipt
- Login as Inventory Staff
- Navigate to Inventory
- Add/Update items
- Check low stock alerts
- Generate inventory reports
The project includes comprehensive UML documentation:
- Patient workflows (Account, Appointment, Examination, Payment)
- Staff workflows (Doctor, Nurse, Receptionist, Cashier, Inventory Staff)
- Admin workflows (User Management, System Configuration)
- Complete system class structure
- Relationships and dependencies
- Design patterns implementation
Located in UML/Sequence/:
- Account Management: Login, Signup, Password Reset, Change Password
- Examination: Appointment, Schedule, Patient Updates
- Inventory: Add, Edit, Delete, Search, View
- Payment: Invoice Generation, Payment Process, View Payments
- System workflows and business processes
- Located in
UML/Activity/
- Complete database design
- Entity relationships
- Available in
UML/Database/ - View online: dbdiagram.io
The project includes Docker support for easy deployment:
cd mini-boot
docker-compose up -dThis will start:
- The Mini-Boot backend service
- PostgreSQL database (if configured)
Edit mini-boot/docker-compose.yml to customize:
- Port mappings
- Environment variables
- Database credentials
mvn testmvn verifySample test data is available in:
oop_ui/data/ScheduleTestData/
Contributions are welcome! Please follow these guidelines:
- Fork the repository
- Create a feature branch
git checkout -b feature/amazing-feature
- Commit your changes
git commit -m "Add some amazing feature" - Push to the branch
git push origin feature/amazing-feature
- Open a Pull Request
- Follow Java naming conventions
- Use meaningful variable and method names
- Add comments for complex logic
- Include JavaDoc for public methods
- Keep methods focused and concise
- Write unit tests for new features
Found a bug? Have a suggestion? Please open an issue with:
- Clear description of the problem
- Steps to reproduce
- Expected vs actual behavior
- Screenshots (if applicable)
Issue: JavaFX runtime components are missing
Error: JavaFX runtime components are missing
Solution: Ensure JavaFX is properly configured in your IDE or add to module path
Issue: Database connection failed
Error: Unable to connect to database
Solution:
- Check database credentials in
application.properties - Ensure database server is running
- Verify network connectivity
Issue: Port already in use
Error: Port 8080 is already in use
Solution: Change the server port in configuration or stop the conflicting service
Issue: Maven build fails
Error: Failed to execute goal
Solution:
- Run
mvn cleanfirst - Check internet connection for dependency downloads
- Verify Java version:
java -version
This project is licensed under the License - see the LICENSE file for details.
License
Copyright (c) 2025 Ngũ Hổ Tướng team
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
- Dương Trí Dũng
- Trần Văn Hậu
- Phan Minh Hiếu
- Nguyễn Minh Toàn
- Nguyễn Thành Trung
- Nguyễn Mạnh Sơn - Course Instructor & Project Advisor
- Post and Telecomunication Institue of Technology - Academic Support
- OpenJFX Team - JavaFX Framework
- Apache Software Foundation - Maven & Libraries
- All contributors and testers