Commit graph

210 commits

Author SHA1 Message Date
michael
3f1e1b5227 Fix React version mismatch with MSAL packages
Downgrade React from 19.x to 18.3.1 for compatibility with
@azure/msal-react v3.x which requires React 18.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 10:31:01 -06:00
michael
0742cc0aa4 Fix DISABLE_AUTH check in get_current_user dependency
The auth dependency was requiring the Authorization header before
checking DISABLE_AUTH, causing API endpoints to fail in dev mode.
Now returns mock user immediately when DISABLE_AUTH=true.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 10:15:37 -06:00
michael
99af0164e6 Add PostgreSQL database support with Alembic migrations
Backend:
- Add PostgreSQL service to docker-compose with health checks
- Add SQLAlchemy async models for all entities (Agency, User, Campaign,
  Proof, ProofVersion, FlaggedItem, ResolvedItem, ErrorItem)
- Add Alembic migration framework with initial schema migration
- Add repository layer for CRUD operations
- Add REST API endpoints for campaigns, proofs, and audit items
- Add file storage service for proof uploads
- Update WebSocket handler to optionally persist analysis results

Frontend:
- Add apiService.ts for REST API communication
- Update geminiService.ts to support database persistence options

Deployment:
- Update deploy.sh to handle database migrations (6-step process)
- Update Dockerfile to include alembic configuration
- Add PostgreSQL environment variables to .env templates

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 12:27:18 -06:00
michael
321a9ca820 Implement Microsoft MSAL SSO with PKCE flow
Frontend:
- Add @azure/msal-browser and @azure/msal-react packages
- Create authConfig.ts with MSAL configuration for PKCE flow
- Create authService.ts for token acquisition and user info
- Wrap App with MsalProvider in index.tsx
- Replace dummy login with real MSAL loginPopup() in Login.tsx
- Update App.tsx to use useIsAuthenticated/useMsal hooks
- Update Profile.tsx to display real user data from claims
- Update geminiService.ts to include access_token in WebSocket messages
- Update WIPReviewer.tsx to pass msalInstance for auth

Backend:
- Add python-jose and httpx dependencies for JWT verification
- Create auth_service.py with Azure AD JWKS fetching and token verification
- Create auth.py FastAPI dependency for protected REST endpoints
- Update main.py to verify tokens on WebSocket and protect /info endpoint
- Add AZURE_TENANT_ID, AZURE_CLIENT_ID, DISABLE_AUTH to config

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 08:43:30 -06:00
michael
3df1b9fb92 Auto-generate .env for docker compose commands
The deploy script now creates a .env file with COMPOSE_PROJECT_NAME
and BACKEND_PORT so that manual docker compose commands (ps, logs, etc.)
work without needing to set environment variables.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 06:37:41 -06:00
michael
27113a625a Support multiple instances (prod/dev) on same server
- Add COMPOSE_PROJECT_NAME for unique container names
- Add BACKEND_PORT for configurable port mapping
- Update deploy.sh to export variables for docker compose
- Update health checks to use configured port

Allows running prod and dev instances simultaneously by cloning
the repo twice with different .env.deploy configurations.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-15 15:10:20 -06:00
michael
834de7d74c Add deployment script for Ubuntu server
- Add deploy.sh for automated deployment (idempotent)
- Add .env.deploy.example template for server configuration
- Update .gitignore to exclude .env.deploy

The script handles both first-time install and updates:
- Pulls latest code from git
- Builds frontend with production URLs
- Deploys to Apache document root
- Rebuilds and restarts Docker backend
- Includes health check verification

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-15 14:50:49 -06:00
michael
1e2082b642 Add Docker support for backend
- Add Dockerfile for Python 3.12-slim based backend image
- Add docker-compose.yml for service orchestration
- Add .dockerignore to optimize build context
- Include health check and reference docs in container

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-15 14:34:18 -06:00
michael
808326ea36 Add README and update .gitignore
- Add comprehensive README with project overview, architecture,
  setup instructions, and API documentation
- Expand .gitignore with Python testing/linting, Vite cache,
  coverage reports, and additional IDE/OS entries

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-15 14:14:11 -06:00
michael
e97d0e935c initial commit 2025-12-12 09:03:17 -06:00