How siddharthrepo/hackandheal works
Project Type & Purpose
• Chikitsa360 is a full-stack telehealth web application built on Django. It enables patients to register, book appointments, join HD video calls (WebRTC via Daily.co), and receive live transcriptions (Deepgram). It also supports chat, payments (Razorpay), and post-consultation records.
File Structure Analysis
• Top-level Django project:
• manage.py
• chikitsa360/ (ASGI/WSGI entrypoints, settings, main urls)
• Django apps (each implements a core domain/service):
• auth_app (accounts, RBAC, login/registration)
• chat_app (real-time messaging via Django Channels)
• consultation_app (scheduling, video room templates, bookings)
• payment_app (Razorpay integration, receipts)
• transcription_app (Deepgram API wrapper, email summaries)
• Static content: CSS/JS/images under static & staticfiles
• Templates: organized by feature (auth, consultation, payment, transcription, admin)
Key Architecture from README
• Web framework: Django (MVC)
• Real-time: Django Channels + ASGI
• Database: PostgreSQL
• Video: Daily.co (WebRTC)
• Transcription: Deepgram API
• Payments: Razorpay (work in progress)
• Deployment: Koyeb (cloud host)
Main Components
A. Client Layer
• Browser/mobile (HTML/CSS/JS, video & WebSocket clients)
B. Web/API Layer
• Django (WSGI for HTTP, ASGI for WebSocket)
• URL routing into feature apps
• Frontend assets served via staticfiles & Django’s Static Middleware or CDN
C. Real-Time Layer
• Django Channels
• Redis (or in-memory channel layer) for pub/sub
D. Data Layer
• PostgreSQL database
E. External Services
• Daily.co (WebRTC signaling and media)
• Deepgram (speech-to-text API)
• Razorpay (payment gateway)
• SMTP/email service (appointment & transcript emails)
Component Interactions
1. User HTTP ➔ Django WSGI ➔ Auth/App business logic ➔ PostgreSQL
2. User opens video room ➔ WebSocket handshake ➔ Django Channels/ASGI ➔ Redis channel layer
3. Django Channels signals to Daily.co for WebRTC peer negotiation; media streams directly between clients & Daily.co
4. During calls, audio chunks forwarded to Deepgram via transcription_app.services; transcript returned and persisted in DB
5. Payment flow: frontend JS ➔ payment_app endpoint ➔ Razorpay API ➔ callback ➔ receipt generation ➔ DB
6. Notification flow: actions (appointment created, transcript ready) ➔ email service via SMTP or external mail API
Architectural Patterns & Principles
• Modular Django apps: feature-based separation (auth, chat, consultation, payment, transcription)
• MVC: models in each app, central template layer, views/controllers handling HTTP & WebSockets
• Asynchronous messaging: Channels + Redis for scaling real-time features
• Service integration layer: dedicated modules wrapping third-party APIs
• Secure design: role-based access, encryption in transit (HTTPS, WSS), environment-driven config
Detail
• Django app as its own sub-component.
• Both synchronous (HTTP) and asynchronous (WebSocket, API callbacks) interactions.
• Environmental boundaries (on-prem Django host vs cloud-hosted external services).