{"id":48590218,"url":"https://github.com/roycoding8/mood-map-hacklanta","last_synced_at":"2026-04-08T19:02:49.903Z","repository":{"id":347674660,"uuid":"1194831028","full_name":"RoyCoding8/Mood-Map-Hacklanta","owner":"RoyCoding8","description":"Repo for our Cognitive coder group for hacklanta hackathon","archived":false,"fork":false,"pushed_at":"2026-03-28T23:37:50.000Z","size":16173,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-29T01:43:22.005Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://mood-map-hacklanta.vercel.app","language":"JavaScript","has_issues":false,"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/RoyCoding8.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":"2026-03-28T21:42:26.000Z","updated_at":"2026-03-28T23:37:53.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/RoyCoding8/Mood-Map-Hacklanta","commit_stats":null,"previous_names":["roycoding8/mood-map-hacklanta"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/RoyCoding8/Mood-Map-Hacklanta","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RoyCoding8%2FMood-Map-Hacklanta","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RoyCoding8%2FMood-Map-Hacklanta/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RoyCoding8%2FMood-Map-Hacklanta/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RoyCoding8%2FMood-Map-Hacklanta/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RoyCoding8","download_url":"https://codeload.github.com/RoyCoding8/Mood-Map-Hacklanta/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RoyCoding8%2FMood-Map-Hacklanta/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31569400,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":"2026-04-08T19:02:31.730Z","updated_at":"2026-04-08T19:02:49.894Z","avatar_url":"https://github.com/RoyCoding8.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MoodMap\n\nAnonymous campus emotional pulse app for hackathon demos. Students drop mood pins on a map, get immediate AI support, and counselors can view campus-level trends.\n\nCore app code is JavaScript-only (no TypeScript). A Python `uv` service is now included for RAG and AI orchestration.\n\n## Implemented Features\n\n### Student Experience\n\n- Anonymous mood pin drop on an interactive campus map\n- Quick check-in buttons (drop mood near campus center instantly)\n- AI Companion panel with personalized comfort message, action, reminder, and music suggestion\n- AI chat inside Companion with optional voice input (SpeechRecognition) and read-aloud replies (SpeechSynthesis)\n- Mood update flow for your own pins (including optional recovery story sharing)\n- Recovery Stories feed with hearts\n- Happy Places: positive check-ins can be opened for others to join\n- Daily mood journal timeline, streak tracking, and AI-generated daily reflection\n\n### Counselor / Operations Experience\n\n- Live mood breakdown and live activity feed\n- AI campus insights (`vibe`, `hotspot`, `dominant`, `alert`)\n- Crisis Mode panel with action confirmations\n- Resolution Mode animation to mark response progress\n- Simulate Stress Wave demo action\n- Emergency counselor banner when high-risk chat language is detected\n\n### Safety and Platform Controls\n\n- 3-level emergency keyword detection in chat (L1, L2, L3)\n- L3 full-screen emergency overlay with one-tap 911 and campus police call actions\n- API input validation, rate limiting, timeout handling, and security headers\n- Device ID-based anti-spam controls for `/api/pin` and `/api/support`\n- Light/dark theme toggle with persisted preference and reduced-motion awareness\n\n### Media / Demo\n\n- AI-generated \"Campus Vibe Check\" reel data\n- In-browser reel player with animation timeline\n- Record and download reel as `.webm`\n- Hidden demo shortcuts: `Ctrl+Shift+R` (reset controls), `Ctrl+Shift+S` (secret stress wave)\n\n## Quick Start\n\n```bash\n# 1) Install dependencies\nnpm install\n\n# 2) Configure environment\n# Windows (cmd)\ncopy .env.example .env\n# macOS/Linux\n# cp .env.example .env\n\n# 3) Start backend API server (terminal 1)\nnpm run server\n\n# 4) Start frontend dev server (terminal 2)\nnpm run dev\n```\n\nWindows helper script:\n\n- `run.bat` starts backend + frontend for local demo\n\n## Python RAG Service (FastAPI + ChromaDB)\n\nThis project now includes a self-contained Python `uv` service at `py-service/`.\n\n- Gemini embeddings power retrieval (`GEMINI_API_KEY`)\n- Groq powers chat generation (`GROQ_API_KEY` or existing `LLM_API_KEY`)\n- ChromaDB persists local vectors in `py-service/data/chroma`\n\n### Start Python Service\n\n```bash\n# from repo root\nnpm run py:install\nnpm run py:ingest\nnpm run py:server\n```\n\nPython endpoints:\n\n- `GET /py/health`\n- `GET /py/rag/stats`\n- `POST /py/chat`\n- `POST /py/rag/upsert`\n- `POST /py/rag/query`\n- `POST /py/comfort`\n- `POST /py/journal`\n- `POST /py/insights`\n- `POST /py/generate-reel-script`\n\nIngestion:\n\n- Seed corpus files live in `py-service/corpus/`\n- Run `npm run py:ingest` to upsert those documents into ChromaDB\n\nNode integration:\n\n- `/api/chat` routes to Python by default and falls back to existing Node/Groq logic if Python is unavailable.\n- Additional AI endpoints are proxied to Python by default (`/api/comfort`, `/api/journal`, `/api/insights`, `/api/generate-reel-script`).\n- Set `PY_PROXY_EXTRA_ROUTES=0` if you need to temporarily force those endpoints back to Node handlers.\n\n## LLM Provider Support\n\nSet `LLM_PROVIDER` in `.env`.\n\n| Provider | `LLM_PROVIDER` | Default Model | API Key Env |\n|----------|----------------|---------------|-------------|\n| Groq | `groq` | `llama-3.3-70b-versatile` | `LLM_API_KEY` or `GROQ_KEY` |\n| OpenAI | `openai` | `gpt-4o-mini` | `LLM_API_KEY` |\n| Anthropic | `anthropic` | `claude-sonnet-4-20250514` | `LLM_API_KEY` |\n| Google Gemini | `gemini` | `gemini-2.0-flash` | `LLM_API_KEY` |\n| Custom (OpenAI-compatible) | `custom` | set `LLM_MODEL` | `LLM_API_KEY` |\n\nFor OpenAI-compatible providers (Together, Fireworks, Mistral, etc.), set `LLM_PROVIDER=custom` and `LLM_BASE_URL`.\n\n## API Routes\n\n| Route | Purpose | Express (`server.js`) | Vercel `api/` |\n|-------|---------|------------------------|---------------|\n| `/api/insights` | Campus mood insights | Yes (Python-proxy by default) | Yes |\n| `/api/comfort` | Companion comfort payload | Yes (Python-proxy by default) | Yes |\n| `/api/chat` | Companion chat reply | Yes (Python-proxy + safety gate) | Yes |\n| `/api/journal` | Daily journal reflection | Yes (Python-proxy by default) | Yes |\n| `/api/pin` | Create/update/delete user pins | Yes | Yes |\n| `/api/support` | Hug / me-too reactions | Yes | Yes |\n| `/api/generate-reel-script` | Reel data generation | Yes | No (not yet in `api/`) |\n\n## Scripts\n\n| Command | Description |\n|---------|-------------|\n| `npm run dev` | Start Vite dev server |\n| `npm run server` | Start Express API server |\n| `npm run py:install` | Install Python service dependencies via uv |\n| `npm run py:server` | Start Python FastAPI service |\n| `npm run build` | Build frontend for production |\n| `npm run preview` | Preview production build locally |\n| `npm run lint` | Run ESLint |\n| `npm test` | Run Vitest once |\n| `npm run test:watch` | Run Vitest in watch mode |\n\n## Project Structure\n\n```\n.\n├── api/                    # Vercel serverless functions\n│   ├── chat.js\n│   ├── comfort.js\n│   ├── insights.js\n│   ├── journal.js\n│   ├── pin.js\n│   └── support.js\n├── lib/\n│   ├── chatSafety.js       # Deterministic L1/L2/L3 safety gate for chat\n│   ├── groq.js             # LLM provider layer + validation + CORS + rate limit\n│   ├── pinStore.js         # In-memory pin/support store for API routes\n│   └── pyClient.js         # Node -\u003e Python proxy client\n├── py-service/\n│   ├── src/py_service/     # FastAPI app, RAG, schemas, Groq/Gemini clients\n│   └── pyproject.toml      # uv project config\n├── src/\n│   ├── __tests__/          # Utility tests (emergency detect + JSON parser)\n│   ├── components/         # UI modules\n│   ├── App.jsx             # Main app shell and state orchestration\n│   ├── api.js              # Frontend API client\n│   ├── constants.js\n│   ├── storage.js\n│   └── utils.js\n├── public/reel-assets/     # Reel background assets\n├── server.js               # Local Express API server\n└── vercel.json             # Vercel frontend config + headers/rewrites\n```\n\n## Current Limitations\n\n- `lib/pinStore.js` is in-memory only (data resets when server restarts).\n- Seed pins shown on initial map are frontend demo data and are not persisted to backend.\n- `/api/support` can only resolve pins known to backend store (works for pins created via `/api/pin`).\n- Reel generation endpoint is available in local Express but not yet mirrored as a Vercel function file.\n- Python RAG currently seeds a small starter corpus; add campus-specific documents via `/py/rag/upsert`.\n\n## Testing\n\nCurrent tests cover:\n\n- Emergency keyword level detection (`detectLevel`)\n- Robust LLM JSON parsing (`parseLLMJson`)\n\nRun with:\n\n```bash\nnpm test\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froycoding8%2Fmood-map-hacklanta","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froycoding8%2Fmood-map-hacklanta","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froycoding8%2Fmood-map-hacklanta/lists"}