This directory contains the backend API for the Content Calendar Analysis application.
index.ts - Main entry point for the APIdatabase/ - Database schema and queries
schema.ts - Database table definitionsqueries.ts - Database operationsroutes/ - API route handlers
auth.ts - Authentication endpointsanalysis.ts - Content analysis endpointsswagger.ts - API documentationPOST /api/auth/register - Register a new leadPOST /api/auth/login - Login with existing credentialsPOST /api/auth/logout - Logout and invalidate sessionGET /api/auth/session - Get current session informationPOST /api/analysis/generate - Generate a new content calendar analysisGET /api/analysis/:id - Get a specific analysis by UUIDGET /api/analysis - List all analyses for the authenticated leadGEMINI_API_KEY - Google Gemini API key for content generationThe application uses SQLite for data storage with the following tables:
leads_v1 - User information and credentialssessions_v1 - Authentication sessionsanalyses_v1 - Stored content calendar analyses