Skip to content

Nova-Designs-Creative/validly

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Validly 🎯

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.

TypeScript Next.js Tailwind CSS

✨ Features

  • πŸ” 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

πŸš€ How It Works

  1. Scrape - Uses Decodo API to fetch Reddit HTML from top weekly posts
  2. Structure - Parses titles and top comments with Cheerio
  3. Analyze - Sends structured data to Insforge AI for market analysis
  4. Score - Returns validated SaaS ideas with viability scores and market insights

πŸ“‹ Prerequisites

  • Node.js 20+ installed
  • A Decodo API key (for Reddit scraping)
  • An Insforge API key (for AI analysis)

πŸ› οΈ Installation

  1. Clone the repository

    git clone https://github.com/yourusername/validly.git
    cd validly
  2. Install dependencies

    npm install
  3. Set up environment variables

    Create a .env.local file 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
  4. Run the development server

    npm run dev
  5. Open your browser

    Navigate to http://localhost:3000

πŸ”‘ Getting API Keys

Decodo API Key

  1. Visit Decodo
  2. Sign up for an account
  3. Navigate to your dashboard
  4. Copy your API key

Insforge API Key

  1. Visit insforge.dev
  2. Create an account
  3. Go to your project settings
  4. Generate and copy your API key

πŸ“ Project Structure

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

πŸ”Œ API Endpoint

POST /api/analyze

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..."
  }
}

πŸ—οΈ Tech Stack

  • 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

🎨 Environment Variables Reference

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

πŸ“ Available Scripts

npm run dev      # Start development server
npm run build    # Build for production
npm run start    # Start production server
npm run lint     # Run ESLint

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“„ License

This project is open source and available under the MIT License.

πŸ™ Acknowledgments

  • 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"
		}
	]
}

Notes

  • 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_TABLE is set and the target table already exists.
  • The route validates both request input and AI output before returning data to the UI.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors