How saadinnovates/pharmacy-management-system works
Main Components
• User Interface (UI) Layer:
• Multiple GUI components as seen (login_gui.py, main_gui.py, medicines_gui.py, inventory_gui.py, prescriptions_gui.py, suppliers_gui.py, predictor_ui.py, users_gui.py).
• A separate theme.py file suggests configurable visual styling.
• Business Logic Layer:
• Core functionalities separated into distinct modules (medicines.py, inventory.py, prescriptions.py, suppliers.py, predictor.py, users.py, register.py).
• Data Access Layer:
• The database.py file handles connections and interactions with the MySQL database.
• Application Entry Point:
• main.py and main_gui.py likely act as the startup scripts that orchestrate the UI and logic components.
Relationships and Interactions
• The UI components (Tkinter-based GUIs) interact directly with the business logic modules. For example, medicines_gui.py calls functions in medicines.py for operations such as adding, updating, or deleting medicine records.
• The business logic modules process requests, apply business rules, and then interact with the database module (database.py) to perform CRUD operations on MySQL.
• User authentication and session management are handled by modules such as login_gui.py and register.py.
• The predictor functionality (predictor.py & predictor_ui.py) is specialized to check medicine effectiveness for a given disease, likely integrating domain-specific logic.
• Separate management of inventory, prescriptions, and suppliers suggests modular design where each module encapsulates its specific domain logic.
Architectural Patterns and Design Principles
• MVC-Like Structure: Although this isn’t a web application, the separation between views (GUI files), controllers/model (business logic files), and data access (database.py) implies a form of Model-View-Controller (MVC) pattern.
• Separation of Concerns: The project clearly separates the GUI-related elements from the core business functions and data persistence.
• Modular Design: Each major function has its own pair (module and corresponding GUI) making it easier to extend or modify individual parts without affecting the entire system.
Relevant Technologies and Frameworks
• Tkinter for Desktop GUIs.
• MySQL for data storage.
• Python as the primary programming language.
Final Reminders
• Component (e.g., medicines, inventory) is clearly labeled.