How jasonlryan/cmo works
Project Overview
• The project is the CMO Assessment Tool, a system for evaluating Chief Marketing Officer candidates. It integrates multiple processes such as transcript analysis (using OpenAI), skill scoring, depth level assessment, and generating comprehensive reports.
• The codebase is divided into frontend and backend, with the backend containing the core service logic, configuration files, prompt management, and database integration via Supabase.
Main Components
• Frontend – handles UI, interfaces, and user interactions (found in the frontend directory).
• Backend – the core processing area, with subdirectories that include:
• config: Contains benchmark and depth level configurations.
• prompts: Manages OpenAI prompt data and the loader for transcript analysis.
• services: Contains the primary service modules implementing business logic.
• templates: Provides JS templates for generating profiles and reports.
• tests: Contains test cases for backend functionality.
• Documentation and scripts – supporting files that provide guidelines and development utilities.
Service Components (in backend/services)
• assessment.js: Likely contains logic to aggregate data, compute assessments, and coordinate scoring.
• openai.js: Handles the integration with the OpenAI API used for analyzing transcripts.
• scoring.js: Implements algorithms to determine candidate scores based on input data.
• startup.js: Likely initializes services and runs any onboarding or startup procedures.
• supabase.js: Manages interactions with Supabase, including data storage or retrieval.
Diagramming the Service Components and Their Interactions
• “Config” (configuration files such as benchmarks.json and depthLevels.json).
• “Prompts” (housing OpenAI-related files and promptLoader.js).
• “Services” (the core focus – assessment, openai, scoring, startup, and supabase).
• “Templates” (for generating data structures such as CMO Profiles and reports).
• “Tests” (for validating backend functionality).
• “Assessment Service”: Coordinates the overall candidate evaluation by using inputs from other services.
• “Supabase Service”: Manages persistence by updating or retrieving candidate records. This service might interact with both the Assessment and Scoring services for saving the results.
• “Startup Service”: Handles initialization tasks that ensure all services are properly bootstrapped.
c. Relationships:
• “Prompts” component to the “OpenAI Service,” noting that prompts are loaded using a dedicated promptLoader.
• Optionally, show how “Templates” feed into report generation based on outputs from the “Assessment Service.”
Important Architectural Patterns & Design Principles
• Modular design: The backend is separated into distinct units — services, configuration, and prompts — each with a specific responsibility.
• Clear separation of concerns: Each service module (assessment, scoring, openai, startup, supabase) encapsulates its own functionality, which facilitates maintainability and testing.
• Dependency management: Services interact through well-defined interfaces, for example, the Assessment Service consuming outputs from OpenAI and Scoring Services.
• Integration with external APIs: Special emphasis on the OpenAI integration, which is centrally managed through the OpenAI Service, while database operations are abstracted by the Supabase Service.