How vominhhung-sr/clinic-oupharmacy works
Main Components
a. Frontend Application:
• Located in the “oupharmacyapp” directory.
• Comprises modern JavaScript files (e.g., App.jsx, a “src” folder with pages, components, assets, and hooks) indicating a rich client-side UI.
• Includes internationalization support (locales folder), UI components (cards, charts, modals) and configuration files (vite.config.js, tailwind.config.cjs) for styling and bundling.
b. Backend Application:
• Found under “OUPharmacyManagementApp.”
• Built with Django (files such as settings.py, urls.py, wsgi.py/asgi.py show the standard Django project structure).
• Contains a “mainApp” which is the core application holding models, views, serializers, viewsets, and administrative utilities.
• Has asynchronous task management (celery.py and tasks.py files) to process background jobs.
• Includes integration for Firebase (firebase_config.py and firebase-related directories) for push notifications or other cloud communication.
c. External & Supporting Services:
• Database: Implicitly managed by Django using ORM (details in migrations and models).
• Firebase: Integrated on both backend (via firebase_config.py and signals) and frontend (firebase configuration and services) to manage real-time communication or authentication.
• Docker: Dockerfile(s) in both backend and frontend directories (and a top-level docker-compose.yml) indicate the containers for easy deployment.
• Deployment/CI: Files like railway.json and Docker configurations show that deployment is potentially managed via container orchestration.
Relationships & Interactions
• The Frontend (React app) communicates with the Backend through RESTful APIs defined in Django viewsets and serializers.
• The backend handles business logic, database operations, and triggers asynchronous tasks via Celery.
• Firebase acts as a bridge for real-time messaging/notifications – potentially used in both the frontend and backend.
• Docker configuration suggests that each major component (frontend, backend, and possibly the database) runs in isolated containers communicating through defined network interfaces.
• Internationalization and static asset delivery are handled on the frontend while Django serves the API and backend admin dashboard.
Architectural Patterns & Technologies
• MVC/MVT Pattern: The Django backend follows the Model-View-Template (MVT) architecture.
• Microservices-ish separation: Although part of one project, the clear separation into the “oupharmacyapp” for client and “OUPharmacyManagementApp” for server indicates a decoupled, service-oriented design.
• Asynchronous Task Processing: Celery integration for tasks such as email reminders or scheduled jobs.
• Containerization: Docker usage for isolated environments and easier deployment.
• Integration with external services: Firebase for push notifications, authentication, or real-time database updates.
• Use of state management and Redux in the frontend suggests a modern client-side architecture.