Overview
This guide covers how the two frontend projects (conformly-frontend and conformly-web) integrate with the Conformly.ai backend API.
Base Configuration
API Base URL
| Environment | URL |
|---|---|
| Local dev | http://localhost:8000/api/v1 |
| Production | https://beta-api.conformly.ai/api/v1 |
VITE_API_BASE_URL in each frontend’s .env file.
Authentication
All API requests (except/payments/*) require a valid Supabase JWT token:
Auth + Subscription Flow
The platform frontend (conformly-frontend) implements a ProtectedRoute component that:
- Checks session: On load, validates the Supabase session
- Syncs profile: Calls
POST /auth/syncto activate free plan or migrate pending subscriptions - Checks subscription: Calls
GET /auth/meand readssubscription_status - Gates access: Renders the app if
subscription_status === 'active', redirects to/subscribeotherwise
Common Patterns
File Upload Flow
- Initialize upload:
POST /standards/{id}/uploads/initorPOST /work-products/uploads/init - Upload file to the returned presigned URL
- Complete upload:
POST /standards/{id}/uploads/{upload_id}/complete
Analysis Tracking Flow
- Start analysis:
POST /analysis/gaps(returns immediately with job ID) - Poll analyses:
GET /analysis/analyses?workspace_id=...to check status (pending→processing→completed) - Get results:
GET /analysis/analyses/{id}for gaps and recommendations
Payment Flow
The marketing site (conformly-web) handles the pricing → payment flow:
- User selects a plan on the marketing site pricing section
- Frontend calls
POST /payments/create-checkout-sessionwith the selected plan - User is redirected to Stripe Checkout
- On success, Stripe redirects to
STRIPE_SUCCESS_URL(the platform frontend/payment-successpage) - The payment success page calls
GET /payments/session-info/{session_id}and displays confirmation - On next login,
POST /auth/syncmigrates the pending subscription to the user profile
Error Handling
All endpoints return consistent error responses:Response Formats
Paginated Response
User Profile Response (GET /auth/me)
Cross-Project URL References
| From | To | Variable | Example |
|---|---|---|---|
| conformly-web | conformly-frontend | VITE_APP_URL | Navigation login/signup links |
| conformly-frontend | conformly-web | VITE_WEB_URL | Subscribe page pricing link |
API Reference
Browse all API endpoints
Configuration
Backend environment variables