Turn Reddit discussions into validated SaaS opportunities with AI-powered market research
Validly is a Next.js application that scrapes weekly Reddit discussions from any subreddit and uses AI to identify genuine SaaS opportunities, market gaps, and user pain points.
- π Smart Reddit Scraping - Fetches top posts and comments from any subreddit
- π€ AI-Powered Analysis - Uses Insforge AI to identify actionable SaaS ideas
- π Opportunity Scoring - Rates each idea with market viability and urgency scores
- π‘ Market Intelligence - Extracts target customers, pricing insights, and competitors
- π¨ Clean UI - Beautiful, responsive interface built with Tailwind CSS v4
- β‘ Fast & Type-Safe - Built with Next.js App Router and TypeScript
- Scrape - Uses Decodo API to fetch Reddit HTML from top weekly posts
- Structure - Parses titles and top comments with Cheerio
- Analyze - Sends structured data to Insforge AI for market analysis
- Score - Returns validated SaaS ideas with viability scores and market insights
-
Clone the repository
git clone https://github.com/yourusername/validly.git cd validly -
Install dependencies
npm install
-
Set up environment variables
Create a
.env.localfile in the root directory:# Required DECODO_API_KEY=your_decodo_api_key_here INSFORGE_API_KEY=your_insforge_api_key_here # Optional - Customize Insforge configuration INSFORGE_URL=https://api.insforge.dev INSFORGE_MODEL=openai/gpt-4o-mini INSFORGE_RESULTS_TABLE=validated_saas_ideas # Optional - Customize Decodo scraping behavior DECODO_PROXY_POOL=residential DECODO_HEADLESS_MODE=true DECODO_TIMEOUT_MS=30000 INSFORGE_TIMEOUT_MS=60000
-
Run the development server
npm run dev
-
Open your browser
Navigate to http://localhost:3000
- Visit Decodo
- Sign up for an account
- Navigate to your dashboard
- Copy your API key
- Visit insforge.dev
- Create an account
- Go to your project settings
- Generate and copy your API key
validly/
βββ app/
β βββ api/
β β βββ analyze/
β β βββ route.ts # API endpoint for Reddit analysis
β βββ globals.css # Global styles
β βββ layout.tsx # Root layout
β βββ page.tsx # Main UI page
βββ lib/
β βββ env.ts # Environment variable validation
β βββ insforge.ts # Insforge AI integration
β βββ reddit.ts # Reddit scraping & parsing
β βββ types.ts # TypeScript type definitions
βββ public/ # Static assets
βββ .env.local # Environment variables (create this)
βββ next.config.ts # Next.js configuration
βββ package.json # Dependencies
βββ tsconfig.json # TypeScript configuration
Analyzes a subreddit for SaaS opportunities.
Request Body:
{
"subreddit": "saas"
}Response:
{
"ideas": [
{
"title": "AI-Powered Email Automation for SMBs",
"description": "...",
"target_customers": ["Small businesses", "Marketing agencies"],
"estimated_pricing": "$29-99/month",
"market_score": 8,
"urgency_score": 7,
"competitors": ["Mailchimp", "ActiveCampaign"],
"source_threads": [
{
"title": "Struggling with email automation...",
"thread_url": "https://reddit.com/r/saas/..."
}
]
}
],
"posts": [...],
"metadata": {
"subreddit": "saas",
"analyzedAt": "2026-05-02T..."
}
}- Framework: Next.js 16 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS v4
- Web Scraping: Cheerio + Decodo API
- AI Analysis: Insforge SDK
- Validation: Zod
- JSON Repair: jsonrepair
| Variable | Required | Default | Description |
|---|---|---|---|
DECODO_API_KEY |
β Yes | - | Your Decodo API key for Reddit scraping |
INSFORGE_API_KEY |
β Yes | - | Your Insforge API key for AI analysis |
INSFORGE_URL |
β No | https://api.insforge.dev |
Insforge API base URL |
INSFORGE_MODEL |
β No | openai/gpt-4o-mini |
AI model to use |
INSFORGE_RESULTS_TABLE |
β No | - | Optional database table name |
DECODO_PROXY_POOL |
β No | residential |
Proxy pool type for scraping |
DECODO_HEADLESS_MODE |
β No | true |
Headless browser mode |
DECODO_TIMEOUT_MS |
β No | 30000 |
Scraping timeout in milliseconds |
INSFORGE_TIMEOUT_MS |
β No | 60000 |
AI analysis timeout in milliseconds |
npm run dev # Start development server
npm run build # Build for production
npm run start # Start production server
npm run lint # Run ESLintContributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is open source and available under the MIT License.
- Decodo for powerful web scraping API
- Insforge for AI infrastructure
- Next.js team for the amazing framework
Built with β€οΈ using Next.js, TypeScript, and AI
POST /api/analyze
Request body:
{
"subreddit": "saas"
}Response shape:
{
"subreddit": "saas",
"source": {
"subreddit": "saas",
"scrapedAt": "2026-04-13T00:00:00.000Z",
"posts": [
{
"title": "...",
"comments": ["...", "..."],
"permalink": "/r/saas/comments/..."
}
]
},
"ideas": [
{
"idea_name": "...",
"problem": "...",
"demand_level": "High",
"existing_solutions": ["..."],
"user_complaints": ["..."],
"opportunity": "...",
"score": 8,
"verdict": "Strong"
}
]
}- The Decodo integration is intentionally resilient and tries multiple auth and payload conventions because Decodo account setups can differ.
- Optional Insforge persistence is disabled unless
INSFORGE_RESULTS_TABLEis set and the target table already exists. - The route validates both request input and AI output before returning data to the UI.