Set up Convex as the backend database/real-time layer for the app.
Next Steps:
Create a new Convex project and initialize it in the repo (npx convex dev)
Define initial schema for core data models (users, conversations, messages)
Configure environment variables for dev and production
Verify real-time sync works end-to-end with a simple test query
Clerk Auth Setup
Integrate Clerk for user authentication and session management.
Next Steps:
Install Clerk SDK and add publishable/secret keys to env
Wrap the app with <ClerkProvider> and configure sign-in/sign-up flows
Connect Clerk user identity to Convex (use Clerk JWT template for Convex)
Test auth flow: sign up → sign in → session persistence
Proxy AI Requests through Backend
Route all AI API calls through the backend instead of the client directly.
Next Steps:
Create a backend endpoint (e.g., Convex action or API route) that wraps AI calls
Move API keys server-side and remove any client-side AI calls
Add request validation and rate limiting to the proxy endpoint
Update frontend to call the proxy instead of the AI provider directly
Security
Secure API Access & Auth
Lock down API endpoints so only authenticated users can access them.
Next Steps:
Add auth middleware to all backend routes (validate Clerk JWT on every request)
Return 401 for unauthenticated requests and 403 for unauthorized ones
Audit existing endpoints for any gaps in auth coverage
Write tests for protected vs. unprotected route behavior
Chat & Conversation Ownership Check
Ensure users can only access their own chats and conversations.
Next Steps:
Add ownerId field to conversation/message schemas in Convex
Enforce ownership checks in all read/write queries (filter by ctx.auth.userId)
Test that user A cannot fetch or mutate user B's conversations
Add server-side guards — don't rely solely on client-side filtering
Feature
Connect Slack Data to Arlo
Pipe Slack workspace data into Arlo for use in conversations/context.
Next Steps:
Set up a Slack app with required OAuth scopes (channels:history, users:read, etc.)
Build an ingestion pipeline to fetch and store Slack messages in Convex
Define how Slack data maps to Arlo's data model (threads → conversations?)
Surface Slack context in the Arlo UI and verify it appears correctly in AI responses
Suggested order of work: Convex Setup → Clerk Auth → Secure API Access → Proxy AI Requests → Ownership Check → Slack Integration. The first four unblock everything else.