# Project export: Carebnb

This document was generated by HackStack to give an AI agent context about a hackathon project. Sections are labeled with their provenance; content marked as truncated was cut to keep this document small.

## Project metadata

- Hackathon: TreeHacks 2026
- Tagline: CareBnb: Airbnb for Healthcare, where the care comes to you.
- Devpost: https://devpost.com/software/carebnb-y39foj
- GitHub: https://github.com/SonaLily/CAREBnB_
- Video: https://www.youtube.com/embed/xhfoSODJaoY?enablejsapi=1&hl=en_US&rel=0&start=&version=3&wmode=transparent
- Team: 2 GitHub contributor(s) — sonalily (12 commits), rocket-dot-new-app[bot] (2 commits)

## Devpost submission (written by the team)

### Inspiration

Healthcare is one of the biggest financial and logistical burdens in the United States. One of our teammates had a mother battling cancer and a complex blood clotting condition. The total cost of her hospital-based care, including chemotherapy, accumulated to $1.7 million, causing the family to lose their home at a young age. This is an unfortunate reality for many families in the US. Through hospital-at-home care, she was able to receive the same treatments at home safely and effectively, reducing costs to $200,000 even without insurance by eliminating unnecessary hospital stays and administrative fees, while reserving hospital resources for the most invasive and emergency cases. This experience showed us that hospital-level care does not always require a hospital. We were inspired by the growing "hospital-at-home" movement and real-world examples showing that treatments such as IV therapy, chronic disease management, and chemotherapy can be safely delivered at home at a fraction of the cost. tIt inspired us to create CareBnb, a platform that makes home-based care safe, affordable, and accessible, with the potential to change the future of healthcare. Healthcare in the United States is expensive, fragmented, and often inaccessible. Many patients delay or avoid care due to cost, transportation barriers, or fear of hospitals. For families dealing with chronic illness or cancer, repeated hospital visits can be financially, physically, and emotionally exhausting. The problems CareBnb solves Astronomical Healthcare Costs: Facility fees, fragmented billing, and administrative overhead inflate costs. CareBnb reduces costs by eliminating unnecessary hospital stays, middleman fees, and administrative complexity, saving patients hundreds of thousands of dollars. Rural and Underserved Inequity: Patients far from hospitals struggle to access care. CareBnb delivers home visits to bridge geographic inequities. Hospital Overload and Burnout: By shifting non-acute cases to the home, we free up hospital resources for ICU, emergency surgery, and neonatology while reducing provider fatigue. Patient Comfort and Independence: We replace stressful hospital environments with the safety of home, preventing the functional and cognitive decline often seen in hospitalized elderly patients.

### What it does

CareBnb makes hospital-level care available in the comfort of your home. Patients can book nurses, caregivers, or specialists for home visits, while clinicians use the platform to manage and deliver care efficiently. Our AI-powered voice copilot records intake calls, extracts symptoms, medications, allergies, and vitals, and generates structured clinical notes, care timelines, and safety alerts, reducing administrative burden. CareBnb supports preventive care, chronic disease management, chemotherapy, post-operative care, and more… all delivered at home. By combining patient-centered design, AI, and home-based care, CareBnb makes healthcare more affordable, accessible, and dignified. We envision a future where the hospital isn’t a building… It's your home.

### How we built it

CareBnb is a full-stack, location-aware healthcare platform built for speed, scalability, and real-world clinical workflows. The frontend is a React single-page application served through Next.js, providing booking with dynamic routing and real-time data. The backend uses Next.js API routes for authentication, provider matching, booking creation, and care request management. We use Supabase (PostgreSQL) for secure relational data and built-in authentication via Supabase Auth. Geographic matching is powered by PostGIS, enabling radius-based and distance-ranked queries. Custom SQL functions such as match_providers and match_requests calculate proximity and sort results by distance, provider rating, and completed visits. Patients can search for care by service, time, and location, then complete a structured booking flow that confirms service details, collects intake data, and generates a booking tied to both patient and provider accounts. Providers have a dashboard to register their role, list services, set locations, confirm bookings, mark visits complete, and browse nearby open requests. Our AI-powered intake pipeline supports clinical documentation. Voice or audio input is converted to text, and key medical entities, symptoms, medications, allergies, and duration, are extracted into structured fields. The system generates organized notes and flags potential safety concerns to help providers prepare. The database core includes tables for providers, patients, bookings, and care requests, connected via foreign keys and managed with Supabase migrations. For testing, we seeded the system with multiple providers and open requests in San Francisco, enabling full end-to-end workflows: discovery, matching, booking, intake processing, provider confirmation, and completion.

### Challenges we ran into

The most complex challenge was integrating all parts of the system into one seamless workflow. We had a React frontend, Next.js API backend, a Supabase database, and multiple AI intake components. Ensuring that patient searches, bookings, intake data, and provider actions all communicated correctly across these layers required significant debugging and coordination. Another major challenge was setting up the AI intake pipeline itself. We combined speech-to-text, symptom extraction, and structured note generation into a single process. Getting these models to work reliably together, and then connecting their outputs to the booking and provider systems, took careful testing within the hackathon timeframe. Scope control was also important. It was tempting to build a full healthcare platform with insurance billing, credentialing, and complex scheduling. Instead, we focused on a clear MVP that demonstrated the core value: matching patients with at-home providers and automating intake. Finally, healthcare is inherently complex, with licensing, regulation, insurance, and highly variable pricing depending on location and provider. Since this was an MVP, we designed features that felt medically credible and easy to understand, while leaving deeper regulatory and billing integrations for future development.

