Metanow Docs
Contributing

Getting Started

Clone the repo, install dependencies, and run the MetaNow Console apps locally.

Prerequisites

ToolMinimum versionNotes
Node.js20Check with node -v
pnpm10Check with pnpm -v
PostgreSQL15Must have the pgvector extension available
Redis6Used by BullMQ job queues

Clone and install

git clone https://cloud2.cloud-blueberry.com/internal-projects/metanow-console.git
cd metanow-console
pnpm install

pnpm install runs postinstall hooks automatically, including fumadocs-mdx for the docs app.

Environment variables

Copy the example file and fill in the required values:

cp .env.example .env

Required variables

VariableDescription
DATABASE_URLPostgreSQL connection string with pgvector
CORS_ORIGINURL of the web app (e.g. http://localhost:3001)
BETTER_AUTH_SECRETRandom string, at least 32 characters
BETTER_AUTH_URLURL of the server (e.g. http://localhost:8000)
REDIS_URLRedis connection string
STRIPE_SECRET_KEYStripe secret key (from Stripe Dashboard → Developers)
STRIPE_WEBHOOK_SECRETStripe webhook signing secret
OPENAI_API_KEYUsed by the embedding service for vector generation
HETZNER_S3_ENDPOINTHetzner Object Storage endpoint URL
HETZNER_S3_BUCKETBucket name
HETZNER_S3_ACCESS_KEYObject storage access key
HETZNER_S3_SECRET_KEYObject storage secret key

AI provider (at least one required)

VariableDescription
AI_PROVIDERanthropic (default) or gemini
ANTHROPIC_API_KEYRequired when AI_PROVIDER=anthropic
GEMINI_API_KEYRequired when AI_PROVIDER=gemini

If the preferred provider key is missing, the factory falls back to the other available key. If neither is set, the server boots with the NoopAiProvider — generation calls return empty results without error.

Optional variables

VariableDefaultDescription
PORT8000NestJS server port
NODE_ENVdevelopmentdevelopment, production, or test
GOOGLE_CLIENT_ID—Enables Google OAuth sign-in
GOOGLE_CLIENT_SECRET—Required if GOOGLE_CLIENT_ID is set
AI_RATE_LIMIT_TTL3600AI rate limit window in seconds (per org)
AI_RATE_LIMIT_MAX20Max AI calls per org per window
SENTRY_DSN—Required in production; optional in development

Database setup

Run the migrations against a fresh PostgreSQL database. The pgvector extension must be installed in the database before running migrations:

CREATE EXTENSION IF NOT EXISTS vector;

Then:

pnpm db:migrate

To seed the database with initial data:

pnpm db:seed

Start the development servers

pnpm dev

Turbo starts all apps in parallel:

AppPort
apps/web — Next.js frontend3001
apps/server — NestJS API8000
apps/fumadocs — this documentation4000

To start only one app:

pnpm --filter web dev      # web only
pnpm --filter server dev   # server only
pnpm --filter fumadocs dev # docs only

Generate the OpenAPI spec and API client

After any change to a NestJS controller or DTO, regenerate the spec and the typed client:

pnpm generate-spec    # writes openapi.json at repo root
pnpm openapi-ts       # regenerates packages/api-client/src/*.gen.ts

To regenerate the API reference pages in this documentation:

pnpm --filter fumadocs generate:api

Type checking

pnpm check-types

Turbo runs tsc --noEmit across all packages.

Linting and formatting

pnpm check          # lint + format with auto-fix
pnpm lint           # lint only

MetaNow Console uses Biome for linting and formatting across the entire monorepo.

On this page