A privacy-first visual change awareness tool that helps individuals track breast health changes over time through standardized self-monitoring. Compares you against your own history - not population averages.
- What is BCD?
- Architecture
- How It Works
- Tech Stack
- Getting Started
- Project Structure
- Privacy & Security
- API Overview
- Documentation
- Contributing
- License
BCD provides a structured, consistent framework for visual self-monitoring, bridging the gap between irregular self-checks and clinical screenings.
| Purpose | Benefit |
|---|---|
| Monitor visual changes | Consistent photo documentation over time |
| Compare with personal history | 6-angle standardized captures |
| Detect subtle changes | ML-powered comparison against your baseline |
| Decide on professional consultation | Data-driven awareness |
| Scenario | Frequency | Benefit |
|---|---|---|
| Regular monitoring | Monthly | Establish personal baseline, track normal changes |
| Post-surgery follow-up | Weekly/Bi-weekly | Monitor healing and recovery progress |
| Family history concerns | Bi-weekly | Early awareness for higher-risk individuals |
| Between clinical appointments | Monthly | Maintain awareness during 6β12 month gaps |
flowchart TB
subgraph Frontend["Frontend - Vercel"]
A[React 19 + TypeScript]
B[Tailwind CSS]
C[React Router v7]
D[Supabase JS Client]
end
subgraph Backend["Backend - Azure VM"]
E[FastAPI + Uvicorn]
F[MobileNetV3-Small - 576-dim ONNX]
G[OpenCV Pipeline - CLAHE + Denoise + Crop]
H[JWT Auth - PyJWT + JWKS]
end
subgraph Storage["Storage - Supabase"]
I[(PostgreSQL - Sessions + Analysis)]
J[(Storage Bucket - bcd-images)]
K[Row-Level Security - Per-user isolation]
end
A -->|Auth + Storage| D
D -->|Supabase SDK| Storage
E -->|Service Role Key| Storage
F --> G
A -->|REST API| E
E --> H
sequenceDiagram
participant U as User
participant F as Frontend
participant B as Backend API
participant S as Supabase
participant M as ML Pipeline
U->>F: Capture 6 angles
F->>S: Upload images
F->>B: POST /analyze-session/{id}
B->>S: Fetch images
B->>M: Preprocess + Embed
M->>M: MobileNetV3-Small (ONNX)
M->>B: Change scores
B->>S: Store analysis
B->>F: Return results
F->>U: Display comparison
Sign Up β Accept Disclaimer β Capture 6 Angles β Save Session β ML Analysis β Compare History
Each session requires captures from all 6 standardized angles:
| Angle | Position | Purpose |
|---|---|---|
| Front view | Arms at sides, shoulders relaxed | Baseline symmetry reference |
| Left side | 90Β° turn, steady posture | Left side profile |
| Right side | 90Β° turn, steady posture | Right side profile |
| Upward angle | Camera below, tilted up | Underside perspective |
| Downward angle | Camera above, tilted down | Top-down view |
| Full body | Step back for full torso | Overall proportions |
Pro Tip: Capture multiple images per angle - the system uses all images for comparison, improving reliability.
| Technology | Version | Purpose |
|---|---|---|
| React | 19 | UI library |
| TypeScript | 5.9 | Type safety |
| Vite | 7 | Build tool & dev server |
| Tailwind CSS | 3 | Utility-first styling |
| React Router | 7 | Client-side navigation |
| Supabase JS | 2 | Auth & storage client |
| Lucide React | 0.564 | Icon library |
| Technology | Version | Purpose |
|---|---|---|
| Python | 3.11 | Runtime |
| FastAPI | 0.110 | Web framework |
| ONNX Runtime | 1.21 | ML inference (MobileNetV3-Small, 576-dim) |
| OpenCV | 4.8 | Image preprocessing (CLAHE, denoise, crop) |
| Supabase Python | 2.10 | Database & storage client |
| PyJWT | 2.8 | JWT verification (JWKS) |
| SlowAPI | 0.1 | Rate limiting |
| Component | Platform |
|---|---|
| Frontend | Vercel |
| Backend | Azure VM (via nginx + systemd) |
| Database | Supabase PostgreSQL |
| Storage | Supabase Storage (S3-compatible, private bucket) |
- Visit the web app
- Sign up with email/password
- Read and accept the disclaimer
- Capture your first session (6 angles)
- Return monthly to compare progress
# Clone repository
git clone https://github.com/muneer406/BCD.git
cd BCD/frontend
# Install dependencies
npm install
# Configure environment
cp .env.example .env.local
# Add your Supabase credentials (URL + anon key)
# Run development server
npm run devcd BCD/backend
# Create virtual environment
uv venv
source .venv/bin/activate # Linux/Mac
# .venv\Scripts\activate # Windows
# Install dependencies (recommended: using uv)
uv pip install -r requirements.txt
# Alternative: using pip
# pip install -r requirements.txt
# Configure environment
cp .env.example .env
# Add SUPABASE_URL and SUPABASE_SERVICE_ROLE_KEY
# Run server
uvicorn app.main:app --reloadcd BCD/backend
docker compose up --build
# Frontend: http://localhost:5173
# Backend: http://localhost:8000
# API Docs: http://localhost:8000/api/docsBCD/
βββ frontend/ # React + TypeScript UI (Vercel)
β βββ src/
β β βββ components/ # Reusable UI (Button, Card, ErrorBoundary, etc.)
β β βββ pages/ # Route pages (Capture, History, Result, etc.)
β β βββ context/ # Auth, Draft, SessionCache providers
β β βββ lib/ # API client, Supabase client, constants
β β βββ data/ # Static data (capture steps)
β βββ public/ # Static assets (logo)
β βββ Dockerfile # Production container
β βββ tailwind.config.js
β βββ package.json
β
βββ backend/ # FastAPI + ML pipeline (HF Spaces)
β βββ app/
β β βββ api/ # Route handlers (thin controllers)
β β βββ services/ # Business logic, ML pipeline, DB access
β β βββ processing/ # Preprocessing, embeddings, quality scoring
β β βββ utils/ # JWT verification, input validation
β βββ tests/ # pytest suite (55+ tests)
β βββ scripts/ # Migration runner
β βββ Dockerfile # Multi-stage CPU-only PyTorch
β βββ docker-compose.yml
β βββ requirements.txt
β
βββ .github/workflows/ # CI/CD (tests + HF Spaces sync)
βββ SUPABASE_MIGRATIONS.sql # Database schema + RLS policies
βββ SECURITY.md # Security & privacy documentation
βββ README.md
| Feature | Implementation |
|---|---|
| Authentication | Supabase Auth with email/password |
| API Authorization | JWT verification via JWKS (ES256) |
| Data Isolation | Row-Level Security (RLS) on all tables |
| Image Storage | Private Supabase bucket, signed URLs (5 min expiry) |
| Access Control | Users can only see/delete their own data |
| Encryption | HTTPS in transit, encrypted at rest |
| CORS | Explicit allow-list required in production |
| CSP | Content-Security-Policy headers on frontend + backend |
| Rate Limiting | Per-endpoint (analysis: 20/day, utility: 30/min, auth: 5/hr) |
| Input Validation | UUID format + image type validation on all endpoints |
Privacy Promise: Your images are stored securely, never shared, and completely isolated from other users. You own your data. Session and data deletion is available from the History page.
| Endpoint | Method | Auth | Rate Limit | Purpose |
|---|---|---|---|---|
/health |
GET | No | - | Health check |
/api/analyze-session/{id} |
POST | Yes | 20/day | Run ML analysis on session |
/api/analyze-status/{id} |
GET | Yes | - | Poll async analysis status |
/api/compare-sessions/{c}/{p} |
POST | Yes | - | Compare two sessions |
/api/session-info/{id} |
GET | Yes | 30/min | Session metadata |
/api/image-preview/{id}/{type} |
GET | Yes | 30/min | Signed image URLs |
/api/session-thumbnails/{id} |
GET | Yes | 30/min | Batch image previews |
/api/delete-session/{id} |
DELETE | Yes | - | Delete session + all data |
/api/sessions/{id}/analysis |
GET | Yes | - | Read stored analysis |
/api/generate-report/{id} |
POST | Yes | - | Report (stub) |
/api/docs |
GET | No | - | Interactive API docs (Swagger) |
Full documentation: BACKEND_DOCS.md
| Guide | Description |
|---|---|
| BACKEND_DOCS.md | Complete backend reference - setup, API, ML pipeline, deployment |
| frontend/README.md | Frontend setup and development |
| backend/README.md | Backend quick-start |
| SUPABASE_MIGRATIONS.sql | Database schema with RLS policies |
| ADRs | Architecture Decision Records β key design decisions and tradeoffs |
| SECURITY.md | Security practices and privacy roadmap |
| API Docs | Interactive Swagger UI (local dev) |
# Backend tests (55+ tests, all external deps mocked)
cd backend
pytest tests/ -v
# Frontend type check + lint
cd frontend
npx tsc -b --noEmit
npm run lintContributions welcome! Please:
- Follow the existing code style
- Maintain neutral, non-diagnostic language (enforced by tests)
- Test thoroughly with multiple users
- Update documentation
- All commits should reference the issue number
MIT License - see LICENSE for details.
Built with:
- Supabase - Open-source Firebase alternative
- PyTorch - ML framework
- FastAPI - Python web framework
- React - UI library
- Tailwind CSS - CSS framework
- Hugging Face Spaces - ML deployment
Making breast health awareness accessible, one session at a time. ποΈ
