What if medication reminders, symptom tracking, and AI-powered health insights lived in one clean dashboard?
That’s why I built MediTrack — a production-ready health & medication tracking system with automated reminders and AI-driven analysis.
🔗 Frontend Repo: https://github.com/sneh1117/meditrack-frontend
🔗 Backend Repo: https://github.com/sneh1117/MediTrack
🌐 Live App: https://meditrack7.vercel.app/
⚙️ API Docs: https://meditrack.up.railway.app/api/docs/
🚀 What is MediTrack?
MediTrack is a full-stack health management system that allows users to:
- Track medications
- Log daily symptoms & moods
- Get AI-powered health insights
- Receive automated medication reminders via email
- Monitor adherence rates
- Enable doctor-patient data access with role-based permissions
It’s built with real-world production concepts like JWT auth, background tasks, rate limiting, object-level permissions, and secure deployment.
🧠 The Problem I Wanted to Solve
Many people:
- Forget medications
- Don’t track symptom severity properly
- Can’t see trends over time
- Don’t know when symptoms correlate with medications
I wanted to build something that:
- Feels like a modern SaaS dashboard
- Uses AI responsibly
- Implements real backend architecture patterns
- Is portfolio-ready & production-structured
🏗️ Architecture Overview
Frontend: React + Vite (deployed on Vercel)
Backend: Django REST Framework (deployed on Railway)
Database: PostgreSQL
Background Tasks: Celery + Redis
AI Layer: Google Gemini
Docs: Swagger via drf-spectacular
The system is split cleanly:
- React handles UI + API calls
- Django REST handles business logic
- Celery manages reminders asynchronously
- Gemini analyzes symptom history
- PostgreSQL stores structured health data
🎨 Frontend Stack
- React 18
- Vite
- Tailwind CSS
- Lucide Icons
- JWT authentication
- Responsive dashboard layout
Features
- Secure login & registration
- Medication CRUD
- Symptom logging (1–10 severity scale)
- Mood tracking (1–5 scale)
- AI insights display
- Dashboard charts
- Production-ready API configuration
⚙️ Backend Stack
Built using:
- Django 5.0
- Django REST Framework
- PostgreSQL
- Celery 5.3
- Redis
- Google Gemini (gemini-pro)
- Railway
🔐 Security Implementations
This wasn’t just a CRUD API. I implemented:
- JWT authentication (1hr access / 7-day refresh)
- Role-based permissions (Patient & Doctor)
- Object-level access control
- Rate limiting on login & registration
- Input sanitization (XSS prevention)
- HTTPS + HSTS in production
- Environment-based config (no secrets in code)
- CORS & CSRF protection
🤖 AI Health Insights
The /api/symptoms/ai_insights/ endpoint:
- Detects recurring patterns
- Identifies medication correlations
- Suggests when medical attention may be needed
- Provides lifestyle suggestions
AI responses are cached for 24 hours per user to avoid unnecessary API calls.
⚠️ The AI does not diagnose — it only provides observations.
⏰ Automated Medication Reminders
Using Celery Beat:
- Once Daily → 08:00 UTC
- Twice Daily → 08:00 & 20:00
- Three Times Daily → 08:00, 14:00, 20:00
- Custom schedules supported
Railway runs:
- Web process
- Celery worker
- Celery beat scheduler
This mimics real SaaS production architecture.
📊 Dashboard API (Chart.js Ready)
The backend returns pre-formatted datasets for charts:
- Symptom trends
- Average severity
- Common symptoms
- Medication adherence rates
- Mood trends
This separation keeps frontend logic clean.
🧩 Challenges I Faced
- Managing Celery on cloud deployment
- Designing doctor-patient permissions securely
- Structuring reusable serializers
- Handling AI rate limits
- Coordinating frontend & backend CORS correctly
- Ensuring reminder scheduling works across timezones
Each problem forced me to think beyond tutorials.
📚 What I Learned
- Production architecture matters more than features
- Background tasks change how you design systems
- AI integration needs caching + safety boundaries
- Security layers are essential, not optional
- Clean API design makes frontend easier
This project helped me move from “building apps” to “building systems.”
🔮 Roadmap
- WebSocket notifications (Django Channels)
- Predictive health analytics
- PDF health reports
- CI/CD pipeline
- More frontend visualizations
🛠️ How to Run Locally
Backend
git clone https://github.com/sneh1117/MediTrack
cd meditrack
python -m venv venv
pip install -r requirements.txt
python manage.py migrate
python manage.py runserver
Run Celery:
celery -A config worker --loglevel=info
celery -A config beat --loglevel=info
Frontend
git clone https://github.com/sneh1117/meditrack-frontend.git
cd meditrack-frontend
npm install
npm run dev
💡 Final Thoughts
MediTrack started as a medication tracker…
But it became a deep dive into:
- Secure backend design
- Async task processing
- AI integration
- Production deployment
- Clean frontend architecture
If you're learning full-stack development, I highly recommend building something that includes:
- Authentication
- Background jobs
- Role-based permissions
- Deployment to cloud
- API documentation
That’s where real growth happens.
If you have feedback or suggestions, I’d love to hear them 🙌
Thanks for reading!
— Sneha
Top comments (0)