How syedharisshahdev/healthcare_management_system works
Main Components
• Frontend/UI Layer:
• Pages under the /app directory (homepage, admin panel, patient pages, API routes, and Sentry examples).
• Global layout components (layout.tsx, globals.css) and error handlers (global-error.tsx, loading.tsx).
• Reusable UI components in the /components directory — including modals (AppointmentModal, PasskeyModal), forms (RegisterForm, AppointmentForm, PatientForm), tables (DataTable), and UI primitives (button, input, alert-dialog, etc.).
• API and Backend Services:
• API endpoints in /app/api such as the sentry-example-api to handle server-side logic.
• Integration of external services like Sentry for error tracking (sentry.client.config.ts, sentry.edge.config.ts, sentry.server.config.ts) and likely Appwrite, based on the presence of an appwrite configuration file (lib/appwrite.config.ts).
• Domain Logic & Utilities:
• Business logic spread across the /lib directory with actions (for patient and appointment functionalities) and utility modules (lib/utils.ts, lib/validation.ts).
• Constants and types (in the constants and types directories) that facilitate structured communication between layers.
• Development & Configuration:
• Essential configuration files such as next.config.mjs, tailwind.config.ts, postcss.config.mjs, and ESLint configuration.
• Build and dependency management files like package.json and package-lock.json.
Relationships & Interactions
• The Frontend:
• Uses the Next.js “app” directory for routing. Pages interact with backend API routes and call business logic actions.
• UI components (in /components) are integrated into pages to handle user interactions (e.g., submission of a form triggers a process in lib/actions).
• API and Business Logic:
• The app routes under /app/api act as a middle layer, interfacing between the UI and business logic (i.e., lib/actions modules). They may also trigger Sentry events for error logging.
• External Integration & Monitoring:
• Sentry modules and Appwrite configuration indicate the use of external services for error monitoring and possibly third-party authentication or data services.
Architectural Patterns & Key Technologies
• The project uses a modular and component-based design (common in Next.js projects) to separate concerns:
• Presentation Layer (UI components and pages)
• Application Layer (API routes and business logic in lib/actions)
• Integration/External Services (Sentry, Appwrite)
• This design promotes scalability and maintainability by decoupling UI, application logic, and external integrations.
• Key frameworks and libraries include Next.js, Sentry (for error monitoring), and possibly Appwrite (for backend as a service).