Get your SaaS running in minutes with authentication, billing, AI chat, and brand monitoring. Zero-config setup with Next.js 15, TypeScript, and PostgreSQL.
- Node.js 18+ and npm
- PostgreSQL database
# Clone the repository
git clone https://github.com/mendableai/firegeo
cd firegeo
# Copy environment variables
cp .env.example .env.localRequired API Keys (add to .env.local):
DATABASE_URL- PostgreSQL connection string (required)BETTER_AUTH_SECRET- Generate withopenssl rand -base64 32(required)
# Run the automated setup
npm run setupThe 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
npm run devVisit http://localhost:3000 to see your app!
If you prefer to run the setup commands individually or need more control over the configuration process:
npm install# Copy the example environment file
cp .env.example .env.local
# Edit .env.local with your favorite editor
nano .env.local # or vim, code, etc.# Generate a secure secret for Better Auth
openssl rand -base64 32
# Copy the output to BETTER_AUTH_SECRET in .env.local# 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# Run the Autumn setup script
npm run setup:autumn# Check database schema
npm run db:studio
# Test the development server
npm run dev# 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| 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 |
| Resend |
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
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_URLin.env.local
-
Create Account
- Sign up at useautumn.com
- Complete email verification
-
Get API Key
- Navigate to Settings โ Developer
- Click "Create API Key"
- Copy the key to
AUTUMN_SECRET_KEYin.env.local
-
Add Stripe Integration
- Go to Integrations โ Stripe in Autumn dashboard
- Add your Stripe secret key
- Autumn handles all webhook configuration automatically
-
Create Usage Feature
- Go to Features โ Create Feature
- Name:
Messages - ID:
messages(must match exactly) - Type: Select
Usage - Unit:
message - Click "Create Feature"
-
Create Free Product
- Go to Products โ Create Product
- Name:
Free - ID: Leave blank (auto-generated)
- Price:
$0/month - Features:
- Add
Messagesfeature - Set limit to
100
- Add
- Click "Create Product"
-
Create Pro Product
- Go to Products โ Create Product
- Name:
Pro - ID:
pro(must match exactly) - Price:
$20/month - Features:
- Add
Messagesfeature - Set limit to
0(unlimited)
- Add
- Click "Create Product"
Sign up at resend.com
- Verify domain โ Copy API key to
RESEND_API_KEY
Get your API keys from the following providers:
- Firecrawl: https://app.firecrawl.dev/api-keys โ Copy to
FIRECRAWL_API_KEY - OpenAI: https://platform.openai.com/api-keys โ Copy to
OPENAI_API_KEY - Anthropic (Claude): https://console.anthropic.com/settings/keys โ Copy to
ANTHROPIC_API_KEY - Google AI (Gemini): https://aistudio.google.com/app/apikey โ Copy to
GOOGLE_GENERATIVE_AI_API_KEY - Perplexity: https://www.perplexity.ai/settings/api โ Copy to
PERPLEXITY_API_KEY
# Push database schema
npm run db:push
# Start development server
npm run devVisit http://localhost:3000
# 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=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 migrationsvercel --prod- Add all
.env.localvariables to Vercel - Update
NEXT_PUBLIC_APP_URLto your domain - Set
NODE_ENV=production
npm run db:pushIf 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- Auth Issues: Ensure
BETTER_AUTH_SECRETis set and matches between deploys - Database Errors: Run
npm run db:pushto sync schema - Billing Issues: Check Autumn products are created with correct IDs
- Email Failures: Verify Resend domain and
EMAIL_FROMaddress - Brand Monitor: Ensure
FIRECRAWL_API_KEYis valid
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - see LICENSE file for details
