Skip to content

πŸ”₯ GEO-powered SaaS starter built with Firecrawl for brand monitoring, auth, and billing

License

Notifications You must be signed in to change notification settings

gabrielvutra/firegeo

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

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

Repository files navigation

FireGEO Open-Source SaaS Starter

FireGEO Demo

Get your SaaS running in minutes with authentication, billing, AI chat, and brand monitoring. Zero-config setup with Next.js 15, TypeScript, and PostgreSQL.

Next.js TypeScript Tailwind CSS PostgreSQL

Quick Start

Prerequisites

  • Node.js 18+ and npm
  • PostgreSQL database

One-Command Setup

# Clone the repository
git clone https://github.com/mendableai/firegeo
cd firegeo

# Copy environment variables
cp .env.example .env.local

Required API Keys (add to .env.local):

  • DATABASE_URL - PostgreSQL connection string (required)
  • BETTER_AUTH_SECRET - Generate with openssl rand -base64 32 (required)
# Run the automated setup
npm run setup

The setup script will automatically:

  • Install all dependencies
  • Test database connection
  • Generate Better Auth tables
  • Apply database migrations
  • Configure Autumn billing (if API key provided)
  • Get you ready to develop

Start Development

npm run dev

Visit http://localhost:3000 to see your app!

Manual Setup (Step-by-Step)

If you prefer to run the setup commands individually or need more control over the configuration process:

1. Install Dependencies

npm install

2. Set Up Environment Variables

# Copy the example environment file
cp .env.example .env.local

# Edit .env.local with your favorite editor
nano .env.local  # or vim, code, etc.

3. Generate Authentication Secret

# Generate a secure secret for Better Auth
openssl rand -base64 32
# Copy the output to BETTER_AUTH_SECRET in .env.local

4. Initialize Database

# Push the database schema
npm run db:push

# Generate Better Auth tables
npx @better-auth/cli generate --config better-auth.config.ts

# Apply the generated migrations
npm run db:push

5. Configure Autumn Billing

# Run the Autumn setup script
npm run setup:autumn

6. Verify Setup

# Check database schema
npm run db:studio

# Test the development server
npm run dev

Common Setup Commands

# Database commands
npm run db:push          # Push schema to database
npm run db:studio        # Open Drizzle Studio GUI
npm run db:migrate       # Run database migrations

# Autumn billing commands
npm run setup:autumn     # Run Autumn setup script

# Development
npm run dev              # Start development server
npm run build            # Build for production
npm run start            # Start production server

# Utilities
npm run lint             # Run ESLint

Tech Stack

Category Technologies
Frontend Next.js 15.3, React 19, TypeScript 5.7
Styling Tailwind CSS v4, shadcn/ui, Lucide Icons
Web Scraping Firecrawl
Database PostgreSQL, Drizzle ORM
Authentication Better Auth
Payments Autumn (with Stripe integration)
AI Providers OpenAI, Anthropic, Google Gemini, Perplexity
Email Resend

Project Structure

fire-saas-geo-latest/
β”œβ”€β”€ app/                    # Next.js app directory
β”‚   β”œβ”€β”€ api/               # API routes
β”‚   β”‚   β”œβ”€β”€ auth/         # Better Auth endpoints
β”‚   β”‚   β”œβ”€β”€ autumn/       # Billing endpoints (handled by Autumn)
β”‚   β”‚   β”œβ”€β”€ brand-monitor/# Brand analysis APIs
β”‚   β”‚   └── chat/         # AI chat endpoints
β”‚   β”œβ”€β”€ (auth)/           # Auth pages (login, register, reset)
β”‚   β”œβ”€β”€ dashboard/        # User dashboard
β”‚   β”œβ”€β”€ chat/             # AI chat interface
β”‚   β”œβ”€β”€ brand-monitor/    # Brand monitoring tool
β”‚   └── pricing/          # Subscription plans
β”œβ”€β”€ components/            # React components
β”‚   β”œβ”€β”€ ui/               # shadcn/ui components
β”‚   β”œβ”€β”€ autumn/           # Billing components
β”‚   └── brand-monitor/    # Brand monitor UI
β”œβ”€β”€ lib/                   # Utility functions
β”‚   β”œβ”€β”€ auth.ts           # Auth configuration
β”‚   β”œβ”€β”€ db/               # Database schema & client
β”‚   β”œβ”€β”€ providers/        # AI provider configs
β”‚   └── api-wrapper.ts    # API middleware
β”œβ”€β”€ config/                # Configuration files
β”œβ”€β”€ public/                # Static assets
└── better-auth/           # Auth migrations

