How an-ano-nymus/medkit works
Project Type & Purpose
• Full-stack medical assistant web application (“MedKit”) offering user authentication, appointment scheduling, medical-report summarization, translation, and related AI-powered pipelines.
High-Level Components
• Frontend (React SPA)
• AuthService (Node.js/Express REST API)
• MedicalService (Python microservice for AI/NLP pipelines)
• Database (MongoDB)
• File Storage (local “uploads” folder or S3)
• External APIs (Cerebras NLP, Google Translate/LibreTranslate)
Component Responsibilities & Interactions
a. React SPA
• Hosts UI pages (login/signup, dashboard, report upload, translation, appointment UI).
• Sends HTTP(S) requests to AuthService and MedicalService.
b. AuthService (backend/login-signup)
• Exposes routes (authRoutes, appointmentRoute, doctorRoute, medRoutes, translateRoute, otpRoute).
• Implements MVC: models (User, Doctor, Appointment, Report), controllers (authController), routes.
• Manages user sessions, JWT or sessions, sends OTP via SendOTP util.
• Stores user, appointment, report metadata in MongoDB.
• Persists uploaded PDFs in /uploads.
• Optionally orchestrates Python scripts in python_scripts (image_to_text, translator_by_llama).
c. MedicalService (backend/MEDICINE_API)
• Python scripts for:
• PDF/image→text (using Poppler CLI, Tesseract)
• Text summarization (Cerebras NLP, llama_using_api.py)
• Text-to-speech (Text_to_speech.py)
• Embeds a simple static medicine.html interface for manual testing.
• Exposes REST endpoints for report analysis.
d. Database (MongoDB)
• Single cluster storing users, appointments, doctor profiles, report summaries, translations.
e. File Storage
• Local “uploads” folder in AuthService for raw PDFs; accessible by MedicalService.
f. External Services
• Cerebras NLP API for summarization
• Google Translate / LibreTranslate for translations
• (Optional) LangChain orchestration
Architectural Patterns & Design Principles
• Micro-services style separation:
• AuthService handles security, scheduling, data persistence
• MedicalService focuses on heavy AI/ML pipelines
• RESTful API layer between frontend and backends
• MVC within Node service; pipeline pattern within Python service
• Single-page-app front end consuming JSON APIs
• Shared file-storage or message exchange (filesystem or message queue) to pass PDF/text between services