{"id":27010774,"url":"https://github.com/ayush-github123/health-backend","last_synced_at":"2026-05-13T23:38:26.718Z","repository":{"id":284188809,"uuid":"953509282","full_name":"ayush-github123/Health-Backend","owner":"ayush-github123","description":"Healthcare Backend made using django ","archived":false,"fork":false,"pushed_at":"2025-04-28T17:15:22.000Z","size":286,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-28T18:27:28.309Z","etag":null,"topics":["django","django-rest-framework","docs","python","websocket"],"latest_commit_sha":null,"homepage":"https://health-backend-gjoo.onrender.com/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ayush-github123.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-23T14:35:25.000Z","updated_at":"2025-04-28T17:15:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"5db59e4f-704f-4c11-ba6a-fb801d4adbb8","html_url":"https://github.com/ayush-github123/Health-Backend","commit_stats":null,"previous_names":["ayush-github123/health-backend"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ayush-github123/Health-Backend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayush-github123%2FHealth-Backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayush-github123%2FHealth-Backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayush-github123%2FHealth-Backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayush-github123%2FHealth-Backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ayush-github123","download_url":"https://codeload.github.com/ayush-github123/Health-Backend/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayush-github123%2FHealth-Backend/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279008121,"owners_count":26084397,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["django","django-rest-framework","docs","python","websocket"],"created_at":"2025-04-04T11:27:22.240Z","updated_at":"2025-10-11T17:38:10.176Z","avatar_url":"https://github.com/ayush-github123.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Health API 🩺\n\nWelcome to the **Health API**, a backend service for managing authentication, user health data, and AI-powered chat assistance.\n\n## 🌟 Features\n- **User Authentication** (Registration, Login, Logout, OTP Verification)\n- **Health Form Management** (Submit, Update, Retrieve User Health Data)\n- **JWT Authentication** for secure API access\n\n## Prerequisites\nBefore you begin, make sure you have the following installed:\n- **Python** (recommended version 3.8 or higher)\n- **Git**\n- A code editor (like Visual Studio Code, PyCharm, or Sublime Text)\n\n## 📌 Step-by-Step Setup Guide\n\n### 1. Clone the Repository 📂\n1. Open your terminal or command prompt\n2. Clone the repository:\n   ```bash\n   git clone https://github.com/ayush-github123/Health-Backend.git\n   cd Health-Backend\n   ```\n\n### 2. Set Up a Virtual Environment 🌐\nCreate and activate a virtual environment:\n```bash\n# Create virtual environment\npython -m venv venv\n\n# Activate on Windows\nvenv\\Scripts\\activate\n\n# Activate on macOS/Linux\nsource venv/bin/activate\n```\n\n### 3. Install Project Dependencies 📦\n```bash\npip install -r requirements.txt\n```\n\n### 4. Configure Environment Variables 🔐\n1. Create a `.env` file in the root directory\n2. Add the following variables:\n   ```env\n   SECRET_KEY=your_secret_key\n   DEBUG=True  # Set to False in production\n   DATABASE_URL=your_database_connection_string\n   GEMINI_API_KEY=your_gemini_api_key\n   EMAIL_HOST_USER=your_host_gmail_id\n   EMAIL_HOST_PASSWORD=your_email_host_password\n   ```\n\n   🚨 **Important Notes**:\n   - Keep your `.env` file private\n   - Never commit it to version control\n   - Use app passwords for Gmail if using 2-factor authentication\n\n### 5. Database Setup 💾\nApply database migrations:\n```bash\npython manage.py migrate\n```\n\n### 6. Collect Static Files 📁\n```bash\npython manage.py collectstatic --noinput\n```\n\n### 7. Running the Server 🖥️\n\n#### Option 1: Django Development Server\nFor basic development:\n```bash\npython manage.py runserver\n```\n\n#### Option 2: Daphne (Recommended for WebSocket Support) 🌐\n```bash\n# Install Daphne if not already installed\npip install daphne\n\n# Run the server\ndaphne your_project_name.asgi:application\n```\n\n🎉 The API will be accessible at `http://127.0.0.1:8000/`\n\n## 🔐 Authentication\n- Uses **JWT (JSON Web Token) Authentication**\n- Include token in requests:\n  ```\n  Authorization: Bearer \u003cyour-access-token\u003e\n  ```\n\n## 📌 API Endpoints\n\n### Authentication Routes (`/auth/`)\n| Method | Endpoint | Description |\n|--------|----------|-------------|\n| POST   | `/auth/register/` | Register a new user |\n| POST   | `/auth/login/` | Login and get JWT tokens |\n| POST   | `/auth/logout/` | Logout user |\n| POST   | `/auth/refresh/` | Refresh JWT token |\n| POST   | `/auth/verify-otp/` | Verify user OTP |\n| POST   | `/auth/resend-otp/` | Resend OTP |\n\n### Health Form Routes (`/healthcare/`)\n| Method | Endpoint | Description |\n|--------|----------|-------------|\n| POST   | `/healthcare/form/submit/` | Submit health form |\n| GET    | `/healthcare/form/me/` | Retrieve health form |\n| PUT    | `/healthcare/form/me/update/` | Update health form |\n\n## 📖 API Documentation\n- **Swagger UI**: `/docs/swagger/`\n- **ReDoc UI**: `/docs/redoc/`\n- **OpenAPI Schema**: `/api/schema/`\n\n## 📌 Example Requests\n\n### User Registration\n```json\n{\n  \"username\": \"john_doe\",\n  \"email\": \"john@example.com\",\n  \"password\": \"SecurePass123\",\n  \"confirm_password\": \"SecurePass123\"\n}\n```\n\n### Login\n```json\n{\n  \"username\": \"john_doe\",\n  \"password\": \"SecurePass123\"\n}\n```\n\n### Submit Health Form\n```json\n {\n    \"name\": \"User1\",\n    \"age\": 6,\n    \"gender\": \"Female\",\n    \"contact_details\": \"9873443240\",\n    \"chronic_conditions\": \"Arthritis, High Cholesterol\",\n    \"past_surgeries\": \"Hip Replacement\",\n    \"allergies\": \"Penicillin\",\n    \"medications\": \"Atorvastatin, Ibuprofen\",\n    \"symptoms\": \"Joint pain and stiffness\",\n    \"symptom_severity\": \"Moderate\",\n    \"symptom_duration\": \"Chronic\",\n    \"mental_health_stress\": false,\n    \"mental_health_anxiety\": false,\n    \"mental_health_depression\": false,\n    \"vaccination_history\": \"Covid-19, Pneumonia\",\n    \"accessibility_needs\": \"Hearing aid support\",\n    \"pregnancy_status\": \"Not Applicable\",\n    \"emergency_contact\": {\n      \"name\": \"Emma Green\",\n      \"relationship\": \"Daughter\",\n      \"number\": \"4376543241\"\n    },\n    \"health_insurance_provider\": \"WellCare\",\n    \"health_insurance_policy\": \"MN123456\",\n    \"preferred_language\": \"English\",\n    \"research_participation\": false\n  }\n```\n\n## 🚀 Deployment (Using Render)\n1. Push code to GitHub/GitLab\n2. Connect Render account\n3. Set environment variables\n4. Build Command:\n   ```bash\n   pip install -r requirements.txt \u0026\u0026 python manage.py collectstatic --noinput \u0026\u0026 python manage.py migrate\n   ```\n5. Deploy!\n\n## Troubleshooting 🛠️\n- Verify Python and dependency versions\n- Check environment variables\n- Ensure WebSocket configuration is correct\n- Consult project issues on GitHub\n\n## 🤝 Contributing\n1. Fork the repository\n2. Create a new branch\n3. Make changes\n4. Submit a pull request\n\n## 📃 License\nMIT License\n\n## 📧 Contact\n- Ayush Rai: [ayushrai31593@gmail.com](mailto:ayushrai31593@gmail.com)\n- Project Repository: [GitHub Link](https://github.com/ayush-github123/Health-Backend)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayush-github123%2Fhealth-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fayush-github123%2Fhealth-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayush-github123%2Fhealth-backend/lists"}