A comprehensive Django-based telemedicine platform for managing patients, medical imaging studies, and AI-powered analysis with end-to-end encryption.
TeleMedVision is a full-featured medical imaging platform that combines:
- Patient Management - Complete patient records with unique IDs
- Medical Imaging - Upload, view, and manage DICOM and standard medical images
- AI Analysis - LLM-powered image analysis with multiple provider support
- Secure Encryption - DNA-Chaos encryption for medical image security
- Real-time Chat - WebSocket-based messaging system
- User Accounts - Quota-based tiered access (Free/Premium)
- Backend: Django 5.x with Django REST Framework
- Database: SQLite (development) / PostgreSQL (production ready)
- Real-time: Django Channels with Redis
- AI: LangChain with OpenAI, Anthropic, or Ollama support
- Authentication: JWT + Session authentication
- Deployment: PythonAnywhere compatible
A Stack Overflow-style knowledge sharing platform designed specifically for medical professionals. Syringly enables healthcare workers to:
- Ask Questions - Post clinical questions to get expert answers from peers
- Share Knowledge - Answer questions and build collective medical expertise
- Tag & Categorize - Organize questions by medical specialty (Cardiology, Neurology, etc.)
- Vote & Reputation - Upvote helpful answers, build credibility through contributions
- Accept Best Answers - Mark the most helpful response as accepted
Access Syringly at /syringly/ or via the navigation.
- Support for DICOM (.dcm) and standard formats (JPG, PNG, TIFF)
- Study management (X-Ray, CT, MRI, Ultrasound, PET)
- Image viewer with basic tools (zoom, pan, measure)
- Image enhancement capabilities
- Processing logs and audit trail
- Multi-LLM support (OpenAI GPT-4, Anthropic Claude, Ollama)
- Study-type-specific prompts for radiology analysis
- Confidence scores, urgency assessment, recommendations
- JSON-structured results for integration
- DNA-Chaos Encryption - Implements ITIEDC algorithm
- Chaotic map (PWLCM) for key generation
- DNA encoding with 8 possible rules
- One-Time Pad (OTP) encryption
- Arithmetic coding compression option
- SHA-256 integrity verification
- Real-time WebSocket messaging
- Direct messages and group chats
- Message attachments (images, video, audio, documents)
- Status updates (24hr expiry)
- Call logging (audio/video)
- Online presence and read receipts
- Message reactions and replies
- Starred messages and search
- Questions & Answers - Post clinical questions, receive expert answers
- Voting System - Upvote/downvote questions and answers
- Accepted Answers - Mark best answers as accepted
- Reputation System - Earn points through contributions
- Tags - Categorize by medical specialty
- User Profiles - Track activity, questions, and answers
- Stack Overflow-style UI - Familiar, professional interface
- JWT-based authentication
- Session authentication fallback
- Profile management with avatars
- Daily quota system (10 images/day for free tier)
- Privacy settings (last seen, profile visibility)
- Two-step verification option
# Clone and setup
git clone <repo-url>
cd groundup
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
# Run migrations and start
python manage.py migrate
python manage.py createsuperuser
python manage.py runservergroundup/
├── syringly/ # Medical Q&A platform (Stack Overflow for medics)
│ ├── models.py # Question, Answer, Tag, Vote, UserProfile models
│ ├── views.py # Q&A views, voting, user profiles
│ ├── urls.py # URL routing
│ └── templates/ # Q&A templates
├── telemed/ # Main telemedicine app
│ ├── models.py # Patient, Study, Image, EncryptionKey models
│ ├── services/
│ │ ├── dna_chaos_encryption.py # DNA-Chaos encryption implementation
│ │ └── ai_analyzer.py # LLM-based medical image analysis
│ ├── forms.py # Django forms
│ ├── urls.py # URL routing
│ └── migrations/ # Database migrations
├── chat/ # Chat/messaging app
│ ├── models.py # Message, Conversation, Profile models
│ ├── consumers.py # WebSocket consumers
│ ├── views.py # Chat views
│ └── urls.py # Chat URL routing
├── accounts/ # User account management
├── telemedvision/ # Django project settings
│ ├── settings.py # Base settings
│ ├── settings_production.py # Production overrides
│ ├── settings_local.py # Local development
│ ├── asgi.py # ASGI config for channels
│ └── wsgi.py # WSGI config for deployment
├── static/ # Static assets
├── media/ # User uploads
├── logs/ # Application logs
└── requirements.txt # Python dependencies
Create a .env file from .env.example:
# Django
SECRET_KEY=your-secret-key
DEBUG=True
ALLOWED_HOSTS=localhost,127.0.0.1
# Database (optional - defaults to SQLite)
DATABASE_URL=postgresql://user:pass@localhost/dbname
# Redis (for channels)
REDIS_URL=redis://localhost:6379
# AI Providers (at least one required)
OPENAI_API_KEY=sk-...
# or
ANTHROPIC_API_KEY=sk-ant-...
# or use local Ollama (no API key needed)
LLM_PROVIDER=ollama
OLLAMA_BASE_URL=http://localhost:11434| Setting | Default | Description |
|---|---|---|
| TIME_ZONE | Africa/Nairobi | Server timezone |
| DAILY_IMAGE_QUOTA | 10 | Free tier daily limit |
| MAX_UPLOAD_SIZE | 50MB | Maximum file upload |
| ALLOWED_EXTENSIONS | dcm, jpg, png, tiff | Supported formats |
The encryption module (telemed/services/dna_chaos_encryption.py) implements:
- PWLCM Chaotic Map - Generates pseudo-random sequences
- DNA Encoding - Converts bytes to DNA bases (A, T, G, C) using 8 rules
- DNA XOR - Secure combination of encoded data with OTP
- Arithmetic Coding - Optional lossless compression
from telemed.services.dna_chaos_encryption import DNACryptoService
service = DNACryptoService(master_key=b'secret-key')
encrypted, params = service.encrypt_image(image_bytes, width, height)
decrypted = service.decrypt_image(encrypted, params)Configure LLM provider in settings:
# Use OpenAI (default)
LLM_PROVIDER = 'openai'
OPENAI_API_KEY = 'sk-...'
# Or Anthropic
LLM_PROVIDER = 'anthropic'
ANTHROPIC_API_KEY = 'sk-ant-...'
# Or local Ollama
LLM_PROVIDER = 'ollama'
OLLAMA_BASE_URL = 'http://localhost:11434'-
Clone repo
git clone <repo-url> cd groundup
-
Create virtual environment
python -m venv venv source venv/bin/activate pip install -r requirements.txt -
Configure WSGI Edit
wsgi.pyto use production settings:os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'telemedvision.settings_production')
-
Set ALLOWED_HOSTS Update
settings_production.pywith your domain. -
Run migrations and collect static
python manage.py migrate python manage.py collectstatic --noinput
-
Create superuser
python manage.py createsuperuser
When adding a new package:
pip install <package>
pip freeze > requirements.txt- WebSockets: Require Redis (not available on PythonAnywhere free tier)
- Media files: Stored in
/media/directory - Database: SQLite (db.sqlite3) for development
- Timezone: Defaults to Africa/Nairobi - adjust for your location
- Security: Change SECRET_KEY in production, use strong master key for encryption
Visit /admin/ to access the Django admin panel after creating a superuser.
This project is provided as-is for educational and demonstration purposes.