# pavithra20august/crewai-crash-course architecture

> Architecture diagram of the GitHub repository pavithra20august/crewai-crash-course, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pavithra20august/crewai-crash-course
- Repository: https://github.com/pavithra20august/crewai-crash-course

## Overview

#### Purpose and Entry Points
This is a CrewAI startup-idea validation application. It turns an idea into market, technical, and strategic analysis, then produces a GO/NO-GO/CONDITIONAL report.

Entry points:
- CLI: `main.py`
- FastAPI/SSE server and static UI host: `api.py`
- Browser client: `frontend/index.html`, `frontend/app.js`

#### Crew Orchestration
`crew.py` assembles four agents and their ordered tasks into a CrewAI `Process.sequential` workflow. The crew kickoff is the central execution boundary: inputs become task outputs, then a final synthesized report.

Primary flow: idea → research → feasibility → strategy → compiled verdict.
- `crew.py`
- `main.py`
- `api.py`

#### Agent Layer
`agents.py` defines the specialized AI workers: market researcher, technology analyst, strategist, and report compiler. Their roles, prompts/goals, assigned tools, and configured LLM establish the model-facing behavior boundary.

Agents are not invoked directly by the UI; CrewAI dispatches them through their assigned tasks.
- `agents.py`
- `crew.py`

#### Task Pipeline and Context Chaining
`tasks.py` specifies each agent’s deliverable and binds it to an agent. Later analysis and report tasks consume preceding task output through task context, making the sequential ordering semantically important rather than merely operational.

The final report task is responsible for synthesis and persisted report output.
- `tasks.py`
- `crew.py`

#### Tool and External-Service Boundary
`tools.py` exposes CrewAI-decorated callable tools for web research, market calculations, and SWOT-oriented analysis. Web search can use Tavily when configured and has a mock/fallback path; agents decide tool use from tool descriptions.

The LLM is Gemini-backed and requires environment-provided API credentials. Tavily is optional.
- `tools.py`
- `agents.py`
- `.env.example`

#### CLI Execution Path
`main.py` accepts an optional startup-idea argument, constructs/runs the crew, and presents the resulting analysis. It is the simplest integration surface for local and scripted execution.
- `main.py`
- `crew.py`

#### API Streaming and Frontend
`api.py` provides the web execution path: it accepts an idea, runs the same crew workflow, captures runtime stdout/activity, and streams updates to the browser using Server-Sent Events. This separates long-running LLM orchestration from client rendering.

The static frontend submits ideas, displays agent activity, and renders the completed report.
- `api.py`
- `frontend/app.js`
- `frontend/index.html`

