AI-Powered Emergency Assistance Backend built with Django REST Framework, Gemini AI & Supabase
EmergencyConnect-AI is an intelligent emergency assistance backend that leverages Generative AI to provide quick emergency classification and first-aid guidance.
Given a user's emergency description, the system:
- ๐ Classifies the emergency type
โ ๏ธ Determines the priority level- ๐ Generates a concise emergency summary
- ๐ฉบ Provides immediate first-aid recommendations
- โ๏ธ Stores AI responses for future analysis
| Feature | Description |
|---|---|
| ๐ค AI Emergency Analysis | Understands natural language emergencies |
| ๐ Emergency Classification | Identifies emergency category |
| LOW / MEDIUM / HIGH / CRITICAL | |
| ๐ฉบ First Aid Assistance | Immediate safety recommendations |
| ๐ Swagger Documentation | Interactive API testing |
| ๐ MkDocs Documentation | Complete project documentation |
| โ๏ธ Supabase Integration | Cloud database logging |
| ๐ Retry & Fallback Logic | Handles AI/API failures gracefully |
| Category | Technologies |
|---|---|
| Backend | Python, Django, Django REST Framework |
| AI | Gemini AI |
| Database | Supabase, PostgreSQL, SQLite |
| Documentation | Swagger (drf-spectacular), MkDocs |
User
โ
โผ
Django REST API
โ
โผ
Gemini AI Service
โ
โผ
Emergency Classification
โ
โผ
Structured JSON Output
โ
โผ
Supabase Logging
backend/
โ
โโโ ai_assistant/
โโโ emergency/
โโโ users/
โโโ emergencyconnect/
โโโ docs/
โ โโโ index.md
โ โโโ installation.md
โ โโโ api.md
โ โโโ ai_module.md
โ โโโ deployment.md
โ
โโโ manage.py
โโโ requirements.txt
โโโ mkdocs.yml
โโโ README.md
Follow these steps to set up EmergencyConnect-AI on your local machine.
git clone https://github.com/akeren12/EmergencyConnect-AI.git
cd EmergencyConnect-AI/backendpython -m venv venvvenv\Scripts\activatesource venv/bin/activatepip install -r requirements.txtpython manage.py migratepython manage.py runserverhttp://127.0.0.1:8000/
Your local instance of EmergencyConnect-AI is now running and ready for development and testing.
| Swagger UI | MkDocs Documentation |
|---|---|
![]() |
![]() |
| docs/images/mkdocs-home.png |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/ai/analyze/ |
Analyze emergency description |
| GET | /api/schema/ |
OpenAPI Schema |
| GET | /api/schema/swagger-ui/ |
Swagger Documentation |
http://127.0.0.1:8000/api/schema/swagger-ui/
Interactive OpenAPI documentation generated using drf-spectacular.
Available in:
docs/postman/EmergencyConnect-AI.postman_collection.json
{ "description": "A person is unconscious and not breathing." }
{ "emergency_type": "Cardiac Arrest", "priority": "CRITICAL", "summary": "The person appears to be in cardiac arrest.", "first_aid": [ "Call emergency services immediately.", "Begin CPR if trained.", "Use an AED if available." ] }
EmergencyConnect-AI includes a comprehensive automated testing suite built with pytest.
- โ 27 Passing Tests
- โ Serializer Tests
- โ View Tests
- โ Authentication Flow Tests
- โ AI Integration Tests (Gemini API Mocked)
- โ 95% Overall Test Coverage
| Documentation | Link |
|---|---|
| Swagger UI | /api/schema/swagger-ui/ |
| OpenAPI Schema | /api/schema/ |
| MkDocs | mkdocs serve |
| Module | Status |
|---|---|
| Django Backend | โ Completed |
| REST APIs | โ Completed |
| Gemini AI Integration | โ Completed |
| Swagger Documentation | โ Completed |
| MkDocs Documentation | โ Completed |
| Supabase Integration | โ Completed |
| Retry & Fallback Logic | โ Completed |
| Deployment | ๐ In Progress |
- ๐ฑ One-Tap SOS
- ๐ค Voice Emergency Detection
- ๐ฅ Nearby Hospital Locator
- ๐ฉธ Blood Bank Recommendations
- ๐ Pharmacy Recommendations
- ๐ Multilingual Support
- ๐ Live Location Sharing
- ๐จ AI-generated SOS Messages
Live URL: https://emergencyconnect-ai-production-ae23.up.railway.app/login
## ๐ฉโ๐ป Author
**Aksa Elsa Jose**
B.Tech Computer Science & Engineering (Data Science)
**AI โข Django โข REST APIs โข Generative AI**
---
<div align="center">
โญ If you found this project useful, consider giving it a star!
Built with โค๏ธ using Django REST Framework & Gemini AI
</div>

