Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Abbaddii-99/AI-Startup-Analyzer/llms.txt

Use this file to discover all available pages before exploring further.

This guide walks you through running AI Startup Analyzer on your local machine from a fresh clone to submitting a real analysis. All commands assume you are in the repository root unless noted otherwise.
1

Check Prerequisites

Before you begin, make sure the following are available on your machine.
RequirementMinimum VersionNotes
Node.js20+Required by both apps and all packages
pnpm10+The only supported package manager in this repo
Redis7+Used by BullMQ for the job queue and by the AI response cache
AI API keyGemini 2.0 Flash or any OpenRouter model
If you do not have Redis installed locally, Step 4 shows how to start it with a single Docker command — no local installation needed.
2

Clone and Install Dependencies

Clone the repository and install all workspace dependencies with pnpm. Turborepo will handle the build graph automatically.
git clone https://github.com/Abbaddii-99/AI-Startup-Analyzer.git
cd AI-Startup-Analyzer
pnpm install
pnpm install installs dependencies for all three workspaces — apps/backend, apps/frontend, and every package under packages/ — in a single pass.
3

Configure Environment Variables

Copy the example environment file and fill in the required values.
cp .env.example .env
Open .env and set these variables at minimum:
# ── Database (Neon PostgreSQL) ─────────────────────────────────────────────
# Pooled connection string for the running app
DATABASE_URL="postgresql://neondb_owner:<password>@ep-<pooled-endpoint>-pooler.<region>.aws.neon.tech/neondb?sslmode=require"

# Direct connection string for Prisma migrations
DIRECT_DATABASE_URL="postgresql://neondb_owner:<password>@ep-<direct-endpoint>.<region>.aws.neon.tech/neondb?sslmode=require"

# ── Security ───────────────────────────────────────────────────────────────
JWT_SECRET="change-me-use-a-strong-random-string"

# ── Redis ─────────────────────────────────────────────────────────────────
REDIS_HOST="localhost"
REDIS_PORT=6379
REDIS_PASSWORD=""

# ── AI Providers (at least one is required) ───────────────────────────────
GEMINI_API_KEY="your-gemini-api-key"
OPENROUTER_API_KEY="your-openrouter-api-key"

# ── Grounding (defaults to enabled) ───────────────────────────────────────
ENABLE_AI_GROUNDING="true"
ENABLE_RULE_GROUNDING="true"

# ── App ───────────────────────────────────────────────────────────────────
NODE_ENV="development"
BACKEND_PORT=4000
FRONTEND_URL="http://localhost:3000"
BACKEND_URL="http://localhost:4000"
Key variable notes:
  • DATABASE_URL must be the pooled Neon connection string. The running application uses this for all queries.
  • DIRECT_DATABASE_URL must be the direct (non-pooled) Neon connection string. Prisma uses this exclusively for migrations.
  • JWT_SECRET must be a long, random string. In production, generate one with openssl rand -base64 64.
  • You only need one AI key to get started. Set GEMINI_API_KEY for Google Gemini 2.0 Flash or OPENROUTER_API_KEY for OpenRouter-hosted models.
Google OAuth (GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, GOOGLE_CALLBACK_URL) is optional for local development. Email/password authentication works out of the box without it.
4

Start Redis

The job queue and AI response cache both require a running Redis instance. For local development without authentication, spin one up with Docker:
docker run --name ai-analyzer-redis -p 6379:6379 -d redis:7-alpine
Alternatively, if you prefer to start all local services (Redis + PostgreSQL) together, use the provided Compose file:
docker compose up -d
The docker-compose.yml in the repo root starts both redis:7-alpine and postgres:16-alpine. If you are connecting to a Neon database, you only need the Redis service — comment out the postgres service or start Redis individually as shown above.
Verify Redis is responding:
docker exec ai-analyzer-redis redis-cli ping
# Expected output: PONG
5

Prepare the Database

Generate the Prisma client from the schema, then apply the committed baseline migration to your target database.
# Generate the Prisma client (required after any schema change)
pnpm db:generate

# Apply all committed migrations to your database
pnpm db:migrate:deploy
Do not use prisma db push on shared, staging, or production databases. Always go through the migration workflow. For future local schema changes, create a tracked migration with pnpm db:migrate:dev --name describe-your-change.
You can verify the schema by opening Prisma Studio:
pnpm db:studio
6

Run the App

Start the full monorepo in development mode. Turborepo will run the frontend and backend in parallel with hot reload enabled.
pnpm dev
Once the servers start, you will see:
🚀 Backend running on http://localhost:4000
✓ Ready on http://localhost:3000
ServiceURL
Frontend (Next.js)http://localhost:3000
Backend API (NestJS)http://localhost:4000
Health checkhttp://localhost:4000/health
7

Submit Your First Analysis

With everything running, you are ready to analyze a startup idea. Open the web app in your browser at http://localhost:3000, register an account, and paste your idea into the submission form.You can also call the API directly. First, register and log in to receive an accessToken cookie, then submit an idea:
curl -X POST http://localhost:4000/analysis \
  -H "Content-Type: application/json" \
  -H "Cookie: accessToken=<your-token>" \
  -d '{"idea": "A platform that helps remote teams track async work across time zones"}'
A successful response returns the new analysis record with its id and an initial status of PENDING:
{
  "id": "clx9f2m3k0000abc123def456",
  "idea": "A platform that helps remote teams track async work across time zones",
  "status": "PENDING",
  "createdAt": "2025-01-01T00:00:00.000Z"
}
Poll for progress while the 14 agents are running:
curl http://localhost:4000/analysis/clx9f2m3k0000abc123def456/progress \
  -H "Cookie: accessToken=<your-token>"
{
  "id": "clx9f2m3k0000abc123def456",
  "status": "PROCESSING",
  "progress": 45
}
The progress field moves from 05 (job picked up) → 90 (Phase 1 complete) → 98 (Phase 2 and grounding complete) → 100 (ComprehensiveIdeaAnalyzer complete, database written). When status is COMPLETED, fetch the full report:
curl http://localhost:4000/analysis/clx9f2m3k0000abc123def456 \
  -H "Cookie: accessToken=<your-token>"
The frontend polls GET /analysis/:id/progress automatically and updates the progress bar in real time. You do not need to poll manually when using the UI.

What to Do Next

After your first successful analysis, explore the other capabilities of the platform:
  • Regenerate a sectionPOST /analysis/:id/regenerate/:section re-runs a single agent without repeating the full pipeline.
  • Chat about an analysisPOST /analysis/chat lets you ask follow-up questions grounded in the existing report.
  • Retry a failed analysisPOST /analysis/:id/retry re-enqueues a job whose status is FAILED.
  • Review your plan usageGET /analysis/me/plan returns your current tier and remaining analyses for the month.

Build docs developers (and LLMs) love