How thepkz/genkikoi works
Main Components
• Client Application (User Portal):
– Located in the “client” directory.
– Built with React, TypeScript, and using Ant Design and Tailwind CSS.
– Responsible for presenting the public website, booking system, account management (such as SignIn/SignUp pages), and specialized pages (e.g., About Us, Services, FAQ, Payment outcomes).
– Interacts with the server via RESTful API calls.
• Admin Panel:
– Found in the “admin” directory.
– Also uses React and TypeScript along with a similar tech stack (with custom dashboards, calendars, and role-specific pages for doctors, managers, staff).
– Provides a restricted interface for internal management (appointment scheduling, customer management, treatment records, etc.).
– Communicates with the backend server through its own set of API endpoints.
• Backend Server:
– Housed in the “server” folder.
– Built using Node.js and Express.js.
– Contains a well-organized controller layer (various controllers for appointments, authentication, payments, fish/pond management, etc.), routing modules, middleware (for authentication, role authorization), and services (for email, scheduled tasks, payment updates).
– Manages business logic, authentication using JWT, and integration with external services.
– Interfaces with a MongoDB database (as described in the README) to store data such as appointments, user profiles, records, and transactions.
• Database & External Services:
– MongoDB: The primary data store for services like appointments, prescriptions, records, etc.
– Cloud Storage (Firebase Storage): Configured for storing media or additional asset management.
– Payment Gateway (PayOS): Used to process payments with integration details provided in the environment configuration.
– Email (NodeMailer): For sending notifications and confirmations.
Relationships and Interactions
• Both the Client Application and Admin Panel act as frontends that interact with the Backend Server via REST API:
• The Backend Server communicates with the Database (MongoDB) to persist and retrieve application data:
• External services (Payment Gateway, Email Service, Firebase) should be depicted as separate nodes interacting with the Backend Server:
– Similarly, indicate cloud storage or Firebase and email notifications.
Architectural Patterns and Principles
• The project follows the separation-of-concerns principle:
– The frontend systems (client and admin) are clearly separated from the backend business logic.
– The backend itself is organized in a layered (controller → service → model) fashion.
• Use of role-based access control:
• API-centric design:
– Emphasize the REST API endpoints that serve both the client and admin applications.