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.

AI Startup Analyzer ships with two Docker Compose configurations: a lightweight development file that spins up only the stateful services (PostgreSQL and Redis) so you can run the backend and frontend natively, and a full production file that builds and orchestrates every container together. Both configurations use official Alpine-based images and include health checks so dependent services wait for their dependencies to be ready before starting.

Local Development

In development the recommended workflow is to use Docker only for the infrastructure services — PostgreSQL and Redis — while running the NestJS backend and Next.js frontend directly on your machine with pnpm dev. This lets you take advantage of hot-reloading and fast TypeScript compilation without rebuilding images on every change.
1
Clone the repository and install dependencies
2
git clone https://github.com/Abbaddii-99/AI-Startup-Analyzer.git
cd AI-Startup-Analyzer
pnpm install
3
Copy the example environment file
4
cp .env.example .env
5
Open .env and fill in your DATABASE_URL, DIRECT_DATABASE_URL, and any AI API keys. The default values for REDIS_HOST, REDIS_PORT, BACKEND_PORT, and FRONTEND_URL match the Docker Compose service definitions and work without changes for local development.
6
Start PostgreSQL and Redis
7
docker compose up -d
8
This command starts the two services defined in docker-compose.yml and leaves them running in the background. Both containers expose their standard ports to localhost and persist data in named volumes.
9
version: '3.8'

services:
  postgres:
    image: postgres:16-alpine
    container_name: ai-analyzer-postgres
    environment:
      POSTGRES_USER: user
      POSTGRES_PASSWORD: password
      POSTGRES_DB: ai_analyzer
    ports:
      - "5432:5432"
    volumes:
      - postgres_data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U user"]
      interval: 10s
      timeout: 5s
      retries: 5

  redis:
    image: redis:7-alpine
    container_name: ai-analyzer-redis
    ports:
      - "6379:6379"
    volumes:
      - redis_data:/data
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 10s
      timeout: 5s
      retries: 5

volumes:
  postgres_data:
  redis_data:
10
Apply database migrations
11
pnpm db:migrate:deploy
12
Start the backend and frontend
13
pnpm dev
14
The NestJS API will be available on http://localhost:4000 and the Next.js frontend on http://localhost:3000.

Production Deployment

The production Docker Compose file (docker-compose.prod.yml) builds the backend and frontend from their respective multi-stage Dockerfiles and runs the entire stack — Redis, backend, and frontend — as a coordinated set of containers inside a dedicated bridge network. PostgreSQL is intentionally omitted from the production Compose file because the production stack is designed to connect to an external managed database such as Neon.
1
Copy and configure the production environment file
2
cp .env.example .env.prod
3
Edit .env.prod and set the following required values before deploying:
4
VariableDescriptionDATABASE_URLPooled connection string from your Neon (or other PostgreSQL) projectDIRECT_DATABASE_URLDirect (non-pooled) connection string used by Prisma for migrationsREDIS_PASSWORDA strong random password for the Redis instanceJWT_SECRETA long, random string used to sign JWT tokensGEMINI_API_KEYYour Google Gemini API key (or leave blank if using OpenRouter)OPENROUTER_API_KEYYour OpenRouter API key (or leave blank if using Gemini)FRONTEND_URLThe public URL of the frontend, e.g. https://app.example.comBACKEND_URLThe public URL of the backend API, passed to the frontend build as NEXT_PUBLIC_API_URL
5
Build and launch the production stack
6
docker compose --env-file .env.prod -f docker-compose.prod.yml up -d --build
7
Docker Compose will build the backend and frontend images, then start the containers in dependency order: Redis first, then the backend once Redis is healthy, and finally the frontend once the backend is running.
8
Verify the containers are healthy
9
docker compose -f docker-compose.prod.yml ps
10
All three services should show a running or healthy status. The backend exposes a /health endpoint that the container health check polls every 30 seconds.

Port Mappings

ServiceContainer PortHost Port
Backend (NestJS API)40004000
Frontend (Next.js)30003000
PostgreSQL54325432
Redis63796379

Automatic Database Migrations

The backend container’s startup command runs prisma migrate deploy before launching the NestJS API server. This means every time the backend container starts it applies any pending committed migrations to the database automatically — no manual migration step is needed after a deployment. The relevant section of apps/backend/Dockerfile is:
CMD ["sh", "-c", "cd /app/packages/db && pnpm exec prisma migrate deploy && cd /app/apps/backend && node dist/main.js"]
If prisma migrate deploy fails — for example because DATABASE_URL or DIRECT_DATABASE_URL is incorrect, or the database is unreachable — the backend container will exit immediately with a non-zero code. Check the container logs with docker compose -f docker-compose.prod.yml logs backend to diagnose migration errors before restarting.

Useful Commands

# Tail logs for all services
docker compose -f docker-compose.prod.yml logs -f

# Tail logs for the backend only
docker compose -f docker-compose.prod.yml logs -f backend

Build docs developers (and LLMs) love