{"id":34581813,"url":"https://github.com/ayscript/health-atlas-full-project","last_synced_at":"2026-05-30T05:31:14.471Z","repository":{"id":329010478,"uuid":"1117749174","full_name":"ayscript/health-atlas-full-project","owner":"ayscript","description":"Live link","archived":false,"fork":false,"pushed_at":"2025-12-16T19:33:10.000Z","size":10641,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-20T10:11:23.983Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://health-atlas-five.vercel.app/","language":"TypeScript","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/ayscript.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-16T18:56:07.000Z","updated_at":"2025-12-16T19:33:13.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ayscript/health-atlas-full-project","commit_stats":null,"previous_names":["ayscript/health-atlas-full-project"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/ayscript/health-atlas-full-project","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayscript%2Fhealth-atlas-full-project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayscript%2Fhealth-atlas-full-project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayscript%2Fhealth-atlas-full-project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayscript%2Fhealth-atlas-full-project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ayscript","download_url":"https://codeload.github.com/ayscript/health-atlas-full-project/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayscript%2Fhealth-atlas-full-project/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33681809,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-30T02:00:06.278Z","response_time":92,"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":[],"created_at":"2025-12-24T10:07:47.808Z","updated_at":"2026-05-30T05:31:14.453Z","avatar_url":"https://github.com/ayscript.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca id=\"readme-top\"\u003e\u003c/a\u003e\n\n\n\n\u003c!-- PROJECT LOGO --\u003e\n\u003cbr /\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://health-atlas-five.vercel.app/\"\u003e\n    \u003cimg src=\"health-atlas-frontend/public/icon.png\" alt=\"Logo\" width=\"80\" height=\"80\"\u003e\n  \u003c/a\u003e\n\n  \u003ch1 align=\"center\"\u003eHealth Atlas\u003c/h1\u003e\n\n  \u003ca href=\"https://health-atlas-five.vercel.app/\"\u003eClick Here For Live Link (https://health-atlas-five.vercel.app)\u003c/a\u003e\n\n  \u003cp align=\"center\"\u003e\n    AI-powered multilingual health triage and primary-care assistant.\n    \u003cbr /\u003e\n    \u003cstrong\u003eFrontend\u003c/strong\u003e: Next.js • \u003cstrong\u003eAPI\u003c/strong\u003e: FastAPI (Supabase auth) • \u003cstrong\u003eModel\u003c/strong\u003e: Transformers (Gradio + FastAPI)\n  \u003c/p\u003e\n\u003c/div\u003e\n\n\n## Table of Contents\n\n- [About](#about)\n- [Project Structure](#project-structure)\n- [Prerequisites](#prerequisites)\n- [Quick Start (Local)](#quick-start-local)\n  - [1) Frontend (Next.js)](#1-frontend-nextjs)\n  - [2) Backend (FastAPI + Supabase)](#2-backend-fastapi--supabase)\n  - [3) AI Model (Gradio / Transformers)](#3-ai-model-gradio--transformers)\n- [Environment Variables](#environment-variables)\n- [How the pieces connect](#how-the-pieces-connect)\n- [Deployment notes](#deployment-notes)\n- [Contributing](#contributing)\n- [License \u0026 Contact](#license--contact)\n\n---\n\n## About\n\nHealth Atlas is an AI assistant focused strictly on health, symptom triage, and first-aid guidance. It uses a small ecosystem:\n\n- A Next.js frontend app that provides UI and auth flows\n- A FastAPI backend that handles auth/profile using **Supabase**\n- A model service (Gradio + FastAPI) serving a streaming text endpoint for chat responses\n\nImportant: The system prompt enforces strict domain rules (no diagnoses, no medication/dosage, strict refusal when out-of-scope). See code in `ai-model/main.py` and `health-atlas-frontend/src/app/api/chat/route.ts` for the exact rules.\n\n---\n\n---\n## Chat UI\n![alt text](image.png)\n---\n\n## Project Structure\n\nTop-level directories:\n\n- `health-atlas-frontend/` — Next.js app (UI)\n- `health-atlass-backend/` — FastAPI backend (auth/profile); uses Supabase\n- `ai-model/` — Model server (Gradio + Transformers, streaming /chat_api)\n\n---\n\n## Prerequisites\n\n- Node.js 18+ and npm (or pnpm)\n- Python 3.11+ and pip\n- For `ai-model`: GPU is recommended for usable performance with large models (PyTorch + transformers). CPU will work but may be very slow.\n- A Supabase project (for auth) if you plan to use the built-in auth endpoints\n\n---\n\n## Quick Start (Local)\n\nClone the repo:\n\n```bash\ngit clone https://github.com/ayscript/health-atlas-full-project\ncd health-atlas-full-project\n```\n\n### 1) Frontend (Next.js)\n\n```bash\ncd health-atlas-frontend\nnpm install    # or pnpm install\nnpm run dev\n```\n\nVisit: http://localhost:3000\n\nNotes:\n- The client side calls a backend URL in `src/app/api/chat/route.ts` (see `backendUrl` constant). Update that to point at your running model service (e.g. `http://localhost:7860/chat_api`).\n\n### 2) Backend (FastAPI + Supabase)\n\n```bash\ncd ../health-atlass-backend\npython -m venv .venv\n.\\.venv\\Scripts\\activate    # Windows\npip install -r requirements.txt\n```\n\nCreate a `.env` with the following variables (see [Environment Variables](#environment-variables)). Then run:\n\n```bash\nuvicorn main:app --reload --port 8000\n```\n\nAvailable routes (examples):\n- `POST /auth/signup` — sign up a user (email, password, display_name)\n- `POST /auth/login` — login\n- `GET /api/profile` — protected; requires `Authorization: Bearer \u003csupabase_access_token\u003e`\n\n### 3) AI Model (Gradio + Transformers)\n\nThis service exposes a streaming `/chat_api` endpoint and a Gradio UI (mounted at `/`).\n\n```bash\ncd ../ai-model\npython -m venv .venv\n.\\.venv\\Scripts\\activate\npip install -r requirements.txt\n# Option 1: run via python (the script runs uvicorn when executed)\npython main.py\n# OR (recommended) run uvicorn directly\nuvicorn main:app --host 0.0.0.0 --port 7860\n```\n\nVisit the Gradio UI: http://localhost:7860/\n\nCaveat: MODEL_ID in `main.py` is set to `NCAIR1/N-ATLaS`. Ensure you have access to the model and enough VRAM for inference. The script auto-detects CUDA if available.\n\n---\n\n## Environment Variables\n\nhealth-atlass-backend (create `.env`):\n\n```\nSUPABASE_URL=https://your-supabase-url.supabase.co\nSUPABASE_ANON_KEY=your-anon-key\nSIGNUP_REDIRECT_URL=https://your-frontend-url/after-signup\n```\n\nai-model: none required by default (model id is hard-coded in `ai-model/main.py`).\n\nFrontend: update `backendUrl` in `health-atlas-frontend/src/app/api/chat/route.ts` to your model service URL (local or deployed). Example:\n\n```ts\nconst backendUrl = \"http://localhost:7860/chat_api\";\n```\n\n---\n\n## How the pieces connect\n\n- User interacts with the Next.js app\n- Frontend builds messages, prepends a server-side system prompt, and POSTs to `/api/chat` (server route)\n- Server route forwards the conversation to the model service `/chat_api` (streamed)\n- The model service returns a streaming plain-text response which is relayed back to the client\n\nNote: The system prompt enforces strict behavior and domain restrictions. Review `src/app/api/chat/route.ts` and `ai-model/main.py` for the exact rules.\n\n---\n\n## Deployment notes\n\n- Frontend → Vercel (Next.js recommended)\n- Backend → Any Python host (Render, Fly, Railway, or Vercel Serverless functions). Make sure to set env vars.\n- Model → Requires GPU for efficient inference. Consider hosted inference or cloud instances with GPUs (AWS/GCP/Azure), or hosted model endpoints.\n\nSecurity: keep Supabase keys and any model credentials out of the repository.\n\n---\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayscript%2Fhealth-atlas-full-project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fayscript%2Fhealth-atlas-full-project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayscript%2Fhealth-atlas-full-project/lists"}