An AI-powered marketing campaign management platform that orchestrates campaigns across Facebook, Email, and Google Ads using CrewAI agents.
Watch our short video demonstration on Youtube.
- Multi-Channel Campaign Management: Manage campaigns across Facebook, Email, and Google SEO
- AI-Powered Agents: Leverage CrewAI for intelligent campaign creation, execution, and optimization
- Real-time Metrics & Analytics: Track campaign performance with D3.js visualizations
- Automated Budget Allocation: Dynamic budget rebalancing based on performance
- Compliance Checking: Automated content validation against brand guidelines
- Customer Segmentation: AI-driven customer segment identification
- Frontend: Next.js 14 (App Router), TypeScript, Tailwind CSS, D3.js
- Backend: FastAPI, SQLModel, SQLite
- AI Framework: CrewAI with Gemini API
- Scheduling: APScheduler
- Task Execution: ThreadPoolExecutor for concurrent campaigns
- Python 3.9+
- Node.js 18+
- npm or yarn
git clone <repository-url>
cd bizhackscp .env.example .env
# Edit .env and add your API keys:
# - GEMINI_API_KEY
# - Database connection details
# - External API endpoints (if using real APIs)# Create virtual environment
python -m venv venv
# Activate virtual environment
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate
# Install Python dependencies
pip install -r requirements.txt
cd backend
# Create demo CSV files (if they don't exist)
# python -c "import sys; sys.path.append('..'); from data.demo_loader import create_demo_files; create_demo_files()"
# The database will be initialized automatically when you start the server
# If you need to manually initialize or reset the database:
python -c "import sys; sys.path.append('..'); from data.database import init_db; init_db()"# Navigate to frontend directory
cd frontend
# Install dependencies
npm install
# or
yarn install
# Build the application
npm run build
# or
yarn build# From the backend directory
cd backend
PYTHONPATH=.. uvicorn main:app --reload --port 8000The API will be available at http://localhost:8000
API documentation: http://localhost:8000/docs
# From the frontend directory
cd frontend
npm run dev
# or
yarn devThe application will be available at http://localhost:3000
- Launch Application: Navigate to
http://localhost:3000 - Complete Setup Modals: The application will guide you through:
- Product selection
- Firm details
- Market information
- Strategic goals
- Budget allocation
- Brand guardrails
- Upload Data: Upload user and transaction CSV files
- Review Segments: AI will generate customer segments
- Approve Campaigns: Review and approve generated campaign ideas
bizhacks/
├── frontend/ # Next.js frontend application
├── backend/ # FastAPI backend server
├── data/ # Database models and demo data
└── documentation/ # Additional documentation
POST /api/setup/initialize- Initialize application with company dataGET /api/campaigns- List all campaignsPOST /api/campaigns- Create new campaignGET /api/metrics/{campaign_id}- Get campaign metricsPOST /api/agents/segment- Generate customer segmentsPOST /api/agents/create-campaigns- Generate campaign ideasPOST /api/schedules- Schedule campaign execution
# Backend tests
pytest backend/tests/
# Frontend tests
cd frontend && npm testThe application uses SQLModel with SQLite. Database schema is automatically created on first run.
- Create agent file in
backend/agents/ - Register in
crew_factory.py - Add corresponding API endpoint in
backend/api/agents.py
# API Keys
GEMINI_API_KEY=your_gemini_api_key
# Database
DATABASE_URL=sqlite:///./campaign.db
# External APIs (for production)
FACEBOOK_API_KEY=your_facebook_key
GOOGLE_ADS_API_KEY=your_google_ads_key
EMAIL_SERVICE_API_KEY=your_email_service_key
# Application Settings
SCHEDULER_TIMEZONE=UTC
MAX_CONCURRENT_CAMPAIGNS=10
METRICS_REFRESH_INTERVAL=3600 # seconds-
Database Connection Error
- Ensure SQLite is installed
- Check file permissions for campaign.db
-
Agent Execution Errors
- Verify GEMINI_API_KEY is set correctly
- Check agent logs in
backend/logs/
-
Frontend Build Issues
- Clear Next.js cache:
rm -rf .next - Reinstall dependencies:
rm -rf node_modules && npm install
- Clear Next.js cache:
This project is created for the BizHacks case competition.