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.local
Required 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 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
npm run dev
Visit 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_URL
in.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_KEY
in.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
Messages
feature - 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
Messages
feature - 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 dev
Visit 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 migrations
vercel --prod
- Add all
.env.local
variables to Vercel - Update
NEXT_PUBLIC_APP_URL
to your domain - Set
NODE_ENV=production
npm run db:push
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
- 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
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - see LICENSE file for details