Manual Setup (if needed)

1. Configure Services & Database

Database

Create a PostgreSQL database at Supabase

  • Create a new project in Supabase
  • Go to Settings β†’ Database
  • Copy the connection string (use "Transaction" mode) to DATABASE_URL in .env.local

Autumn Billing (Detailed Setup)

  1. Create Account

  2. Get API Key

    • Navigate to Settings β†’ Developer
    • Click "Create API Key"
    • Copy the key to AUTUMN_SECRET_KEY in .env.local
  3. Add Stripe Integration

    • Go to Integrations β†’ Stripe in Autumn dashboard
    • Add your Stripe secret key
    • Autumn handles all webhook configuration automatically
  4. Create Usage Feature

    • Go to Features β†’ Create Feature
    • Name: Messages
    • ID: messages (must match exactly)
    • Type: Select Usage
    • Unit: message
    • Click "Create Feature"
  5. Create Free Product

    • Go to Products β†’ Create Product
    • Name: Free
    • ID: Leave blank (auto-generated)
    • Price: $0/month
    • Features:
      • Add Messages feature
      • Set limit to 100
    • Click "Create Product"
  6. Create Pro Product

    • Go to Products β†’ Create Product
    • Name: Pro
    • ID: pro (must match exactly)
    • Price: $20/month
    • Features:
      • Add Messages feature
      • Set limit to 0 (unlimited)
    • Click "Create Product"

Email

Sign up at resend.com

  • Verify domain β†’ Copy API key to RESEND_API_KEY

Web Scraping & AI

Get your API keys from the following providers:

2. Initialize & Run

# Push database schema
npm run db:push

# Start development server
npm run dev

Visit http://localhost:3000

Environment Variables

# Database
DATABASE_URL=              # PostgreSQL connection string

# Authentication
BETTER_AUTH_SECRET=        # Generated with openssl
BETTER_AUTH_URL=           # Your app URL
NEXT_PUBLIC_APP_URL=       # Public app URL

# Billing
AUTUMN_SECRET_KEY=         # From Autumn dashboard

# Brand Monitor
FIRECRAWL_API_KEY=         # From Firecrawl

# Email
RESEND_API_KEY=            # From Resend
EMAIL_FROM=                # Your email address

# AI Providers (add what you need)
OPENAI_API_KEY=
ANTHROPIC_API_KEY=
PERPLEXITY_API_KEY=
GOOGLE_GENERATIVE_AI_API_KEY=

Available Scripts

npm run dev                  # Start development server
npm run build                # Build for production
npm run start                # Start production server
npm run db:push              # Push schema to database
npm run db:studio            # Open Drizzle Studio
npm run db:migrate           # Run migrations

Production Deployment

Deploy to Vercel

vercel --prod

Configure Production Environment

  1. Add all .env.local variables to Vercel
  2. Update NEXT_PUBLIC_APP_URL to your domain
  3. Set NODE_ENV=production

Run Migrations

npm run db:push

Troubleshooting

Authentication Error: "relation 'user' does not exist"

If you see this error, Better Auth tables haven't been created. Run:

# Generate Better Auth schema
npx @better-auth/cli generate --config better-auth.config.ts

# Push the schema to database
npm run db:push

Common Issues

  • Auth Issues: Ensure BETTER_AUTH_SECRET is set and matches between deploys
  • Database Errors: Run npm run db:push to sync schema
  • Billing Issues: Check Autumn products are created with correct IDs
  • Email Failures: Verify Resend domain and EMAIL_FROM address
  • Brand Monitor: Ensure FIRECRAWL_API_KEY is valid

Contributing

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

Resources

License

MIT License - see LICENSE file for details

About

πŸ”₯ GEO-powered SaaS starter built with Firecrawl for brand monitoring, auth, and billing

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 97.0%
  • CSS 1.7%
  • JavaScript 1.3%