Running MindFlow locally without Docker gives you the fastest iteration cycle — hot-reload works for both the NestJS backend and the Next.js frontend, and you can attach a debugger directly to either process. This guide walks you through cloning the monorepo, installing dependencies, configuring environment variables, and starting each application in development mode.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/J0S3-LEON/pf_pruebasAseguramientoCalid_SDD/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Before you begin, make sure the following are available on your machine:- Node.js 20 or later — the monorepo tooling and both applications require it
- npm 9 or later — workspace hoisting relies on features added in npm 9
- A running PostgreSQL instance — local (e.g. via Homebrew,
pg_ctl, or a Docker container running separately) or a hosted service such as Neon or Supabase
Getting started
Install dependencies
Install all workspace dependencies from the lock file. Running
npm ci ensures a clean, reproducible install that matches exactly what is committed:Copy and configure environment files
Copy the root-level example file to create your local environment file, then open At a minimum you must set the following variables:
.env and fill in the required values:| Variable | Purpose |
|---|---|
DATABASE_URL | Full PostgreSQL connection string (e.g. postgresql://user:pass@localhost:5432/mindflow) |
JWT_SECRET | Random string of at least 32 characters for signing JWTs |
FRONTEND_URL | CORS origin allowed by the backend — http://localhost:3000 for local development |
AI_SERVICE_API_KEY | API key for the LLM provider if the Task Decomposer feature is enabled |
DATABASE_URL must point to a PostgreSQL instance that is already running and reachable before you start the backend.Build the shared package
The
@mindflow/shared package contains types and utilities consumed by both the backend and frontend. It must be compiled before either application can start:Generate the Prisma client
Generate the type-safe Prisma client from the database schema. This step is required on first setup and any time the Prisma schema changes:
Run database migrations
Apply all pending Prisma migrations to your PostgreSQL instance to create or update the schema:
Start the backend (terminal 1)
Start the NestJS development server with hot-reload. Leave this terminal open:The API will be available at
http://localhost:3001/api/v1 (or the port set in PORT).Start the frontend (terminal 2)
In a second terminal, start the Next.js development server:The application will be available at http://localhost:3000.
Development scripts
The following scripts are available from the repository root and apply across all workspaces:| Command | Description |
|---|---|
npm run lint | Run ESLint across all workspaces |
npm run format | Apply Prettier formatting across all workspaces |
npm test | Run the full Jest test suite |
npm run test:coverage | Run tests and generate a coverage report |
npm run prisma:generate --workspace @mindflow/backend | Regenerate the Prisma client after any schema change |