Skip to content

surana-mudit/pplx-hackathon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RivalScope - Competitive Intelligence Platform

An application for competitive analysis and intelligence gathering, featuring competitor discovery, feature comparison, funding analysis, and automated weekly digest subscriptions.

Features

  • Competitor Discovery: Find competitors using Perplexity Sonar API
  • Feature Analysis: Extract and compare competitor features with contextual insights
  • Funding Intelligence: Track competitor funding rounds and investment data
  • Detailed Analysis: Deep 1v1 competitive analysis with product comparison, pricing insights, and sales battlecards
  • Weekly Digest: Automated email subscriptions for competitive intelligence updates
  • Modern Frontend: React-based UI with comprehensive analysis tools

Quick Start

Prerequisites

  • Python 3.11+
  • uv package manager

Backend Setup

# Clone and navigate to project
git clone <repository-url>
cd pplx-hackathon

# Create virtual environment and install dependencies
uv venv
source .venv/bin/activate
uv pip install -r requirements.txt

# Run the application
python -m app.main

Frontend Setup

# Navigate to frontend and install dependencies
cd frontend
npm install

# Start development server
npm run dev

Access the application:

Environment Configuration

Create a .env file with the following required variables:

# Required
SONAR_API_KEY=your_sonar_api_key_here

# Database (SQLite for dev, PostgreSQL for production)
DATABASE_URL=sqlite:///./weekly_digest.db

# Email Configuration (for weekly digest)
EMAIL_SMTP_SERVER=smtp.gmail.com
EMAIL_SMTP_PORT=587
EMAIL_SMTP_USERNAME=your_email@gmail.com
EMAIL_SMTP_PASSWORD=your_app_password
EMAIL_FROM_ADDRESS=your_email@gmail.com

# Security
JWT_SECRET=your_jwt_secret_key_min_32_chars

# Scheduler Configuration
DIGEST_SCHEDULE_DAY=6          # 0=Monday, 6=Sunday
DIGEST_SCHEDULE_HOUR=9         # 24-hour format
DIGEST_SCHEDULE_TIMEZONE=UTC

Perplexity Sonar API Integration

RivalScope leverages the Perplexity Sonar API to power its competitive intelligence capabilities. Sonar provides real-time web search and analysis capabilities that enable deep competitive insights.

1. Competitor Discovery

  • Searches the web to identify companies in similar domains
  • Analyzes business models and market positioning
  • Returns competitor names with verified website URLs

2. Feature Extraction & Analysis

  • Scrapes and analyzes competitor websites for product features
  • Provides contextual feature comparison when user company is specified
  • Generates citations and source URLs for transparency

3. Funding Intelligence

  • Searches for recent funding announcements and press releases
  • Extracts funding round details (Series A/B/C, amounts, dates)
  • Provides citation URLs to source articles

4. Deep Competitive Research

  • Uses Sonar's Deep Research capability for comprehensive 1v1 analysis
  • Generates product comparisons, pricing insights, and sales battlecards
  • Analyzes user preferences and market sentiment

5. Weekly Deep Research Digest

  • Generates weekly summary of key developments and changes using Sonar Deep research model
  • Includes feature updates, pricing changes, and market movements
  • Provides actionable insights and competitive recommendations
  • Delivers findings via scheduled email digest

Using RivalScope

  1. Navigate to https://rivalscope.netlify.app/
  2. Enter your company name and website URL
  3. Click "Find Competitors" to discover similar companies
  4. View analysis results including:
    • Competitor list with websites
    • Feature comparison matrix
    • Funding information
    • Detailed competitive insights

Project Structure

pplx-hackathon/
├── app/                       # FastAPI Backend
│   ├── main.py               # Application entry point
│   ├── config.py             # Configuration management
│   ├── database.py           # Database setup and session management
│   ├── models/               # Pydantic and SQLAlchemy models
│   ├── services/             # Business logic and external API clients
│   ├── routes/               # API endpoint definitions
│   └── utils/                # Helper functions and utilities
├── frontend/                  # React Frontend
│   ├── src/
│   │   ├── pages/            # Page components
│   │   ├── components/       # Reusable UI components
│   │   └── services/         # Frontend API services
│   └── package.json
├── requirements.txt          # Python dependencies

Key Features

Contextual Analysis

When providing your company information, the analysis becomes more targeted:

  • Generic: "AI-powered recommendations"
  • Contextual: "Large language model API (competing with OpenAI's GPT models)"

Weekly Digest

  • Automated competitive intelligence emails
  • Rate-limited API compliance (5 requests/minute)
  • Concurrent processing for multiple competitors
  • Deep research integration for comprehensive insights

Deployment

Production Setup

  1. Database: PostgreSQL on Render (free tier)
  2. Backend: FastAPI on Render with environment variables
  3. Frontend: React on Netlify with API proxy

Environment Variables for Production

DATABASE_URL=postgresql://username:password@host:port/database
SONAR_API_KEY=your_production_api_key
# ... other production configs

Development

The application uses:

  • FastAPI with async support and automatic documentation
  • React with modern hooks and routing
  • SQLAlchemy with async database operations
  • APScheduler for automated weekly digest cron jobs
  • Perplexity Sonar API for competitive intelligence

API Documentation

About

RivalScope - Competitive Intelligence platform

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published