Monitor how AI models like ChatGPT, Claude, and Perplexity rank your brand. Track your AI brand visibility, analyze competitor rankings, and get actionable insights to improve your presence across AI platforms.
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/yourusername/ai-brand-track
cd ai-brand-track
# 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)- At least ONE AI Provider API Key (required for brand monitoring):
OPENAI_API_KEY- Get from https://platform.openai.com/api-keysANTHROPIC_API_KEY- Get from https://console.anthropic.com/PERPLEXITY_API_KEY- Get from https://www.perplexity.ai/settings/api
⚠️ Important: Without AI provider API keys, the brand monitoring feature will show 0% visibility. See SETUP.md for detailed setup instructions.
# 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