Main entry points: [`api.py`](https://github.com/pavithra20august/crewai-crash-course/blob/main/api.py) (FastAPI + SSE server), [`tasks.py`](https://github.com/pavithra20august/crewai-crash-course/blob/main/tasks.py) (Task pipeline), [`agents.py`](https://github.com/pavithra20august/crewai-crash-course/blob/main/agents.py) (Specialist agents), [`crew.py`](https://github.com/pavithra20august/crewai-crash-course/blob/main/crew.py) (Sequential crew)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry Points"]
  node_cli["CLI runner<br/>Python entry point<br/>[main.py]"]
end

subgraph group_orchestration["Crew Workflow"]
  node_crew{{"Sequential crew<br/>CrewAI orchestration<br/>[crew.py]"}}
  node_tasks["Task pipeline<br/>CrewAI tasks<br/>[tasks.py]"]
  node_research["Market research<br/>task stage"]
  node_feasibility["Technical feasibility<br/>task stage"]
  node_strategy["Strategic analysis<br/>task stage"]
  node_report["Compiled verdict<br/>report stage"]
end

subgraph group_ai["AI Boundary"]
  node_agents["Specialist agents<br/>CrewAI agents<br/>[agents.py]"]
  node_tools["Research and analysis tools<br/>CrewAI tools<br/>[tools.py]"]
  node_gemini(("Gemini LLM<br/>external AI service"))
  node_tavily(("Tavily search<br/>optional external service"))
  node_env["Environment credentials<br/>configuration contract<br/>[.env.example]"]
end

subgraph group_web["Web Experience"]
  node_api["FastAPI + SSE server<br/>Python server<br/>[api.py]"]
  node_frontend["Browser client<br/>static frontend<br/>[app.js]"]
  node_frontend_html["Static UI host<br/>HTML page<br/>[index.html]"]
end

node_cli -->|"runs"| node_crew
node_api -->|"runs"| node_crew
node_frontend_html -->|"loads"| node_frontend
node_frontend -->|"submits idea / receives SSE"| node_api
node_api -->|"streams activity and report"| node_frontend
node_crew -->|"orders"| node_tasks
node_tasks -->|"binds tasks to"| node_agents
node_tasks -->|"starts"| node_research
node_research -->|"context"| node_feasibility
node_feasibility -->|"context"| node_strategy
node_strategy -->|"context"| node_report
node_agents -->|"may invoke"| node_tools
node_agents -->|"uses"| node_gemini
node_tools -.->|"searches when configured"| node_tavily
node_env -.->|"configures credentials"| node_gemini
node_env -.->|"optional configuration"| node_tavily
node_report -->|"presented by"| node_cli
node_report -->|"streamed by"| node_api

click node_cli "https://github.com/pavithra20august/crewai-crash-course/blob/main/main.py"
click node_api "https://github.com/pavithra20august/crewai-crash-course/blob/main/api.py"
click node_frontend "https://github.com/pavithra20august/crewai-crash-course/blob/main/frontend/app.js"
click node_frontend_html "https://github.com/pavithra20august/crewai-crash-course/blob/main/frontend/index.html"
click node_crew "https://github.com/pavithra20august/crewai-crash-course/blob/main/crew.py"
click node_tasks "https://github.com/pavithra20august/crewai-crash-course/blob/main/tasks.py"
click node_agents "https://github.com/pavithra20august/crewai-crash-course/blob/main/agents.py"
click node_tools "https://github.com/pavithra20august/crewai-crash-course/blob/main/tools.py"
click node_env "https://github.com/pavithra20august/crewai-crash-course/blob/main/.env.example"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli toneBlue
class node_crew,node_tasks,node_research,node_feasibility,node_strategy,node_report toneAmber
class node_agents,node_tools,node_gemini,node_tavily,node_env toneMint
class node_api,node_frontend,node_frontend_html toneRose
```

## Components

### Entry Points

- [CLI runner](https://github.com/pavithra20august/crewai-crash-course/blob/main/main.py): Python entry point · Accepts an idea and presents the analysis. · `main.py`

### Crew Workflow

- [Sequential crew](https://github.com/pavithra20august/crewai-crash-course/blob/main/crew.py): CrewAI orchestration · Central kickoff boundary for ordered validation work. · `crew.py`
- [Task pipeline](https://github.com/pavithra20august/crewai-crash-course/blob/main/tasks.py): CrewAI tasks · Chains research, feasibility, strategy, and report context. · `tasks.py`
- **Market research**: task stage
- **Technical feasibility**: task stage
- **Strategic analysis**: task stage
- **Compiled verdict**: report stage · Produces the GO/NO-GO/CONDITIONAL synthesis and persisted output.

### AI Boundary

- [Specialist agents](https://github.com/pavithra20august/crewai-crash-course/blob/main/agents.py): CrewAI agents · Defines roles, prompts, tools, and configured LLM. · `agents.py`
- [Research and analysis tools](https://github.com/pavithra20august/crewai-crash-course/blob/main/tools.py): CrewAI tools · Provides web search, market calculations, and SWOT analysis. · `tools.py`
- **Gemini LLM**: external AI service · Requires environment-provided credentials.
- **Tavily search**: optional external service · Web research uses a mock or fallback when unavailable.
- [Environment credentials](https://github.com/pavithra20august/crewai-crash-course/blob/main/.env.example): configuration contract · Documents required Gemini and optional Tavily settings. · `.env.example`

### Web Experience

- [FastAPI + SSE server](https://github.com/pavithra20august/crewai-crash-course/blob/main/api.py): Python server · Runs crews and streams captured activity. · `api.py`
- [Browser client](https://github.com/pavithra20august/crewai-crash-course/blob/main/frontend/app.js): static frontend · Submits ideas, shows activity, and renders reports. · `frontend/app.js`
- [Static UI host](https://github.com/pavithra20august/crewai-crash-course/blob/main/frontend/index.html): HTML page · `frontend/index.html`

## Connections

- CLI runner → Sequential crew: runs
- FastAPI + SSE server → Sequential crew: runs
- Static UI host → Browser client: loads
- Browser client → FastAPI + SSE server: submits idea / receives SSE
- FastAPI + SSE server → Browser client: streams activity and report
- Sequential crew → Task pipeline: orders
- Task pipeline → Specialist agents: binds tasks to
- Task pipeline → Market research: starts
- Market research → Technical feasibility: context
- Technical feasibility → Strategic analysis: context
- Strategic analysis → Compiled verdict: context
- Specialist agents → Research and analysis tools: may invoke
- Specialist agents → Gemini LLM: uses
- Research and analysis tools → Tavily search: searches when configured
- Environment credentials → Gemini LLM: configures credentials
- Environment credentials → Tavily search: optional configuration
- Compiled verdict → CLI runner: presented by
- Compiled verdict → FastAPI + SSE server: streamed by
