# eugene234466/marketmindai architecture

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

- Interactive diagram: https://gitdiagram.com/eugene234466/marketmindai
- Repository: https://github.com/eugene234466/marketmindai

## Overview

MarketMind AI is a Flask product for evaluating business ideas and returning a combined market-intelligence report. The main workflow runs AI insights, market research, competitor research, and ecommerce listing collection in parallel, then uses market data for revenue forecasting and niche discovery. The README also documents report generation and email delivery; routes and database internals were not excerpted, so their detailed wiring is not asserted.

Main entry points: [`core/analyze.py`](https://github.com/eugene234466/marketmindai/blob/main/core/analyze.py) (Analysis pipeline), [`app/routes.py`](https://github.com/eugene234466/marketmindai/blob/main/app/routes.py) (Web routes), [`core/market_researcher.py`](https://github.com/eugene234466/marketmindai/blob/main/core/market_researcher.py) (Market trends), [`app/__init__.py`](https://github.com/eugene234466/marketmindai/blob/main/app/__init__.py) (Flask application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_flask["Flask application<br/>[__init__.py]"]
  node_routes["Web routes<br/>[routes.py]"]
  node_templates["Web pages"]
  node_charts["Dashboard charts<br/>[charts.js]"]
  node_main["Application entry point<br/>[main.py]"]
end

subgraph group_analysis["Idea analysis"]
  node_pipeline["Analysis pipeline<br/>[analyze.py]"]
  node_insights["AI idea insights<br/>[groq_client.py]"]
  node_forecast["Sales forecast<br/>[sales_predictor.py]"]
  node_niches["Niche discovery"]
end

subgraph group_research["Market research"]
  node_market["Market trends"]
  node_competitors["Competitor analysis"]
  node_ecommerce["Ecommerce listings"]
end

subgraph group_delivery["Reports and delivery"]
  node_report["PDF reports"]
  node_email["Email delivery<br/>[email_sender.py]"]
end

subgraph group_state["Persistence"]
  node_db[("PostgreSQL<br/>[db.py]")]
  node_config["Application config<br/>[config.py]"]
end

node_user(("Business owner"))
node_groq{{"Groq API"}}
node_trends_service{{"Google Trends"}}
node_commerce_sites{{"Commerce sites"}}
node_email_service{{"Resend"}}

node_user -.->|"submits idea"| node_routes
node_flask -->|"registers routes"| node_routes
node_routes -.->|"renders pages"| node_templates
node_routes -.->|"starts analysis"| node_pipeline
node_routes -.->|"uses persistence"| node_db
node_pipeline -->|"runs analysis"| node_insights
node_pipeline -->|"fetches market data"| node_market
node_pipeline -->|"fetches competitors"| node_competitors
node_pipeline -->|"fetches listings"| node_ecommerce
node_pipeline -->|"forecasts sales"| node_forecast
node_pipeline -->|"identifies niches"| node_niches
node_market -->|"queries trends"| node_trends_service
node_market -->|"requests summary"| node_insights
node_competitors -->|"fills gaps"| node_groq
node_ecommerce -->|"scrapes listings"| node_commerce_sites
node_insights -.->|"requests completion"| node_groq
node_pipeline -->|"passes market data"| node_forecast
node_pipeline -->|"passes market data"| node_niches
node_routes -.->|"generates report"| node_report
node_routes -.->|"sends report"| node_email
node_email -->|"sends email"| node_email_service
node_main -->|"creates app"| node_flask
node_main -->|"initializes tables"| node_db
node_routes -.->|"serves dashboard"| node_charts
node_config -->|"configures app"| node_flask

click node_flask "https://github.com/eugene234466/marketmindai/blob/main/app/__init__.py"
click node_routes "https://github.com/eugene234466/marketmindai/blob/main/app/routes.py"
click node_templates "https://github.com/eugene234466/marketmindai/tree/main/app/templates"
click node_charts "https://github.com/eugene234466/marketmindai/blob/main/app/static/js/charts.js"
click node_pipeline "https://github.com/eugene234466/marketmindai/blob/main/core/analyze.py"
click node_insights "https://github.com/eugene234466/marketmindai/blob/main/core/groq_client.py"
click node_market "https://github.com/eugene234466/marketmindai/blob/main/core/market_researcher.py"
click node_competitors "https://github.com/eugene234466/marketmindai/blob/main/core/competitor_analyzer.py"
click node_ecommerce "https://github.com/eugene234466/marketmindai/blob/main/core/ecommerce_scraper.py"
click node_forecast "https://github.com/eugene234466/marketmindai/blob/main/core/sales_predictor.py"
click node_niches "https://github.com/eugene234466/marketmindai/blob/main/core/niche_identifier.py"
click node_report "https://github.com/eugene234466/marketmindai/blob/main/core/report_generator.py"
click node_email "https://github.com/eugene234466/marketmindai/blob/main/core/email_sender.py"
click node_db "https://github.com/eugene234466/marketmindai/blob/main/database/db.py"
click node_config "https://github.com/eugene234466/marketmindai/blob/main/config.py"
click node_main "https://github.com/eugene234466/marketmindai/blob/main/main.py"

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_flask,node_routes,node_templates,node_charts,node_main toneBlue
class node_pipeline,node_insights,node_forecast,node_niches toneAmber
class node_market,node_competitors,node_ecommerce,node_groq toneMint
class node_report,node_email toneRose
class node_db,node_config,node_user,node_trends_service,node_commerce_sites,node_email_service toneIndigo
```

## Components

### Web experience

- [Flask application](https://github.com/eugene234466/marketmindai/blob/main/app/__init__.py): `app/__init__.py`
- [Web routes](https://github.com/eugene234466/marketmindai/blob/main/app/routes.py): `app/routes.py`
- [Web pages](https://github.com/eugene234466/marketmindai/tree/main/app/templates): `app/templates`
- [Dashboard charts](https://github.com/eugene234466/marketmindai/blob/main/app/static/js/charts.js): `app/static/js/charts.js`
- [Application entry point](https://github.com/eugene234466/marketmindai/blob/main/main.py): `main.py`

### Idea analysis

- [Analysis pipeline](https://github.com/eugene234466/marketmindai/blob/main/core/analyze.py): `core/analyze.py`
- [AI idea insights](https://github.com/eugene234466/marketmindai/blob/main/core/groq_client.py): `core/groq_client.py`
- [Sales forecast](https://github.com/eugene234466/marketmindai/blob/main/core/sales_predictor.py): `core/sales_predictor.py`
- [Niche discovery](https://github.com/eugene234466/marketmindai/blob/main/core/niche_identifier.py): `core/niche_identifier.py`

### Market research

- [Market trends](https://github.com/eugene234466/marketmindai/blob/main/core/market_researcher.py): `core/market_researcher.py`
- [Competitor analysis](https://github.com/eugene234466/marketmindai/blob/main/core/competitor_analyzer.py): `core/competitor_analyzer.py`
- [Ecommerce listings](https://github.com/eugene234466/marketmindai/blob/main/core/ecommerce_scraper.py): `core/ecommerce_scraper.py`

### Reports and delivery

- [PDF reports](https://github.com/eugene234466/marketmindai/blob/main/core/report_generator.py): `core/report_generator.py`
- [Email delivery](https://github.com/eugene234466/marketmindai/blob/main/core/email_sender.py): `core/email_sender.py`

### Persistence

- [PostgreSQL](https://github.com/eugene234466/marketmindai/blob/main/database/db.py): `database/db.py`
- [Application config](https://github.com/eugene234466/marketmindai/blob/main/config.py): `config.py`

### Other components

- **Business owner**
- **Groq API**
- **Google Trends**
- **Commerce sites**
- **Resend**

## Connections

- Business owner → Web routes: submits idea
- Flask application → Web routes: registers routes (evidence: `app/__init__.py`)
- Web routes → Web pages: renders pages
- Web routes → Analysis pipeline: starts analysis
- Web routes → PostgreSQL: uses persistence
- Analysis pipeline → AI idea insights: runs analysis (evidence: `core/analyze.py`)
- Analysis pipeline → Market trends: fetches market data (evidence: `core/analyze.py`)
- Analysis pipeline → Competitor analysis: fetches competitors (evidence: `core/analyze.py`)
- Analysis pipeline → Ecommerce listings: fetches listings (evidence: `core/analyze.py`)
- Analysis pipeline → Sales forecast: forecasts sales (evidence: `core/analyze.py`)
- Analysis pipeline → Niche discovery: identifies niches (evidence: `core/analyze.py`)
- Market trends → Google Trends: queries trends (evidence: `core/market_researcher.py`)
- Market trends → AI idea insights: requests summary (evidence: `core/market_researcher.py`)
- Competitor analysis → Groq API: fills gaps (evidence: `core/competitor_analyzer.py`)
- Ecommerce listings → Commerce sites: scrapes listings (evidence: `core/ecommerce_scraper.py`)
- AI idea insights → Groq API: requests completion
- Analysis pipeline → Sales forecast: passes market data (evidence: `core/analyze.py`)
- Analysis pipeline → Niche discovery: passes market data (evidence: `core/analyze.py`)
- Web routes → PDF reports: generates report
- Web routes → Email delivery: sends report
- Email delivery → Resend: sends email (evidence: `core/email_sender.py`)
- Application entry point → Flask application: creates app (evidence: `main.py`)
- Application entry point → PostgreSQL: initializes tables (evidence: `main.py`)
- Web routes → Dashboard charts: serves dashboard
- Application config → Flask application: configures app (evidence: `app/__init__.py`)
