How ataekren/prescriptionmanagement works
Project Type & Purpose
• This is a full-stack, microservices-based prescription management system.
• The system supports secure prescription creation, medicine management, and user authentication with clear separation between frontend and backend services.
Main Components
a. Frontend Application:
• Built with Next.js (React, TypeScript, Tailwind CSS).
• Represents the user interface and interacts with backend APIs.
b. Backend Microservices (located under src/Services):
• API Gateway: Routes external requests to the appropriate microservices.
• Authentication Service: Manages user authentication, authorization, and user management (using JWT-based security).
• Medicine Service: Handles medicine catalog, inventory, and related operations. It also includes a medicine synchronization job.
• Prescription Service: Manages prescription creation, tracking, and notifications.
c. Shared Library:
• Found under src/Shared/SharedKernel; contains shared DTOs and models to ensure consistency among services.
d. Database & External Resources:
• Although databases aren’t explicitly shown in the file structure, the presence of Entity Framework Core and Migrations in several services implies dedicated databases (or schemas) for Auth, Medicine, and Prescription services.
e. Containerization & Deployment:
• Docker and Docker Compose are used for service orchestration and deployment.
• Configuration files (e.g., docker-compose.yml, Dockerfiles for each microservice).
Relationships and Interactions
• The API Gateway acts as the front door into the system, forwarding client requests to the appropriate backend service.
• The Frontend application sends REST/HTTP requests to the API Gateway (or directly to the respective service endpoints, depending on configuration).
• Each microservice communicates with its own database (inferred from the migrations and DbContext files) and may communicate with other microservices when required (e.g., Prescription Service might query the Medicine Service).
• JWT-based authentication is enforced by the Auth Service, interfacing with the API Gateway and possibly used by other services for role-based authorization.
• Shared components (DTOs, models) ensure data consistency when exchanging data between services.
Architectural Patterns and Design Principles
• Microservices architecture: Each service is independently deployable, has its own database configuration, and can scale separately.
• API Gateway pattern to centralize request routing.
• Separation of concerns: Distinct modules for authentication, prescriptions, and medicine management.
• Containerization using Docker, helping with deployment and consistent environments.
a. Visual Elements:
b. Detailed Representation:
• Optionally, incorporate the shared library as a common area linked with all services that utilize it.
• Docker containerization and orchestration; show that Docker Compose manages the multiple containers.
Detailed Elements
• Component labels: “Frontend (Next.js)”, “API Gateway”, “Authentication Service”, “Medicine Service”, “Prescription Service”, “Shared Library/Kernel”, “Databases” (for each service).
• Use of JWT and role-based authorization on the flow between Frontend and Auth Service.
• Web UI / Client (for user interactions)
• Backend Microservices (for business logic)
• Infrastructure/Containers (for Docker and deployment aspects)
• A client (web browser) interacting with the Frontend.
• The Frontend’s connection to the API Gateway.
• The API Gateway routing traffic to the Authentication, Medicine, and Prescription Services.
• Each service’s integration with its dedicated data storage.
• The underlying shared library for data consistency.
• Deployment aspects showing Docker containerization and orchestration via Docker Compose.