# Project export: MarketForge AI

This document was generated by HackStack to give an AI agent context about a hackathon project. Sections are labeled with their provenance; content marked as truncated was cut to keep this document small.

## Project metadata

- Hackathon: UC Berkeley AI Hackathon 2025
- Tagline: MarketForge AI a multimodal agent-powered platform for smart marketing and pro-grade analytics
- Devpost: https://devpost.com/software/marketforge-ai
- GitHub: https://github.com/shokhabbos-mukhammatov/MarketForgeAI
- Team: 3 GitHub contributor(s) — Shokhabbos Mukhammatov (14 commits), Muzaffarbek (10 commits), Akmal Shovkatov (7 commits)

## Devpost submission (written by the team)

### Inspiration

“What if AI could become your full-stack marketing and analytics team—on-demand, affordable, and intelligent?” We were inspired by the struggles that solo entrepreneurs, small business owners, and lean startup teams face in trying to build a strong marketing presence (italic) and understand their performance metrics. Hiring experts is expensive—and tools are often complex or disconnected. So, we set out to build a multimodal AI-powered platform that bridges content creation, brand strategy, and professional analytics, all in one place. What It Does MarketForge AI is a next-gen platform that uses agent-based architecture and multimodal inputs to: 🤖 Analyze your business type and goals using a smart Manager Agent ✍️ Generate personalized marketing content: captions, ads, slogans, emails 🎨 Support branding with design prompts and visual inspiration 📊 Deliver pro-grade analytics including: Conversion rates User engagement metrics Traffic heatmaps Market and trend analysis 🧠 Visualize insights using dynamic, AI-generated roadmap diagrams 💬 Conversational interface lets users ask anything, refine strategy, or get instant insights 🔄 All done automatically, with no need for a marketing or data team How We Built It Backend: Built with Flask to serve as a lightweight, scalable API layer Agents: Used Fetch.ai uAgents to power agent-based collaboration Frontend: Developed in React + Next.js, including: React Flow for dynamic visual roadmap generation KPI dashboard with real-time data Chat UI for conversational interaction Analytics Engine: Fetches business-specific metrics Auto-generates insights from user behavior MongoDB: Stores user data and agent interactions Challenges We Faced Synchronizing multiple AI agents Building an analytics engine that is both powerful and understandable Mapping user language to structured agent workflows Real-time updates in frontend diagrams Securing communication between all services What We Learned Agent-based systems are extremely powerful for modular and adaptive AI workflows Professional analytics can be democratized with the right UI and smart defaults A multimodal pipeline (text, logic, data, visuals) creates rich user experiences Simplicity and transparency matter—especially for small business owners What’s Next Implement Gemini and analytics engine Dynamic roadmap flowcharts from AI Add voice interaction via Vapi Auto-generate PDF marketing reports Deeper market intelligence features Personalized growth suggestions over time 🧰 Built With

## README (from the GitHub repository)


# 🚀 MarketForgeAI

**MarketForgeAI** is an intelligent AI-driven platform that empowers businesses—ranging from solo entrepreneurs to large enterprises—to supercharge their content creation, marketing strategies, and promotional efforts. It acts as a **virtual growth assistant**, orchestrating powerful AI agents to streamline workflows, analyze data, and execute personalized campaigns.

---

## 👥 Team

### Authors