### Accomplishments we're proud of

Our greatest accomplishment was the team itself. In just one weekend, two Cornell undergraduates, a Cornell Tech student in New York City, and a Stanford student studying computer science, biomedical engineering, and medicine came together to build a technically ambitious solution. Despite our different backgrounds and locations, we were united by a shared entrepreneurial mindset and a focus on one of healthcare’s most pressing challenges: cost. We designed a system aimed at reducing healthcare expenses while improving the patient experience, demonstrating that care can be delivered more efficiently without sacrificing human-centered design. We are especially proud of how far we pushed ourselves outside our comfort zones. We deliberately chose a complex problem at the intersection of healthcare, AI, and full-stack development. Over the course of the weekend, we stayed late troubleshooting integration issues, debugging AI pipelines, and learning firsthand how challenging it is to properly implement and orchestrate AI systems. At the same time, we experienced how powerful AI can be when used thoughtfully to accelerate development. Beyond the product itself, we’re proud of the growth that came from the process. We learned how to ship quickly, divide responsibilities strategically, communicate clearly, and build something meaningful under pressure. We also valued connecting with other builders working on similar technologies and contributing to a broader innovation community. More than just a prototype, we built momentum, technical confidence, and a shared vision for what healthcare technology can become. Last but not least, we shared plenty of jokes along the way. We set out to reduce hospital visits, and by the end of the weekend, we all agreed we might need one ourselves: four young, caffeine-powered builders pushing the limits.

### What we learned

Many hospital visits are preventable or could be safely managed at home. Despite this, only about 3% of healthcare spending goes toward preventive care. We realized that hospitals are essential for invasive procedures, but for many acute conditions, at-home care can be a better, more patient-centered option. We also learned that the biggest cost drivers in healthcare are infrastructure and complications, not just treatments themselves. AI can play a transformative role by reducing administrative burdens and improving patient safety, but it must be implemented thoughtfully. Finally and importantly, connecting AI tools, coordinating care, and building a system that is both usable and reliable requires careful planning, collaboration, and focus on the core problems.

### What's next

for CareBnb We are launching a pilot program in a focused region, starting with oncology and chemotherapy. This will let us work closely with clinicians, refine the platform, and ensure care is safe, personal, and effective. We are enhancing our technology with AI chatbots, helpful agents, and a friendly avatar to guide patients, while expanding our network of clinicians and adding telehealth options for virtual consultations. We will integrate real pricing and insurance support to make care transparent and practical, allowing providers to focus on patients and patients to feel confident in their care. Our vision is for CareBnb to become the operating system for at-home healthcare, bringing high-quality, accessible, and compassionate care directly to patients' homes.

## README (from the GitHub repository)

# CareBnb Marketplace

A full-stack care marketplace that connects **patients** with **care providers** and lets **providers** find **open care requests**. Built with Next.js (App Router), Supabase, and PostGIS for location-based matching.

---

## Table of contents

