Overview
Argument Cartographer is built as a modern Next.js 15 application with server-side AI orchestration. This guide covers everything from local development to production deployment.Prerequisites
Before you begin, ensure you have:Node.js 18+
Download from nodejs.org
Git
Version control - git-scm.com
Firebase Project
Create at console.firebase.google.com
API Keys
Google GenAI, Firecrawl, Twitter Bearer Token
System Requirements
- OS: macOS, Linux, or Windows (WSL2 recommended)
- RAM: Minimum 8GB (16GB recommended)
- Disk Space: 2GB for dependencies and build artifacts
- Internet: Required for AI API calls
Step 1: Clone the Repository
First, clone the project from GitHub:Step 2: Install Dependencies
Install all required npm packages:Key Dependencies
The installation includes:- Next.js 15 - React framework with App Router
- Firebase - Authentication and Firestore database
- Genkit - AI orchestration framework
- React Flow - Interactive graph visualization
- Tailwind CSS - Utility-first styling
- Radix UI - Accessible component primitives
Installation typically takes 2-5 minutes depending on your internet speed.
Step 3: Configure Environment Variables
Create a.env file in the project root with all required API keys and configuration.
Create .env File
Required Environment Variables
- AI Configuration
- External Tools
- Firebase Client
- Firebase Admin
- Visit Google AI Studio
- Create a new API key
- Copy and paste into .env
Free tier includes 60 requests per minute - sufficient for development.
Complete .env Example
Step 4: Set Up Firebase
Configure Firebase Authentication and Firestore database.Enable Authentication
Set Up Firestore Database
Deploy Security Rules
The project includes comprehensive Firestore security rules infirestore.rules:
The security model ensures strict user data isolation - each user can only access their own data.
Step 5: Run Development Server
Start the local development server with hot reload:Verify Installation
Open your browser and navigate to:- http://localhost:9002 - Homepage should load
- http://localhost:9002/login - Login page with Firebase auth
- http://localhost:9002/dashboard - Should redirect to login (requires auth)
Step 6: Test AI Flows (Optional)
Genkit provides a development UI to test AI flows independently:- Test
generateArgumentBlueprintflow - Test
identifyLogicalFallaciesflow - Test
webSearchandtwitterSearchtools - View trace logs and performance metrics
The Genkit dev server runs separately from the Next.js app - you can run both simultaneously.
Step 7: Build for Production
Create an optimized production build:Build Output
You’ll see output like:First Load JS sizes include shared chunks. Individual routes are optimized via code splitting.
Start Production Server
Troubleshooting
Module Not Found Errors
Module Not Found Errors
Problem:
Error: Cannot find module 'xyz'Solution:Firebase Auth Errors
Firebase Auth Errors
Problem:
Firebase: Error (auth/invalid-api-key)Solution:- Verify all
NEXT_PUBLIC_FIREBASE_*variables in .env - Check that API key matches Firebase Console
- Ensure no extra quotes or spaces in .env values
Genkit API Errors
Genkit API Errors
Problem:
Error: GOOGLE_GENAI_API_KEY is not setSolution:- Verify
GOOGLE_GENAI_API_KEYin .env - Check that the key is valid in Google AI Studio
- Restart dev server after adding the key
Build Fails with TypeScript Errors
Build Fails with TypeScript Errors
Problem: Type errors during
npm run buildSolution:Port Already in Use
Port Already in Use
Problem:
Error: listen EADDRINUSE: address already in use :::9002Solution:Next Steps
Configuration
Customize settings and features
Deploy to Vercel
Deploy to production
Architecture
Understand the system design
API Reference
Explore the API surface