- **Shokhabbos Mukhammatov** - *Backend Engineer*
  - GitHub: [@shokhabbos-mukhammatov](https://github.com/shokhabbos-mukhammatov)


- **Akmal Shovkatov** - *Frontend Developer & UI/UX Designer*
  - GitHub: [@akmal-shovkatov](https://github.com/Akmalchan)


- **Muzaffar Muratov** - *Machine Learning Engineer*
  - GitHub: [@muzaffar-muratov](https://github.com/Muzaffarbekm)

## 🔧 Tech Stack

### Frontend
- [Next.js](https://nextjs.org/)
- [Tailwind CSS](https://tailwindcss.com/)
- React Hooks
- TypeScript

### Backend
- Flask
- Python 3.10+
- Integration with [Fetch.ai](https://fetch.ai/) via `uAgents`
- Grok
- ASI:1
- Agent orchestration system
- RESTful API

---

## 📁 Project Structure

```
MarketForgeAI/
├── backend/                # Flask server and agent logic
│   ├── agents/             # AI agent clients (Fetch, ASI:1, etc.)
│   ├── utils/              # Environment and shared utilities
│   ├── app.py              # Entrypoint for Flask server
│   ├── routes.py           # API endpoints (e.g., /ask, /agents/register)
│   └── requirements.txt    # Python dependencies
│
├── frontend/               # Next.js + Tailwind UI
│   ├── app/                # Route-based pages (chat, landing, analyze, etc.)
│   ├── components.json     # Frontend components registry
│   └── tailwind.config.ts  # Tailwind setup
│
└── README.md               # You're here!
```

---

## ⚙️ Setup Instructions

### Prerequisites

- Node.js 18+
- Python 3.10+
- Git
- Virtualenv (optional but recommended)

---

### 1. Backend (Flask + uAgents)

```bash
cd backend
python -m venv .venv
source .venv/bin/activate  # or .venv\Scripts\activate on Windows
pip install -r requirements.txt

# Set required environment variables
export AGENTVERSE_API_KEY=your_key_here  # or use .env loader

# Run the API
uvicorn app:app --reload
```

> 💡 Make sure your Fetch.ai Agentverse API key is valid.

---

### 2. Frontend (Next.js)

```bash
cd frontend
npm install
npm run dev
```

Frontend will start at: `http://localhost:3000`

---

## 🧠 Core Features

- ✅ AI Chat powered by Gemini / Fetch
- ✅ Roadmap UI with dynamic diagram manipulation
- ✅ Company profile analyzer
- ✅ KPI dashboard and real-time analytics (planned)
- ✅ Agent orchestration via Flask
- ✅ Modular plugin-like agent architecture
- ✅ Ready-to-use demo mode

---

## 💡 Agent Integrations

- **Manager Agent**: Coordinates all AI services and business logic.
- **Trend Detector**: Detects marketing trends based on user domain.
- **ASI:One Client**: For chat completions via Fetch.ai.
- **AgentVerse Integration**: For stateful agent handling.

---

## 📌 Routes Overview

### Frontend Routes

| URL Path            | Description                             |
|---------------------|-----------------------------------------|
| `/`                 | Landing page with login/demo            |
| `/app/chat`         | Main chatbot with dynamic logic         |
| `/app/roadmap`      | AI-powered roadmap and diagram UI       |
| `/app/analyze`      | Business analysis and recommendation    |
| `/app/company-details` | Company setup and input              |

### API Endpoints (Backend)

| Endpoint              | Description                      |
|-----------------------|----------------------------------|
| `POST /api/ask`       | Handles AI conversation requests |
| `POST /api/agents/register` | Registers a new agent     |
| `POST /api/agents/chat`     | Sends a message to an agent |

---

## 🧪 Testing

```bash
# Run backend tests
cd backend
pytest tests.py
```

Frontend testing setup TBD.

---

## 🤝 Contributing

PRs are welcome! Please follow these steps:

1. Fork the repo
2. Create a new branch (`git checkout -b feature/xyz`)
3. Commit your changes (`git commit -am 'Add xyz feature'`)
4. Push to the branch (`git push origin feature/xyz`)
5. Create a pull request

---

## 🧠 Inspiration

This project is part of the [UC Berkeley AI Hackathon 2025](https://uc-berkeley-ai-hackathon-2025.devpost.com/), supported by sponsors like Fetch.ai, Groq, Claude (Anthropic), and Letta.


## Detected evidence (automated analysis)

Indexed codebase: 76 recognized source files, 327 KB.
- CSS (language) — detected in the code
- Flask (technology) — detected in the code
- JavaScript (language) — detected in the code
- Next.js (technology) — detected in the code
- Python (language) — detected in the code
- React (technology) — detected in the code
- Tailwind CSS (technology) — detected in the code
- TypeScript (language) — detected in the code
- MongoDB (technology) — claimed on Devpost, not found in the code

## Codebase structure (from repository index)

### Files (87 of 87)

```
.gitignore
backend/.gitignore
backend/agents/__init__.py
backend/agents/agentverse_client.py
backend/agents/asi1_client.py
backend/agents/trend_detector.py
backend/app.py
backend/first_ai_agent.py
backend/README.md
backend/requirements.txt
backend/routes.py
backend/utils/__init__.py
backend/utils/env_loader.py
frontend/.bolt/config.json
frontend/.bolt/ignore
frontend/.bolt/prompt
frontend/.eslintrc.json
frontend/.gitignore
frontend/app/analyze/page.tsx
frontend/app/apps/page.tsx
frontend/app/chat/page.tsx
frontend/app/company-details/page.tsx
frontend/app/docs/page.tsx
frontend/app/globals.css
frontend/app/landing/page.tsx
frontend/app/layout.tsx
frontend/app/page.tsx
frontend/app/profile/page.tsx
frontend/components.json
frontend/components/AnalyticsCard.tsx
frontend/components/Navigation.tsx
frontend/components/ui/accordion.tsx
frontend/components/ui/alert-dialog.tsx
frontend/components/ui/alert.tsx
frontend/components/ui/aspect-ratio.tsx
frontend/components/ui/avatar.tsx
frontend/components/ui/badge.tsx
frontend/components/ui/breadcrumb.tsx
frontend/components/ui/button.tsx
frontend/components/ui/calendar.tsx
frontend/components/ui/card.tsx
frontend/components/ui/carousel.tsx
frontend/components/ui/chart.tsx
frontend/components/ui/checkbox.tsx
frontend/components/ui/collapsible.tsx
frontend/components/ui/command.tsx
frontend/components/ui/context-menu.tsx
frontend/components/ui/dialog.tsx
frontend/components/ui/drawer.tsx
frontend/components/ui/dropdown-menu.tsx
frontend/components/ui/form.tsx
frontend/components/ui/hover-card.tsx
frontend/components/ui/input-otp.tsx
frontend/components/ui/input.tsx
frontend/components/ui/label.tsx
frontend/components/ui/menubar.tsx
frontend/components/ui/navigation-menu.tsx
frontend/components/ui/pagination.tsx
frontend/components/ui/popover.tsx
frontend/components/ui/progress.tsx
frontend/components/ui/radio-group.tsx
frontend/components/ui/resizable.tsx
frontend/components/ui/scroll-area.tsx
frontend/components/ui/select.tsx
frontend/components/ui/separator.tsx
frontend/components/ui/sheet.tsx
frontend/components/ui/skeleton.tsx
frontend/components/ui/slider.tsx
frontend/components/ui/sonner.tsx
frontend/components/ui/switch.tsx
frontend/components/ui/table.tsx
frontend/components/ui/tabs.tsx
frontend/components/ui/textarea.tsx
frontend/components/ui/toast.tsx
frontend/components/ui/toaster.tsx
frontend/components/ui/toggle-group.tsx
frontend/components/ui/toggle.tsx
frontend/components/ui/tooltip.tsx
frontend/hooks/use-toast.ts
frontend/lib/utils.ts
frontend/next.config.js
frontend/package.json
frontend/postcss.config.js
frontend/README.md
frontend/tailwind.config.ts
frontend/tsconfig.json
README.md
```

### Dependencies

- backend/requirements.txt: asyncio@==3.4.3, fetchai@==0.1.0, flask@==3.0.0, flask_cors@==4.0.0, pydantic@==2.5.0, python-dotenv@==1.0.0, requests@==2.31.0, uagents@==0.13.0
- frontend/package.json: @hookform/resolvers@^3.9.0, @next/swc-wasm-nodejs@13.5.1, @radix-ui/react-accordion@^1.2.0, @radix-ui/react-alert-dialog@^1.1.1, @radix-ui/react-aspect-ratio@^1.1.0, @radix-ui/react-avatar@^1.1.0, @radix-ui/react-checkbox@^1.1.1, @radix-ui/react-collapsible@^1.1.0, @radix-ui/react-context-menu@^2.2.1, @radix-ui/react-dialog@^1.1.1, @radix-ui/react-dropdown-menu@^2.1.1, @radix-ui/react-hover-card@^1.1.1, @radix-ui/react-label@^2.1.0, @radix-ui/react-menubar@^1.1.1, @radix-ui/react-navigation-menu@^1.2.0, @radix-ui/react-popover@^1.1.1, @radix-ui/react-progress@^1.1.0, @radix-ui/react-radio-group@^1.2.0, @radix-ui/react-scroll-area@^1.1.0, @radix-ui/react-select@^2.1.1, @radix-ui/react-separator@^1.1.0, @radix-ui/react-slider@^1.2.0, @radix-ui/react-slot@^1.1.0, @radix-ui/react-switch@^1.1.0, @radix-ui/react-tabs@^1.1.0, @radix-ui/react-toast@^1.2.1, @radix-ui/react-toggle@^1.1.0, @radix-ui/react-toggle-group@^1.1.0, @radix-ui/react-tooltip@^1.1.2, @types/node@20.6.2, @types/react@18.2.22, @types/react-dom@18.2.7, autoprefixer@10.4.15, class-variance-authority@^0.7.0, clsx@^2.1.1, cmdk@^1.0.0, date-fns@^3.6.0, embla-carousel-react@^8.3.0, eslint@8.49.0, eslint-config-next@13.5.1, input-otp@^1.2.4, lucide-react@^0.446.0, next@13.5.1, next-themes@^0.3.0, postcss@8.4.30, react@18.2.0, react-day-picker@^8.10.1, react-dom@18.2.0, react-hook-form@^7.53.0, react-markdown@^10.1.0, react-resizable-panels@^2.1.3, recharts@^2.12.7, rehype-raw@^7.0.0, remark-gfm@^4.0.1, sonner@^1.5.0, tailwind-merge@^2.5.2, tailwindcss@3.3.3, tailwindcss-animate@^1.0.7, typescript@5.2.2, vaul@^0.9.9, zod@^3.23.8

### Recent commits (newest first)

- final edit on comprehensive analysis report
- apps/main.tsx updated - raw data to professional grade
- Fixed sticky component on apps/main.tsx
- Diagram in apps/ started working and ASI-1 connected
- Update README.md
- Merge branch 'main' of github.com:shokhabbos-mukhammatov/MarketForgeAI
- No more hard coding in routes.py prompts
- Create README.md
- Removed hard coded items in trend_detector.py
- Merge branch 'main' of github.com:shokhabbos-mukhammatov/MarketForgeAI
- Muza: 1 agent running through analyze endpoint
- Small AI ChatBot Update
- Merge remote-tracking branch 'origin/main'
- Small AI ChatBot Update
- updating prompt for better parsing
- updating prompt for better parsing
- Merge branch 'main' of https://github.com/shokhabbos-mukhammatov/MarketForgeAI
- updating prompt for better parsing
- gitignore node modules
- Major Functionality Update #1

## Key source files (fetched from GitHub, selected and truncated for size)

### backend/requirements.txt

```
flask==3.0.0
flask_cors==4.0.0
uagents==0.13.0
fetchai==0.1.0
python-dotenv==1.0.0
requests==2.31.0
pydantic==2.5.0
asyncio==3.4.3
```

### frontend/package.json

```
{
  "name": "nextjs",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "@hookform/resolvers": "^3.9.0",
    "@next/swc-wasm-nodejs": "13.5.1",
    "@radix-ui/react-accordion": "^1.2.0",
    "@radix-ui/react-alert-dialog": "^1.1.1",
    "@radix-ui/react-aspect-ratio": "^1.1.0",
    "@radix-ui/react-avatar": "^1.1.0",
    "@radix-ui/react-checkbox": "^1.1.1",
    "@radix-ui/react-collapsible": "^1.1.0",
    "@radix-ui/react-context-menu": "^2.2.1",
    "@radix-ui/react-dialog": "^1.1.1",
    "@radix-ui/react-dropdown-menu": "^2.1.1",
    "@radix-ui/react-hover-card": "^1.1.1",
    "@radix-ui/react-label": "^2.1.0",
    "@radix-ui/react-menubar": "^1.1.1",
    "@radix-ui/react-navigation-menu": "^1.2.0",
    "@radix-ui/react-popover": "^1.1.1",
    "@radix-ui/react-progress": "^1.1.0",
    "@radix-ui/react-radio-group": "^1.2.0",
    "@radix-ui/react-scroll-area": "^1.1.0",
    "@radix-ui/react-select": "^2.1.1",
    "@radix-ui/react-separator": "^1.1.0",
    "@radix-ui/react-slider": "^1.2.0",
    "@radix-ui/react-slot": "^1.1.0",
    "@radix-ui/react-switch": "^1.1.0",
    "@radix-ui/react-tabs": "^1.1.0",
    "@radix-ui/react-toast": "^1.2.1",
    "@radix-ui/react-toggle": "^1.1.0",
    "@radix-ui/react-toggle-group": "^1.1.0",
    "@radix-ui/react-tooltip": "^1.1.2",
    "@types/node": "20.6.2",
    "@types/react": "18.2.22",
    "@types/react-dom": "18.2.7",
    "autoprefixer": "10.4.15",
    "class-variance-authority": "^0.7.0",
    "clsx": "^2.1.1",
    "cmdk": "^1.0.0",
    "date-fns": "^3.6.0",
    "embla-carousel-react": "^8.3.0",
    "eslint": "8.49.0",
    "eslint-config-next": "13.5.1",
    "input-otp": "^1.2.4",
    "lucide-react": "^0.446.0",
    "next": "13.5.1",
    "next-themes": "^0.3.0",
    "postcss": "8.4.30",
    "react": "18.2.0",
    "react-day-picker": "^8.10.1",
    "react-dom": "18.2.0",
    "react-hook-form": "^7.53.0",
    "react-markdown": "^10.1.0",
    "react-resizable-panels": "^2.1.3",
    "recharts": "^2.12.7",
    "rehype-raw": "^7.0.0",
    "remark-gfm": "^4.0.1",
    "sonner": "^1.5.0",
    "tailwind-merge": "^2.5.2",
    "tailwindcss": "3.3.3",
    "tailwindcss-animate": "^1.0.7",
    "typescript": "5.2.2",
    "vaul": "^0.9.9",
    "zod": "^3.23.8"
  }
}

```

### backend/app.py

```python
# from flask import Flask
# from flask_cors import CORS
# from utils.env_loader import load_env
# from routes import api

# # 1. Load & validate .env variables
# load_env()

# app = Flask(__name__)
# CORS(app)
# app.register_blueprint(api)

# if __name__ == "__main__":
#     app.run(debug=True)


# Enhanced app.py - Building on your existing codebase
from flask import Flask, jsonify
from flask_cors import CORS
import os
import logging
from dotenv import load_dotenv

# Import your existing routes and enhanced routes
from routes import register_enhanced_routes  # This will be the enhanced routes.py above

# Load environment variables
load_dotenv()

# Set up logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)

def create_enhanced_app():
    """Create Flask app building on your existing structure"""
    app = Flask(__name__)
    CORS(app, origins=["http://localhost:3000"])
    
    # Register your enhanced routes
    register_enhanced_routes(app)
    
    # Keep your existing home route if you have one, or add this enhanced version
    @app.route('/', methods=['GET'])
    def enhanced_home():
        """Enhanced home endpoint showing your capabilities"""
        return jsonify({
            "message": "MarketForgeAI - Enhanced Multi-AI Business Intelligence",
            "built_on": "Your existing codebase + enhancements",
            "version": "2.0.0 - Enhanced",
            "your_existing_features": [
                "ASI:One integration (preserved)",
                "Agent system (enhanced)",
                "Trend detection (enhanced)",
                "Flask CORS setup (preserved)"
            ],
            "new_enhancements": [
                "Multi-AI support (Groq + Anthropic)",
                "Business intelligence analysis",
                "Strategic planning capabilities", 
                "Quick insights for agencies",
                "Smart fallback system"
            ],
            "target_users": ["Business Owners", "Marketing Agencies"],
            "endpoints": {
                "existing_enhanced": {
                    "POST /api/ask": "Your ASI:One integration (enhanced)",
                    "POST /api/agent/create": "Your agent creation (enhanced)",
                    "POST /api/agent/<id>/chat": "Your agent chat (enhanced)"
                },
                "new_business_focused": {
                    "POST /api/analyze": "Comprehensive business analysis",
                    "POST /api/quick-insights": "Fast business insights", 
                    "GET /api/analyze/<job_id>/status": "Analysis progress",
                    "GET /api/analyze/<job_id>/results": "Analysis results",
                    "GET /api/health": "Enhanced health check"
                }
            },
            "hackathon_ready": True
        })
    
    logger.info("Enhanced MarketForgeAI app created - building on your existing code")
    return app

# Create the enhanced app
app = create_enhanced_app()

if __name__ == '__main__':
    logger.info("Starting Enhanced MarketForgeAI...")
    logger.info("✅ Preserving your existing ASI:One integration")
    logger.info("✅ Enhancing your agent system") 
    logger.info("✅ Adding multi-AI capabilities")
    logger.info("✅ Business intelligence ready")
    
    app.run(debug=True, host='0.0.0.0', port=5000)
```

### frontend/app/layout.tsx

```typescript
'use client';

import './globals.css';
import type { Metadata } from 'next';
import { Inter } from 'next/font/google';
import Navigation from '@/components/Navigation';
import { usePathname } from 'next/navigation';

const inter = Inter({ subsets: ['latin'] });

export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  const pathname = usePathname();
  const isScrollable = pathname === '/' || pathname === '/profile';
  const hideNavigation = pathname === '/docs' || pathname === '/company-details' || pathname === '/landing';

  return (
    <html lang="en" className="dark">
      <body className={`${inter.className} bg-black text-white ${isScrollable ? 'scrollable' : 'no-scroll'}`}>
        <main className={hideNavigation ? '' : 'pb-20'}>
          {children}
        </main>
        {!hideNavigation && <Navigation />}
      </body>
    </html>
  );
}
```

### frontend/app/page.tsx

```typescript
'use client';

import { useState, useEffect } from 'react';
import AnalyticsCard from '@/components/AnalyticsCard';
import { TrendingUp, Users, DollarSign, Activity, BarChart3, PieChart } from 'lucide-react';

export default function Dashboard() {
  const [greeting, setGreeting] = useState('');
  const username = 'Alex';

  useEffect(() => {
    const hour = new Date().getHours();
    if (hour < 12) {
      setGreeting('Good morning');
    } else if (hour < 18) {
      setGreeting('Good afternoon');
    } else {
      setGreeting('Good evening');
    }
  }, []);

  const analyticsData = [
    {
      title: 'Revenue',
      value: '$45,231',
      change: '+20.1%',
      icon: DollarSign,
      data: [20, 35, 30, 45, 40, 60, 55, 70],
      chartType: 'line',
      size: 'large'
    },
    {
      title: 'Active Users',
      value: '2,350',
      change: '+12.5%',
      icon: Users,
      data: [65, 75, 70, 80, 85, 90, 95, 88],
      chartType: 'area',
      size: 'medium'
    },
    {
      title: 'Conversion Rate',
      value: '3.24%',
      change: '+4.3%',
      icon: TrendingUp,
      data: [40, 45, 55, 50, 60, 65, 70, 68],
      chartType: 'bar',
      size: 'medium'
    },
    {
      title: 'Performance',
      value: '94.2%',
      change: '+2.1%',
      icon: Activity,
      data: [88, 90, 92, 89, 94, 96, 93, 95],
      chartType: 'line',
      size: 'small'
    },
    {
      title: 'Sales Analytics',
      value: '1,234',
      change: '+8.2%',
      icon: BarChart3,
      data: [30, 40, 35, 50, 45, 55, 60, 58],
      chartType: 'bar',
      size: 'small'
    },
    {
      title: 'Distribution',
      value: '76.3%',
      change: '+1.8%',
      icon: PieChart,
      data: [45, 55, 40, 60, 50, 65, 70, 68],
      chartType: 'area',
      size: 'small'
    }
  ];

  return (
    <div className="min-h-screen">
      {/* Sticky Header */}
      <div className="sticky top-0 z-40 backdrop-blur-xl bg-gradient-to-r from-slate-900/30 via-slate-800/20 to-slate-900/30 shadow-lg">
        <div className="max-w-7xl mx-auto px-6 py-4">
          <div className="flex items-center justify-between">
            <div className="flex items-center space-x-4">
              <div>
                <div className="flex items-center space-x-2">
                  <img 
                    src="/LogoArrow.png" 
                    alt="MarketForge AI Logo" 
                    className="w-6 h-6 opacity-90"
                    style={{ filter: 'brightness(0) invert(1) opacity(0.9)' }}
                  />
                  <h1 className="text-xl font-medium text-gradient">MarketForge AI</h1>
                </div>
                <p className="text-sm text-slate-400">{greeting}, {username}</p>
              </div>
            </div>
          </div>
        </div>
      </div>

      {/* Main Content */}
      <div className="p-6 pt-8">
        <div className="max-w-7xl mx-auto">
          {/* Analytics Grid */}
          <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
            {analyticsData.map((card, index) => (
              <AnalyticsCard
                key={index}
                title={card.title}
                value={card.value}
                change={card.change}
                icon={card.icon}
                data={card.data}
                chartType={card.chartType}
                size={card.size}
              />
            ))}
          </div>
        </div>
      </div>
    </div>
  );
}
```

### frontend/app/company-details/page.tsx

```typescript
'use client';

import { useState } from 'react';
import { 
  Building2, 
  Save, 
  ArrowLeft
} from 'lucide-react';
import Link from 'next/link';

export default function CompanyDetailsPage() {
  const [formData, setFormData] = useState({
    companyName: 'MarketForge AI',
    country: 'United States',
    city: 'San Francisco',
    street: '123 Market Street, Suite 400',
    email: 'contact@marketforge.ai',
    phone: '+1 (555) 123-4567',
    specialization: 'AI-Powered Market Analysis'
  });

  const handleInputChange = (field: string, value: string) => {
    setFormData(prev => ({
      ...prev,
      [field]: value
    }));
  };

  const handleSave = () => {
    console.log('Saving company details:', formData);
    // Handle save logic here
  };

  const formFields = [
    {
      label: 'Company Name',
      field: 'companyName',
      placeholder: 'Enter company name'
    },
    {
      label: 'Company Location Country',
      field: 'country',
      placeholder: 'Enter country'
    },
    {
      label: 'Company Location City',
      field: 'city',
      placeholder: 'Enter city'
    },
    {
      label: 'Company Location Street',
      field: 'street',
      placeholder: 'Enter street address'
    },
    {
      label: 'Company Email',
      field: 'email',
      placeholder: 'Enter company email'
    },
    {
      label: 'Company Phone Number',
      field: 'phone',
      placeholder: 'Enter phone number'
    },
    {
      label: 'Company Specialization',
      field: 'specialization',
      placeholder: 'Ex. Bakery, Weed Shop'
    }
  ];

  return (
    <div className="page-scrollable">
      {/* Header */}
      <div className="sticky top-0 z-40 backdrop-blur-xl bg-gradient-to-r from-slate-900/30 via-slate-800/20 to-slate-900/30 shadow-lg">
        <div className="max-w-7xl mx-auto px-6 py-4">
          <div className="flex items-center justify-between">
            <div className="flex items-center space-x-4">
              <Link href="/profile">
                <button className="p-2 rounded-xl bg-white/10 hover:bg-white/20 transition-colors">
                  <ArrowLeft className="w-5 h-5 text-white" />
                </button>
              </Link>
              <div className="p-2 rounded-xl bg-gradient-to-br from-blue-500/20 to-purple-600/20 backdrop-blur-sm">
                <Building2 className="w-6 h-6 text-blue-400" />
              </div>
              <div>
                <div className="flex items-center space-x-2">
                  <img 
                    src="/LogoArrow.png" 
                    alt="MarketForge AI Logo" 
                    className="w-5 h-5 opacity-90"
                    style={{ filter: 'brightness(0) invert(1) opacity(0.9)' }}
                  />
                  <h1 className="text-xl font-medium text-gradient">MarketForge AI</h1>
                </div>
                <p className="text-sm text-slate-400">Update company information</p>
              </div>
            </div>
          </div>
        </div>
      </div>

      <div className="max-w-4xl mx-auto px-6 py-6 pb-12">
        <div className="glass rounded-2xl p-6">
          <div className="space-y-6">
            {formFields.map((field, index) => (
              <div key={index}>
                <label className="block text-white font-medium text-sm mb-2">
                  {field.label}
                </label>
                <input
                  type="text"
                  value={formData[field.field as keyof typeof formData]}
                  onChange={(e) => handleInputChange(field.field, e.target.value)}
                  placeholder={field.placeholder}
                  className="w-full glass rounded-xl p-4 bg-white/5 text-white placeholder-gray-400 outline-none focus:bg-white/10 transition-colors"
                />
              </div>
            ))}
          </div>

          {/* Save Button */}
          <div className="mt-8 pt-6 border-t border-white/10">
            <button
              onClick={handleSave}
              className="w-full bg-gradient-to-r from-blue-500 to-purple-600 hover:from-blue-600 hover:to-purple-700 rounded-xl p-4 transition-all duration-200 flex items-center justify-center space-x-3"
            >
              <Save size={18} className="text-white" />
              <span className="text-white font-medium">Save Changes</span>
            </button>
          </div>
        </div>
      </div>
    </div>
  );
}
```

### frontend/app/docs/page.tsx

```typescript
'use client';

import { useState } from 'react';
import { 
  FileText, 
  Search, 
  ArrowLeft
} from 'lucide-react';
import Link from 'next/link';

export default function DocsPage() {
  const [searchQuery, setSearchQuery] = useState('');

  const documentationContent = `
# MarketForge AI Documentation

## Getting Started

Welcome to MarketForge AI! This comprehensive guide will help you integrate our powerful AI-driven market analysis tools into your applications.

### Quick Start

1. **Sign up** for a MarketForge AI account
2. **Get your API key** from the dashboard
3. **Install** our SDK or use our REST API
4. **Make your first API call**

### Installation

#### JavaScript/Node.js
\`\`\`bash
npm install @marketforge/ai-sdk
\`\`\`

#### Python
\`\`\`bash
pip install marketforge-ai
\`\`\`

#### Go
\`\`\`bash
go get github.com/marketforge/ai-go
\`\`\`

## Authentication

All API requests require authentication using your API key. Include your API key in the Authorization header:

\`\`\`
Authorization: Bearer YOUR_API_KEY
\`\`\`

## API Reference

### Market Analysis Endpoint

**POST** \`/api/v1/analyze\`

Analyze market data and get AI-powered insights.

**Parameters:**
- \`symbol\` (string): Stock symbol (e.g., "AAPL")
- \`timeframe\` (string): Analysis timeframe ("1d", "1w", "1m")
- \`indicators\` (array): Technical indicators to include

**Example Request:**
\`\`\`json
{
  "symbol": "AAPL",
  "timeframe": "1d",
  "indicators": ["rsi", "macd", "bollinger"]
}
\`\`\`

**Example Response:**
\`\`\`json
{
  "symbol": "AAPL",
  "prediction": "bullish",
  "confidence": 0.85,
  "price_target": 175.50,
  "indicators": {
    "rsi": 65.2,
    "macd": "positive_crossover",
    "bollinger": "middle_band"
  }
}
\`\`\`

### Prediction Endpoint

**POST** \`/api/v1/predict\`

Get price predictions for specific assets.

**Parameters:**
- \`symbol\` (string): Asset symbol
- \`horizon\` (string): Prediction horizon ("1h", "1d", "1w")
- \`model\` (string): AI model to use ("standard", "advanced")

### Portfolio Analysis

**POST** \`/api/v1/portfolio/analyze\`

Analyze entire portfolio performance and risk.

**Parameters:**
- \`holdings\` (array): Array of portfolio holdings
- \`risk_tolerance\` (string): Risk level ("low", "medium", "high")

## SDK Examples

### JavaScript
\`\`\`javascript
import { MarketForgeAI } from '@marketforge/ai-sdk';

const client = new MarketForgeAI({
  apiKey: 'your-api-key-here'
});

const analysis = await client.analyze({
  symbol: 'AAPL',
  timeframe: '1d',
  indicators: ['rsi', 'macd']
});

console.log(analysis.prediction);
\`\`\`

### Python
\`\`\`python
from marketforge_ai import MarketForgeAI

client = MarketForgeAI(api_key='your-api-key-here')

analysis = client.analyze(
    symbol='AAPL',
    timeframe='1d',
    indicators=['rsi', 'macd']
)

print(analysis.prediction)
\`\`\`

## Rate Limits

- **Free Plan**: 100 requests per hour
- **Pro Plan**: 1,000 requests per hour
- **Enterprise**: Custom limits

## Error Handling

The API uses standard HTTP status codes:

- **200**: Success
- **400**: Bad Request
- **401**: Unauthorized
- **429**: Rate Limit Exceeded
- **500**: Internal Server Error

## Webhooks

Set up webhooks to receive real-time market alerts:

**POST** \`/api/v1/webhooks\`

Configure webhook endpoints for:
- Price alerts
- Technical indicator signals
- Portfolio rebalancing notifications

## Advanced Features

### Real-time Data Streaming

Connect to our WebSocket API for real-time market data:

\`\`\`javascript
const ws = new WebSocket('wss://api.marketforge.ai/v1/stream');

ws.onmessage = (event) => {
  const data = JSON.parse(event.data);
  console.log('Real-time update:', data);
};
\`\`\`

### Custom AI Models

Train custom models for your specific use case:

**POST** \`/api/v1/models/train\`

Parameters:
- \`training_data\` (array): Historical data for training
- \`model_type\` (string): Type of model to train
- \`parameters\` (object): Model-specific parameters

### Backtesting

Test your strategies against historical data:

**POST** \`/api/v1/backtest\`

Parameters:
- \`strategy\` (object): Trading strategy definition
- \`start_date\` (string): Backtest start date
- \`end_date\` (string): Backtest end date
- \`initial_capital\` (number): Starting capital amount

## Integration Examples

### React Integration

\`\`\`jsx
import React, { useEffect, useState } from 'react';
import { MarketForgeAI } from '@marketforge/ai-sdk';

function MarketAnalysis() {
  const [analysis, setAnalysis] = useState(null);
  const client = new MarketForgeAI({ apiKey: process.env.REACT_APP_API_KEY });

  useEffect(() => {
    async function fetchAnalysis() {
      const result = await client.analyze({
        symbol: 'AAPL',
        timeframe: '1d'
      });
      setAnalysis(result);
    }
    fetchAnalysis();
  }, []);

  return (
    <div>
      {analysis && (
        <div>
          <h2>Analysis for {analysis.symbol}</h2>
          <p>Prediction: {analysis.prediction}</p>
          <p>Confidence: {analysis.confidence}</p>
        </div>
      )}
    </div>
  );
}
\`\`\`

### Node.js Server Integration

\`\`\`javascript
const express = require('express');
const { MarketForgeAI } = require('@marketforge/ai-sdk');

const app = express();
const client = new MarketForgeAI({ apiKey: process.env.API_KEY });

app.get('/analyze/:symbol', async (req, res) => {
  try {
    const analysis = await client.analyze({
      symbol: req.params.symbol,
      timeframe: '1d'
    });
    res.json(analysis);
  } catch (error) {
    res.status(500).json({ error: error.message });
  }
});

app.listen(3000, () => {
  console.log('Server running on port 3000');
});
\`\`\`

## Support

For technical support:
- Email: support@marketforge.ai
- Documentation: https://docs.marketforge.ai
- Status Page: https://status.marketforge.ai
- Community Forum: https://community.marketforge.ai

## Changelog

### v2.1.0 (Latest)
- Added portfolio analysis endpoint
- Improved prediction accuracy by 15%
- New technic
[truncated — 3284 more characters]
```

### frontend/app/analyze/page.tsx

```typescript
'use client';

import { useState, useEffect } from 'react';
import { Loader2, CheckCircle } from 'lucide-react';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
import { Tabs, TabsList, TabsTrigger, TabsContent } from '@/components/ui/tabs';
import AnalyticsCard from '../../components/AnalyticsCard';

/* -----------------------------  types  ----------------------------- */

type Step = 1 | 2 | 3;
type TaskType =
  | 'market-analysis'
  | 'trending-content'
  | 'blog-ideas'
  | 'content-plan';

interface JobStatus {
  status: 'queued' | 'processing' | 'completed' | 'error';
  progress?: number;
}

interface Report {
  trends: string[];
  opportunities: string[];
  actionPlan: {
    title: string;
    description: string;
    priority: number;
    timeline: string;
    roi_estimate: string;
  }[];
  marketingStrategy: string;
  competitiveAnalysis: string;
  productivityTips: string[];
}

/* ---------------------------  component  --------------------------- */

export default function MarketForgeWizard() {
  const [step, setStep] = useState<Step>(1);

  // step-1 fields
  const [name, setName] = useState('');
  const [website, setWebsite] = useState('');

  // step-2
  const [task, setTask] = useState<TaskType>('market-analysis');

  // job tracking
  const [jobId, setJobId] = useState<string | null>(null);
  const [status, setStatus] = useState<JobStatus | null>(null);
  const [report, setReport] = useState<Report | null>(null);

  
  const handleSubmit = async () => {
    try {
      // Add industry input field or infer from business name
      const industryCategory = task === 'market-analysis' ? 'business analysis' : 
                             name.toLowerCase().includes('bakery') ? 'bakery' :
                             name.toLowerCase().includes('restaurant') ? 'restaurant' :
                             name.toLowerCase().includes('tech') ? 'technology' :
                             'general business';
      
      const res = await fetch('http://localhost:5000/api/analyze', {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({ 
          name, 
          website, 
          categories: industryCategory,  // Send actual industry, not task type
          task: task  // Send task separately
        })
      });
      
      if (!res.ok) {
        throw new Error(`HTTP ${res.status}: ${res.statusText}`);
      }
      
      const json = await res.json();
      setJobId(json.jobId);
      setStatus({ status: 'queued', progress: 0 });
      setStep(3);
    } catch (error) {
      console.error('Analysis failed:', error);
      alert(`Analysis failed: ${error.message}`);
    }
  };
  
  /* ------------------------------------------------------------------
   * 2️⃣  Poll status/results every 3 s when jobId exists
   * ------------------------------------------------------------------ */
  useEffect(() => {
    if (!jobId) return;
    const timer = setInterval(async () => {
      try {
        const st = await fetch(`http://localhost:5000/api/analyze/${jobId}/status`).then(r => r.json());
        setStatus(st);
        if (st.status === 'completed') {
          const rpt = await fetch(`http://localhost:5000/api/analyze/${jobId}/results`).then(r => r.json());
          setReport(rpt);
          clearInterval(timer);
        }
      } catch (error) {
        console.error('Polling error:', error);
      }
    }, 3000);
    return () => clearInterval(timer);
  }, [jobId]);

  /* ---------------------------  render  --------------------------- */
  return (
    <main className="mx-auto max-w-2xl p-6">
      {step === 1 && (
        <Card>
          <CardHeader>
            <CardTitle>Step 1 — Your business</CardTitle>
          </CardHeader>
          <CardContent className="space-y-4">
            <Input
              placeholder="Business name"
              value={name}
              onChange={e => setName(e.target.value)}
            />
            <Input
              placeholder="Website URL"
              value={website}
              onChange={e => setWebsite(e.target.value)}
            />
            <Button
              onClick={() => setStep(2)}
              disabled={!name || !website}
              className="w-full"
            >
              Continue
            </Button>
          </CardContent>
        </Card>
      )}

      {step === 2 && (
        <Card>
          <CardHeader>
            <CardTitle>Step 2 — Select a task</CardTitle>
          </CardHeader>
          <CardContent>
            <Tabs
              value={task}
              onValueChange={val => setTask(val as TaskType)}
              className="w-full"
            >
              <TabsList className="grid grid-cols-2">
                <TabsTrigger value="market-analysis">Market Analysis</TabsTrigger>
                <TabsTrigger value="trending-content">Trending Topics</TabsTrigger>
                <TabsTrigger value="blog-ideas">Blog Ideas</TabsTrigger>
                <TabsTrigger value="content-plan">30-day Plan</TabsTrigger>
              </TabsList>
            </Tabs>
            <Button onClick={handleSubmit} className="mt-4 w-full">
              Generate report
            </Button>
          </CardContent>
        </Card>
      )}

      {step === 3 && (
        <Card>
          <CardHeader>
            <CardTitle>Step 3 — Report</CardTitle>
          </CardHeader>
          <CardContent className="space-y-6">
            {!report && (
              <div className="flex items-center gap-3">
                <Loader2 className="animate-spin" />
                <p className="text-muted-foreground">
                  {status?.status === 'processing'
                    ? `Crunching data (${status?.progress ?? 0} %)…`
                    : 'Queued…'}
                </p>
              </div>
            )}
[truncated — 3477 more characters]
```

### frontend/app/landing/page.tsx

```typescript
'use client';

import { useState } from 'react';
import { 
  Globe, 
  FileText, 
  ArrowRight, 
  Loader2,
  Sparkles
} from 'lucide-react';
import { useRouter } from 'next/navigation';

export default function LandingPage() {
  const [websiteUrl, setWebsiteUrl] = useState('');
  const [manualInfo, setManualInfo] = useState('');
  const [isManualMode, setIsManualMode] = useState(false);
  const [isLoading, setIsLoading] = useState(false);
  const router = useRouter();

  const handleProceed = async () => {
    if ((!websiteUrl.trim() && !isManualMode) || (!manualInfo.trim() && isManualMode)) {
      return;
    }

    setIsLoading(true);

    // Simulate processing time
    setTimeout(() => {
      // Navigate to main dashboard after processing
      router.push('/');
    }, 3000);
  };

  const toggleManualMode = () => {
    setIsManualMode(!isManualMode);
    setWebsiteUrl('');
    setManualInfo('');
  };

  if (isLoading) {
    return (
      <div className="h-screen flex items-center justify-center overflow-hidden">
        {/* Background gradient overlay */}
        <div className="absolute inset-0 bg-gradient-to-br from-purple-900/20 via-blue-900/10 to-indigo-900/20" />
        
        {/* Floating particles effect */}
        <div className="absolute inset-0 overflow-hidden">
          {[...Array(20)].map((_, i) => (
            <div
              key={i}
              className="absolute w-1 h-1 bg-white/15 rounded-full animate-pulse"
              style={{
                left: `${Math.random() * 100}%`,
                top: `${Math.random() * 100}%`,
                animationDelay: `${Math.random() * 3}s`,
                animationDuration: `${2 + Math.random() * 3}s`
              }}
            />
          ))}
        </div>

        <div className="relative z-10 text-center">
          <div className="glass rounded-2xl p-8 bg-gradient-to-br from-purple-500/15 to-blue-500/15 border border-white/20 shadow-2xl">
            <div className="mb-6">
              <div className="relative mx-auto w-16 h-16">
                <div className="absolute inset-0 rounded-full bg-gradient-to-br from-purple-500/20 to-blue-500/20 blur-lg animate-pulse" />
                <div className="relative glass rounded-full p-3 bg-gradient-to-br from-purple-500/15 to-blue-500/15">
                  <Loader2 size={40} className="text-white animate-spin" />
                </div>
              </div>
            </div>
            
            <h2 className="text-2xl font-light text-gradient mb-3">
              Processing
            </h2>
            <p className="text-gray-300 text-base mb-4">
              Setting up your workspace...
            </p>
            
            <div className="flex items-center justify-center space-x-2 text-purple-400">
              <div className="w-1.5 h-1.5 bg-purple-400 rounded-full animate-bounce" style={{ animationDelay: '0ms' }} />
              <div className="w-1.5 h-1.5 bg-purple-400 rounded-full animate-bounce" style={{ animationDelay: '150ms' }} />
              <div className="w-1.5 h-1.5 bg-purple-400 rounded-full animate-bounce" style={{ animationDelay: '300ms' }} />
            </div>
          </div>
        </div>
      </div>
    );
  }

  return (
    <div className="h-screen flex overflow-hidden">
      {/* Background gradient overlay */}
      <div className="absolute inset-0 bg-gradient-to-br from-purple-900/20 via-blue-900/10 to-indigo-900/20" />
      
      {/* Floating particles effect */}
      <div className="absolute inset-0 overflow-hidden">
        {[...Array(15)].map((_, i) => (
          <div
            key={i}
            className="absolute w-1 h-1 bg-white/10 rounded-full animate-pulse"
            style={{
              left: `${Math.random() * 100}%`,
              top: `${Math.random() * 100}%`,
              animationDelay: `${Math.random() * 3}s`,
              animationDuration: `${2 + Math.random() * 3}s`
            }}
          />
        ))}
      </div>

      {/* Left Side - Architectural Image */}
      <div className="relative z-10 flex-1 overflow-hidden">
        <div className="relative h-full">
          {/* Image with overlay */}
          <div className="absolute inset-0">
            <img 
              src="/1381238830380MA_La_Luciole_03_photo_Luc_Boegly-ezgif.com-avif-to-png-converter.png"
              alt="Modern Architecture"
              className="w-full h-full object-cover"
            />
            {/* Gradient overlay to blend with the right side */}
            <div className="absolute inset-0 bg-gradient-to-r from-transparent via-slate-900/20 to-slate-900/60" />
            <div className="absolute inset-0 bg-gradient-to-t from-slate-900/40 via-transparent to-slate-900/20" />
          </div>

          {/* Company name at bottom */}
          <div className="absolute bottom-6 left-6 z-20">
            <div className="flex items-center space-x-2">
              <img 
                src="/LogoArrow.png" 
                alt="MarketForge AI Logo" 
                className="w-6 h-6 opacity-90"
                style={{ filter: 'brightness(0) invert(1) opacity(0.9)' }}
              />
              <div>
                <h1 className="text-2xl font-light text-white drop-shadow-lg">
                  MarketForge AI
                </h1>
                <p className="text-sm text-white/70 drop-shadow">
                  AI-Powered Market Analysis
                </p>
              </div>
            </div>
          </div>
        </div>
      </div>

      {/* Right Side - Input Form */}
      <div className="relative z-10 flex-1 flex items-center justify-center p-6 bg-gradient-to-l from-slate-900/80 to-transparent">
        <div className="w-full max-w-sm">
          {/* Header */}
          <div className="text-center mb-6">
            <div className="inline-flex items-center justify-center w-12 h-12 rounded-xl bg-gradient-to-br from-blue-500/20 to-purple-600/20 border border-white/20 mb-3 bac
[truncated — 5334 more characters]
```

### frontend/postcss.config.js

```javascript
module.exports = {
  plugins: {
    tailwindcss: {},
    autoprefixer: {},
  },
};

```

[62 more indexed source files omitted to keep this export small. The full file list is in the Codebase structure section above.]