- [Features](#features)
- [Tech stack](#tech-stack)
- [Prerequisites](#prerequisites)
- [Setup](#setup)
- [Running the app](#running-the-app)
- [Project structure](#project-structure)
- [Pages & routes](#pages--routes)
- [API reference](#api-reference)
- [Environment variables](#environment-variables)
- [Supabase configuration](#supabase-configuration)
- [Deployment](#deployment)

---

## Features

### Patient side

- **Find care** — Search by service, date/time, and location (or “Use my location”). See a ranked list of providers (distance, rating, visits). Filter by minimum rating. “Available for similar dates” re-runs search with a shifted date.
- **Provider profile** — Click a provider card to view full profile (photo, role, specialties, price, next available). Book from profile or from search.
- **Book** — Creates a booking and sends you to the intake form (name, phone, address/notes, consent). Then a confirmation page with booking details.
- **My bookings** — List of your bookings with provider, service, date, status. Cancel pending/confirmed bookings. Open any booking to see details or cancel.
- **Request care** — Post an open care request (service, description, preferred time, location). Providers see it in “Find open requests.”

### Provider side

- **Register as provider** — On the provider dashboard, if you’re logged in but not yet a provider, you can register (name, role, services, location). Your account is linked via `user_id`.
- **My jobs** — List of bookings where you’re the provider. **Confirm** pending bookings and **Mark complete** confirmed ones. Links to the booking confirmation page.
- **Find open requests** — Search by service and location to see nearby open care requests (jobs board). Use “Use my location” or default (SF area).

### Auth & account

- **Sign up / Log in** — Email and password (Supabase Auth). Session is used for bookings (patient id) and provider profile (provider id).
- **Forgot password** — “Forgot password?” on login → enter email → receive reset link → **Reset password** page to set a new password.
- **Header** — When logged in: email and “Sign out.” When logged out: “Log in” and “Sign up.”

### Data & backend

- **Patient linkage** — First time you book or post a care request while logged in, a `patients` row is created and linked to your auth user (`user_id`). Future bookings use that patient.
- **Provider linkage** — Register as provider to create a `providers` row with your `user_id`. “My jobs” and provider actions (Confirm / Mark complete) use that provider.

---

## Tech stack

| Layer        | Technology                          |
|-------------|-------------------------------------|
| Frontend    | React (Vite) app in `front end/`, served by Next.js at `/`; legacy Next.js pages in `app/_legacy/` |
| Backend     | Next.js API routes (`/api/*`), Supabase, PostGIS |
| Database    | Supabase (PostgreSQL)               |
| Geo         | PostGIS (geography points, distance queries)     |
| Auth        | Supabase Auth (email/password)      |

### Combined setup (front end + backend)

- **UI**: The React/Vite app in **`front end/`** is built to **`public/spa/`** and served for all non-API routes (patient search, provider dashboard, etc.).
- **API**: Next.js serves **`/api/*`** (providers, bookings, auth, care requests). The front end calls these when running from the same origin.
- **Build**: From project root run **`npm run build:front`** (or `cd "front end" && npm run build`), then **`npm run build`** for Next.js. **`npm run dev`** runs Next.js only; the SPA is served from the built files in `public/spa/`.

---

## Prerequisites

- **Node.js** 18+
- **npm** (or yarn/pnpm)
- **Supabase account** — [supabase.com](https://supabase.com)

---

## Setup

### 1. Clone and install

```bash
git clone <repo-url>
cd CareBnB
npm install
```

### 2. Create a Supabase project

1. Go to [Supabase Dashboard](https://supabase.com/dashboard) and create a new project.
2. Note:
   - **Project URL** (e.g. `https://xxxxx.supabase.co`)
   - **Anon public key** (Project Settings → API)

### 3. Database: extensions and schema

In the Supabase **SQL Editor**:

1. **Enable extensions** (if not already):

   ```sql
   CREATE EXTENSION IF NOT EXISTS postgis;
   CREATE EXTENSION IF NOT EXISTS pgcrypto;
   ```

2. **Run the main schema**  
   Open `supabase/schema.sql`, copy its entire contents, paste into the SQL Editor, and run it. This creates:
   - Tables: `providers`, `patients`, `care_requests`, `bookings`
   - Indexes (GIST on location, GIN on services, etc.)
   - RPCs: `match_providers`, `match_requests`
   - Seed data (demo patient, ~12 providers near SF, 3 open care requests)

3. **Run the auth/intake migration**  
   Open `supabase/migrations/001_auth_and_intake.sql`, copy and run it. This adds:
   - `user_id` on `patients` and `providers` (FK to `auth.users`)
   - Intake fields on `bookings`: `patient_name`, `patient_phone`, `address_notes`, `consent`

4. **Run the provider count migration** (for “X providers found” to use DB total)  
   In **Supabase Dashboard → SQL Editor**, paste and run the contents of `supabase/migrations/003_match_providers_total_count.sql`. This updates `match_providers` to return a `total_count` so the patient search shows the real number of matching providers.

5. **Verify**  
   In **Table Editor**, confirm the four tables exist. Under **Database → Functions**, confirm `match_providers` and `match_requests`.

Detailed checklist: **supabase/README.md**.

### 4. Environment variables

Copy the example env file and set your Supabase keys:

```bash
cp .env.example .env.local
```

Edit `.env.local`:

```env
NEXT_PUBLIC_SUPABASE_URL=https://YOUR_PROJECT_REF.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_anon_public_key
```

---

## Running the app

1. **Build the front end** (once, or after changing `front end/`):  
   `npm run build:front`
2. **Start the server**:  
   `npm run dev`
3. Open [http://localhost:3000](http://localhost:3000). The React SPA (patient search, provider dashboard) is served at `/`; backend APIs at `/api/*`.

- **Build for production:** `npm run build`
- **Start production server:** `npm run start`
- **Lint:** `npm run lint`

---

## Project structure

```
CareBnB/
├── app/
│   ├── layout.tsx              # Root layout, header nav
│   ├── page.tsx                # Home: Find care (search + provider cards)
│   ├── globals.css
│   ├── login/
│   ├── signup/
│   ├── forgot-password/
│   ├── reset-password/
│   ├── request-care/            # Post a care request
│   ├── bookings/               # My bookings (patient)
│   ├── intake/                  # Intake form after Book
│   ├── booking/confirmed/       # Booking confirmation + actions
│   ├── provider/
│   │   ├── page.tsx             # Provider dashboard (register, my jobs, find requests)
│   │   └── [id]/page.tsx        # Provider profile
│   └── api/
│       ├── me/                  # GET current user + patientId/providerId
│       ├── providers/
│       │   ├── match/           # GET match providers by service/location
│       │   ├── [id]/            # GET one provider
│       │   └── register/        # POST register as provider
│       ├── requests/match/      # GET match open care requests
│       ├── bookings/            # GET (patient or provider list), POST create
│       ├── bookings/[id]/       # GET one, PATCH (intake/cancel/confirm/complete)
│       └── care-requests/       # POST create care request
├── components/
│   └── HeaderAuth.tsx           # Log in / Sign up / Sign out in header
├── lib/
│   ├── supabase.ts             # Browser + server Supabase client
│   └── auth.ts                 # getPatientIdForUser, getProviderIdForUser, getAuthUser
├──

[README truncated for size]

## Detected evidence (automated analysis)

Indexed codebase: 202 recognized source files, 3578 KB.
- Anthropic (technology) — detected in the code
- CSS (language) — detected in the code
- HTML (language) — detected in the code
- JavaScript (language) — detected in the code
- Next.js (technology) — detected in the code
- OpenAI (technology) — detected in the code
- Python (language) — detected in the code
- React (technology) — detected in the code
- SQL (language) — detected in the code
- Supabase (technology) — detected in the code
- Tailwind CSS (technology) — detected in the code
- TypeScript (language) — detected in the code
- Node.js (technology) — claimed on Devpost, not found in the code
- PostgreSQL (technology) — claimed on Devpost, not found in the code

## Codebase structure (from repository index)

### Files (120 of 511)

```
.env
.env.example
.gitignore
app/_legacy/booking/confirmed/page.tsx
app/_legacy/bookings/page.tsx
app/_legacy/forgot-password/page.tsx
app/_legacy/intake/page.tsx
app/_legacy/login/page.tsx
app/_legacy/page.tsx
app/_legacy/provider/[id]/page.tsx
app/_legacy/provider/page.tsx
app/_legacy/request-care/page.tsx
app/_legacy/reset-password/page.tsx
app/_legacy/signup/page.tsx
app/[...slug]/route.ts
app/api/admin/check-bryan-link/route.ts
app/api/admin/check-care-requests/route.ts
app/api/admin/cleanup-timezone/route.ts
app/api/admin/clear-old-care-requests/route.ts
app/api/admin/debug-decline/route.ts
app/api/admin/fix-bryan/route.ts
app/api/admin/reset-provider-passwords/route.ts
app/api/admin/run-migration-011/route.ts
app/api/admin/setup-all-providers/route.ts
app/api/admin/setup-bryan-auth/route.ts
app/api/admin/test-password-reset/route.ts
app/api/admin/verify-bryan-auth/route.ts
app/api/admin/wipe-bryan/route.ts
app/api/bookings/[id]/route.ts
app/api/bookings/route.ts
app/api/care-requests/route.ts
app/api/debug/bookings/route.ts
app/api/debug/care-requests/route.ts
app/api/intake/process/route.ts
app/api/me/route.ts
app/api/providers/[id]/availability/route.ts
app/api/providers/[id]/route.ts
app/api/providers/[id]/slots/route.ts
app/api/providers/match/route.ts
app/api/providers/register/route.ts
app/api/requests/match/route.ts
app/globals.css
app/layout.tsx
app/page.tsx
audio-model/.env.example
audio-model/.gitignore
audio-model/data/components/component1/0_1_output.json
audio-model/data/components/component1/1_1_output.json
audio-model/data/components/component1/2_1_output.json
audio-model/data/components/component1/3_1_output.json
audio-model/data/components/component1/4_1_output.json
audio-model/data/components/component1/5_1_output.json
audio-model/data/components/component2/0_2_output.json
audio-model/data/components/component2/1_2_output.json
audio-model/data/components/component2/2_2_output.json
audio-model/data/components/component2/3_2_output.json
audio-model/data/components/component2/4_2_output.json
audio-model/data/components/component2/5_2_output.json
audio-model/data/components/component2/training_data.jsonl
audio-model/data/components/component2/validation_data.jsonl
audio-model/data/components/component3/0_3_metadata.json
audio-model/data/components/component3/1_3_metadata.json
audio-model/data/components/component3/2_3_metadata.json
audio-model/data/components/component3/3_3_metadata.json
audio-model/data/components/component3/4_3_metadata.json
audio-model/data/components/component3/5_3_metadata.json
audio-model/data/components/iteration_tracker.txt
audio-model/data/sessions/0b50a726-4a3e-4c02-94a1-a95883120a15/input/audio.m4a
audio-model/data/sessions/0b50a726-4a3e-4c02-94a1-a95883120a15/metadata.json
audio-model/data/sessions/0d0d5efa-0b0e-409f-a841-03f1bb56dd47/component1/transcript.json
audio-model/data/sessions/0d0d5efa-0b0e-409f-a841-03f1bb56dd47/component2/keywords.json
audio-model/data/sessions/0d0d5efa-0b0e-409f-a841-03f1bb56dd47/component3/metadata.json
audio-model/data/sessions/0d0d5efa-0b0e-409f-a841-03f1bb56dd47/input/transcript.txt
audio-model/data/sessions/0d0d5efa-0b0e-409f-a841-03f1bb56dd47/metadata.json
audio-model/data/sessions/193df7d4-7f54-423f-afc8-b75771b98d15/component1/transcript.json
audio-model/data/sessions/193df7d4-7f54-423f-afc8-b75771b98d15/component2/keywords.json
audio-model/data/sessions/193df7d4-7f54-423f-afc8-b75771b98d15/component3/metadata.json
audio-model/data/sessions/193df7d4-7f54-423f-afc8-b75771b98d15/input/transcript.txt
audio-model/data/sessions/193df7d4-7f54-423f-afc8-b75771b98d15/metadata.json
audio-model/data/sessions/21bd24e2-0e34-4320-876f-708ef344ecc7/component1/transcript.json
audio-model/data/sessions/21bd24e2-0e34-4320-876f-708ef344ecc7/component2/keywords.json
audio-model/data/sessions/21bd24e2-0e34-4320-876f-708ef344ecc7/component3/metadata.json
audio-model/data/sessions/21bd24e2-0e34-4320-876f-708ef344ecc7/input/transcript.txt
audio-model/data/sessions/21bd24e2-0e34-4320-876f-708ef344ecc7/metadata.json
audio-model/data/sessions/2b1f9042-5edc-453d-8439-43a5f69a781a/component1/transcript.json
audio-model/data/sessions/2b1f9042-5edc-453d-8439-43a5f69a781a/component2/keywords.json
audio-model/data/sessions/2b1f9042-5edc-453d-8439-43a5f69a781a/component3/metadata.json
audio-model/data/sessions/2b1f9042-5edc-453d-8439-43a5f69a781a/input/audio.m4a
audio-model/data/sessions/2b1f9042-5edc-453d-8439-43a5f69a781a/metadata.json
audio-model/data/sessions/2f62212d-2720-42d9-a21c-190449d5ddc1/component1/transcript.json
audio-model/data/sessions/2f62212d-2720-42d9-a21c-190449d5ddc1/component2/keywords.json
audio-model/data/sessions/2f62212d-2720-42d9-a21c-190449d5ddc1/component3/metadata.json
audio-model/data/sessions/2f62212d-2720-42d9-a21c-190449d5ddc1/input/audio.m4a
audio-model/data/sessions/2f62212d-2720-42d9-a21c-190449d5ddc1/metadata.json
audio-model/data/sessions/34d830bb-4e4b-4b1d-8755-578d2ca6e3f9/component1/transcript.json
audio-model/data/sessions/34d830bb-4e4b-4b1d-8755-578d2ca6e3f9/component2/keywords.json
audio-model/data/sessions/34d830bb-4e4b-4b1d-8755-578d2ca6e3f9/component3/metadata.json
audio-model/data/sessions/34d830bb-4e4b-4b1d-8755-578d2ca6e3f9/input/transcript.txt
audio-model/data/sessions/34d830bb-4e4b-4b1d-8755-578d2ca6e3f9/metadata.json
audio-model/data/sessions/34f37545-8e00-4ef8-9f4c-07104b2425d3/input/audio.m4a
audio-model/data/sessions/34f37545-8e00-4ef8-9f4c-07104b2425d3/metadata.json
audio-model/data/sessions/383c8447-e3ac-47db-87d6-6a14cf5074a3/input/audio.m4a
audio-model/data/sessions/383c8447-e3ac-47db-87d6-6a14cf5074a3/metadata.json
audio-model/data/sessions/43a6ee07-bcc4-4e96-94e8-378088c143c3/component1/transcript.json
audio-model/data/sessions/43a6ee07-bcc4-4e96-94e8-378088c143c3/component2/keywords.json
audio-model/data/sessions/43a6ee07-bcc4-4e96-94e8-378088c143c3/component3/metadata.json
audio-model/data/sessions/43a6ee07-bcc4-4e96-94e8-378088c143c3/input/audio.m4a
audio-model/data/sessions/43a6ee07-bcc4-4e96-94e8-378088c143c3/metadata.json
audio-model/data/sessions/4ca3e7b0-e21a-4625-8be1-9500b519d597/component1/transcript.json
audio-model/data/sessions/4ca3e7b0-e21a-4625-8be1-9500b519d597/component2/keywords.json
audio-model/data/sessions/4ca3e7b0-e21a-4625-8be1-9500b519d597/component3/metadata.json
audio-model/data/sessions/4ca3e7b0-e21a-4625-8be1-9500b519d597/input/audio.m4a
audio-model/data/sessions/4ca3e7b0-e21a-4625-8be1-9500b519d597/metadata.json
audio-model/data/sessions/50d2d5b0-b8e2-42b2-a84b-85c859ada3e9/component1/transcript.json
audio-model/data/sessions/50d2d5b0-b8e2-42b2-a84b-85c859ada3e9/component2/keywords.json
audio-model/data/sessions/50d2d5b0-b8e2-42b2-a84b-85c859ada3e9/component3/metadata.json
audio-model/data/sessions/50d2d5b0-b8e2-42b2-a84b-85c859ada3e9/input/audio.m4a
audio-model/data/sessions/50d2d5b0-b8e2-42b2-a84b-85c859ada3e9/metadata.json
audio-model/data/sessions/538fc8e7-1486-4b1a-999f-46858edea3aa/input/audio.m4a
audio-model/data/sessions/538fc8e7-1486-4b1a-999f-46858edea3aa/metadata.json
[391 more files omitted for size]
```

### Dependencies

- audio-model/requirements.txt: anthropic@>=0.18.0, metapub@==0.6.4, openai@>=1.12.0, pandas@>=2.0.0, PyMuPDF@>=1.23.0, PyPDF2@>=3.0.0, python-dotenv@>=1.0.0, reportlab@>=4.0.0
- front end/package.json: @dhiwise/component-tagger@^1.0.14, @radix-ui/react-slot@^1.2.3, @reduxjs/toolkit@^2.6.1, @supabase/supabase-js@^2.95.3, @tailwindcss/aspect-ratio@^0.4.2, @tailwindcss/container-queries@^0.1.1, @tailwindcss/forms@^0.5.7, @tailwindcss/line-clamp@^0.1.0, @tailwindcss/typography@^0.5.16, @testing-library/jest-dom@^5.15.1, @testing-library/react@^11.2.7, @testing-library/user-event@^12.8.3, @vitejs/plugin-react@4.3.4, autoprefixer@10.4.2, axios@^1.8.4, class-variance-authority@^0.7.1, clsx@^2.1.1, d3@^7.9.0, date-fns@^4.1.0, dotenv@^16.0.1, framer-motion@^10.16.4, lucide-react@^0.484.0, postcss@8.4.8, react@^18.2.0, react-dom@^18.2.0, react-helmet@^6.1.0, react-hook-form@^7.55.0, react-router-dom@6.0.2, react-router-hash-link@^2.4.3, recharts@^2.15.2, redux@^5.0.1, tailwind-merge@^3.3.1, tailwindcss@3.4.6, tailwindcss-animate@^1.0.7, tailwindcss-elevation@^2.0.0, tailwindcss-fluid-type@^2.0.7, vite@5.0.0, vite-tsconfig-paths@3.6.0
- package.json: @supabase/supabase-js@^2.45.0, @types/node@^20, @types/react@^18, @types/react-dom@^18, autoprefixer@^10, dotenv@^17.3.1, eslint@^8, eslint-config-next@14.2.18, next@14.2.18, postcss@^8, react@^18.3.1, react-dom@^18.3.1, tailwindcss@^3.4.1, typescript@^5

### Recent commits (newest first)

- Transform login page into hero landing page with animated gradient
- Apply homepage style updates: fonts and animations
- Remove error_img directory from repository
- Remove all __pycache__ files from repository
- Merge remote main branch (keeping local versions)
- Add ClaudeInfo to .gitignore and remove from tracking
- Fix provider features and improve system reliability
- Add large data directories to gitignore
- Update .gitignore to exclude large files for GitHub push limits
- Add all audio-model files including ignored directories
- alexis-branch: AI-powered intake integration complete
- Add audio-model: AI medical analysis pipeline
- Latest code updated
- Initial commit with README

## Key source files (fetched from GitHub, selected and truncated for size)

### PIPELINE_USAGE.md

```markdown
# Pipeline Runner Usage Guide

## Overview

The `run_pipeline.py` script runs the complete CareBnB Medical AI pipeline on an input file. It automatically detects the input type and runs the appropriate components.

## Quick Start

```bash
# Run on audio file (Components 1-4)
python run_pipeline.py data/testing/test_recording.m4a

# Run on text file (Components 2-4, skips transcription)
python run_pipeline.py data/testing/patient_transcript.txt
```

## Input Types

### Audio Files (Full Pipeline: Components 1→2→3→4)

**Supported formats:**
- `.m4a` - MPEG-4 Audio
- `.mp3` - MP3 Audio
- `.wav` - Wave Audio
- `.flac` - FLAC Audio
- `.aac` - AAC Audio
- `.ogg` - Ogg Vorbis
- `.wma` - Windows Media Audio
- `.aiff` - AIFF Audio

**Pipeline Flow:**
1. **Component 1**: Transcribe audio to text using Whisper
2. **Component 2**: Extract medical keywords
3. **Component 3**: Search medical literature
4. **Component 4**: Generate final summary with highlights

### Text Files (Partial Pipeline: Components 2→3→4)

**Supported formats:**
- `.txt` - Plain text transcript

**Pipeline Flow:**
1. ~~Component 1~~ (Skipped - text already provided)
2. **Component 2**: Extract medical keywords
3. **Component 3**: Search medical literature
4. **Component 4**: Generate final summary with highlights

## Usage Examples

### Example 1: Audio Recording
```bash
python run_pipeline.py patient_interview.m4a
```

**Output:**
```
======================================================================
CareBnB Medical AI Pipeline
======================================================================
Input file: patient_interview.m4a
File type: .m4a

Current iteration: 5

✓ Detected: Audio file
Pipeline: Components 1 → 2 → 3 → 4

======================================================================
COMPONENT 1: Audio Transcription
======================================================================
✓ Transcription complete

... [Components 2-4 run]

======================================================================
PIPELINE COMPLETE
======================================================================
Final ZIP: /path/to/output/5_final.zip
Summary PDF: /path/to/output/5_4_output.pdf
Next iteration: 6
```

### Example 2: Text Transcript
```bash
python run_pipeline.py patient_notes.txt
```

**Output:**
```
======================================================================
CareBnB Medical AI Pipeline
======================================================================
Input file: patient_notes.txt
File type: .txt

Current iteration: 5

✓ Detected: Text file
Pipeline: Components 2 → 3 → 4 (skipping Component 1)

Reading transcript from patient_notes.txt...
✓ Loaded transcript (523 characters)

Creating transcript output file...
✓ Created: data/components/component1/5_1_output.json

... [Components 2-4 run]

======================================================================
PIPELINE COMPLETE
======================================================================
Final ZIP:
[truncated — 2697 more characters]
```

### PRE_COMMIT_CHECKLIST.md

```markdown
# Pre-Commit Checklist for GitHub Upload

## ✅ What WILL Be Committed (Good!)

### Core API Files
- ✅ `pipeline_api.py` - Main API wrapper
- ✅ `pipeline_config.py` - Configuration
- ✅ `run_pipeline.py` - CLI runner

### Source Code
- ✅ `src/models/component1/` - Transcription (updated)
- ✅ `src/models/component2/` - Keyword extraction (updated)
- ✅ `src/models/component3/` - Medical RAG (updated)
- ✅ `src/models/component4/` - Clinical analysis (updated)
- ✅ `src/models/session_manager.py` - Session management (NEW)

### Documentation
- ✅ `README.md` - Main project documentation
- ✅ `WEB_API_READY.md` - API documentation
- ✅ `PIPELINE_USAGE.md` - CLI usage guide
- ✅ `INTEGRATION_RECOMMENDATIONS.md` - Web integration guide
- ✅ `ClaudeInfo/` - Implementation plans and specs

### Examples & Config
- ✅ `examples/web_api_example.py` - Flask/FastAPI examples
- ✅ `.env.example` - Example environment file
- ✅ `requirements.txt` - Dependencies
- ✅ `.gitignore` - Updated ignore rules

### Test Data
- ✅ `data/testing/*.txt` - Text test files (small)
- ✅ `data/medical-transcriptions/` - Training dataset info

## ❌ What Will NOT Be Committed (Good!)

### Sensitive Data
- ❌ `.env` - API keys (SECURE)
- ❌ `.env.local` - Local config (SECURE)

### Output Files
- ❌ `data/sessions/` - Session outputs (generated files)
- ❌ `data/components/` - Iteration outputs (generated files)
- ❌ `data/testing/*.m4a` - Audio files (too large)
- ❌ `output/` - Legacy output directory
- ❌ `pipeline_test_results/` - Test result copies

### Python Cache
- ❌ `__pycache__/` - Python cache
- ❌ `*.pyc` - Compiled Python files

### Temporary Files
- ❌ `test_api.py` - Temporary test script
- ❌ `copy_outputs.sh` - Temporary helper script
- ❌ `OUTPUT_FILE_LOCATIONS.md` - Temporary doc

### Claude Workspace
- ❌ `.claude/` - Claude AI workspace files

## 🔍 Before You Commit - Verify These:

### 1. Check for API Keys
```bash
# Make sure no API keys are in code
grep -r "sk-" src/ pipeline_api.py pipeline_config.py
grep -r "OPENAI_API_KEY.*=" src/ pipeline_api.py pipeline_config.py
```
Should show NO hardcoded keys!

### 2. Verify .env is Ignored
```bash
ls -la | grep .env
```
Should show:
- `.env.example` ✅ (will be committed)
- `.env` ❌ (should NOT be committed)

### 3. Check File Sizes
```bash
find . -type f -size +10M | grep -v ".git" | grep -v "data/sessions" | grep -v "data/components"
```
Should show NO large files being committed!

### 4. Verify Important Files Are Included
```bash
git status | grep -E "(README|WEB_API|pipeline_api|session_manager)"
```
Should show these files as untracked (ready to add)!

## 📝 Recommended Git Commands

### 1. Add All Files (Respects .gitignore)
```bash
git add .
```

### 2. Check What Will Be Committed
```bash
git status
```

### 3. Review Specific Changes (Optional)
```bash
git diff --cached pipeline_api.py
git diff --cached src/models/component1/transcriber.py
```

### 4. Create Commit
```bash
git commit -m "Add plug-and-play web API for pipeline

- 
[truncated — 2848 more characters]
```

### package.json

```
{
  "name": "carebnb",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint",
    "seed:stanford": "node scripts/generate-stanford-seed.js",
    "build:front": "cd \"front end\" && npm run build"
  },
  "dependencies": {
    "@supabase/supabase-js": "^2.45.0",
    "dotenv": "^17.3.1",
    "next": "14.2.18",
    "react": "^18.3.1",
    "react-dom": "^18.3.1"
  },
  "devDependencies": {
    "@types/node": "^20",
    "@types/react": "^18",
    "@types/react-dom": "^18",
    "autoprefixer": "^10",
    "eslint": "^8",
    "eslint-config-next": "14.2.18",
    "postcss": "^8",
    "tailwindcss": "^3.4.1",
    "typescript": "^5"
  }
}

```

### audio-model/requirements.txt

```
openai>=1.12.0
python-dotenv>=1.0.0
pandas>=2.0.0
anthropic>=0.18.0
metapub==0.6.4
reportlab>=4.0.0
PyPDF2>=3.0.0
PyMuPDF>=1.23.0

```

### front end/package.json

```
{
  "name": "carebnb",
  "version": "0.1.0",
  "private": true,
  "rocketCritical": {
    "dependencies": [
      "@dhiwise/component-tagger",
      "react",
      "react-dom",
      "@reduxjs/toolkit",
      "redux",
      "react-router-dom"
    ],
    "devDependencies": [
      "@vitejs/plugin-react",
      "vite",
      "vite-tsconfig-paths",
      "tailwindcss",
      "autoprefixer",
      "postcss"
    ],
    "scripts": [
      "start",
      "build",
      "serve"
    ],
    "warning": "🚨 CRITICAL: DO NOT REMOVE OR MODIFY ABOVE DEPENDENCIES - Required for app functionality"
  },
  "dependencies": {
    "@dhiwise/component-tagger": "^1.0.14",
    "@radix-ui/react-slot": "^1.2.3",
    "@reduxjs/toolkit": "^2.6.1",
    "@supabase/supabase-js": "^2.95.3",
    "@tailwindcss/forms": "^0.5.7",
    "@testing-library/jest-dom": "^5.15.1",
    "@testing-library/react": "^11.2.7",
    "@testing-library/user-event": "^12.8.3",
    "axios": "^1.8.4",
    "class-variance-authority": "^0.7.1",
    "clsx": "^2.1.1",
    "d3": "^7.9.0",
    "date-fns": "^4.1.0",
    "dotenv": "^16.0.1",
    "framer-motion": "^10.16.4",
    "lucide-react": "^0.484.0",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-helmet": "^6.1.0",
    "react-hook-form": "^7.55.0",
    "react-router-dom": "6.0.2",
    "react-router-hash-link": "^2.4.3",
    "recharts": "^2.15.2",
    "redux": "^5.0.1",
    "tailwind-merge": "^3.3.1",
    "tailwindcss-animate": "^1.0.7",
    "tailwindcss-elevation": "^2.0.0",
    "tailwindcss-fluid-type": "^2.0.7"
  },
  "scripts": {
    "start": "vite",
    "build": "vite build --sourcemap",
    "serve": "vite preview"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "devDependencies": {
    "@tailwindcss/aspect-ratio": "^0.4.2",
    "@tailwindcss/container-queries": "^0.1.1",
    "@tailwindcss/line-clamp": "^0.1.0",
    "@tailwindcss/typography": "^0.5.16",
    "@vitejs/plugin-react": "4.3.4",
    "autoprefixer": "10.4.2",
    "postcss": "8.4.8",
    "tailwindcss": "3.4.6",
    "vite": "5.0.0",
    "vite-tsconfig-paths": "3.6.0"
  }
}

```

### src/App.jsx

```javascript
import React from "react";
import Routes from "./Routes";

function App() {
  return (
    <Routes />
  );
}

export default App;

```

### src/index.jsx

```javascript
import React from "react";
import { createRoot } from "react-dom/client";
import App from "./App";
import "./styles/tailwind.css";
import "./styles/index.css";

const container = document.getElementById("root");
const root = createRoot(container);

root.render(<App />);

```

### app/layout.tsx

```typescript
import type { Metadata } from "next";
import { Inter, Source_Serif_4 } from "next/font/google";
import "./globals.css";
import AppHeader from "@/components/AppHeader";

const inter = Inter({
  subsets: ["latin"],
  variable: "--font-inter",
  display: "swap",
  weight: ["400", "500", "600", "700"],
});

const sourceSerif = Source_Serif_4({
  subsets: ["latin"],
  variable: "--font-source-serif",
  display: "swap",
  weight: ["400", "600", "700"],
});

export const metadata: Metadata = {
  title: "CareBnb — Find care near you",
  description: "Book local care providers or find open care requests.",
};

export default function RootLayout({
  children,
}: Readonly<{
  children: React.ReactNode;
}>) {
  return (
    <html lang="en" className={`${inter.variable} ${sourceSerif.variable}`}>
      <body className="min-h-screen w-full min-w-0 antialiased bg-stone-50 text-stone-900 font-sans">
        <AppHeader />
        <main className="w-full min-w-0 max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-6 sm:py-8">{children}</main>
      </body>
    </html>
  );
}

```

### app/page.tsx

```typescript
import Link from "next/link";

/**
 * Simple landing page at localhost:3000/ — explains the site and links to the app.
 */
export default function HomePage() {
  return (
    <div className="max-w-xl mx-auto py-12 px-4">
      <h1 className="text-2xl font-semibold text-stone-900 mb-2">
        CareBnB
      </h1>
      <p className="text-stone-600 mb-6">
        Find and book local care providers, or post a care request for providers to respond to.
      </p>

      <div className="space-y-3 mb-8">
        <p className="text-sm text-stone-700">
          <strong>Patients</strong> — Search for providers, book visits, and request care.
        </p>
        <p className="text-sm text-stone-700">
          <strong>Providers</strong> — See open requests and manage your jobs.
        </p>
      </div>

      <div className="flex flex-col gap-3">
        <Link
          href="/login"
          className="block w-full py-3 px-4 rounded-xl bg-primary text-primary-foreground font-medium text-center hover:opacity-90"
        >
          Patient log in
        </Link>
        <Link
          href="/signup"
          className="block w-full py-3 px-4 rounded-xl border-2 border-primary text-primary font-medium text-center hover:bg-primary/5"
        >
          Patient sign up
        </Link>
        <Link
          href="/login?role=provider"
          className="block w-full py-3 px-4 rounded-xl border border-stone-300 text-stone-700 font-medium text-center hover:bg-stone-50"
        >
          Provider log in
        </Link>
        <Link
          href="/signup?role=provider"
          className="block w-full py-3 px-4 rounded-xl border border-stone-300 text-stone-700 font-medium text-center hover:bg-stone-50"
        >
          Provider sign up
        </Link>
      </div>
    </div>
  );
}

```

### front end/src/App.jsx

```javascript
import React from "react";
import Routes from "./Routes";
import { AuthProvider } from "./context/AuthContext";

function App() {
  return (
    <AuthProvider>
      <Routes />
    </AuthProvider>
  );
}

export default App;

```

[190 more indexed source files omitted to keep this export small. The full file list is in the Codebase structure section above.]