MindFlow’s three components — the Next.js frontend, the NestJS backend, and the PostgreSQL database — are deployed independently in production. TheDocumentation 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.
compose.yml file at the repository root is a local-development convenience only and is not used in any production workflow. Each component can be hosted on the platform that best suits it, and they communicate over the public internet using environment variables that are configured per deployment.
Recommended providers
Database setup
Set up and migrate the database before deploying the backend. All subsequent backend deployments must run migrations before new replicas start serving traffic.Create a managed PostgreSQL instance
Create a PostgreSQL database on your chosen provider (Neon, Supabase, or similar). Copy the full connection URL provided by the dashboard and store it as
DATABASE_URL in your deployment platform’s secret store.Enable TLS/SSL
Most managed PostgreSQL providers require TLS connections. Follow your provider’s documentation to append the necessary SSL parameters to
DATABASE_URL. For example, Neon connections typically include ?sslmode=require.Backend deployment
The NestJS backend must be built from the repository root so that the@mindflow/shared workspace package is available during compilation.
Set the build root to the repository root
Configure your deployment platform to use the repository root (not
apps/backend) as the build directory. The backend imports from @mindflow/shared, so the full monorepo context is required at build time.Configure the build command
Use the following build command, which installs dependencies, compiles the shared package, generates the Prisma client, and compiles the backend:
Configure the release / pre-deploy command
Set the release or pre-deploy hook to run migrations. This runs after the build succeeds but before traffic is switched to the new version:
Deploying with Docker
If your platform uses container-based deployments, point the platform at the backend Dockerfile. The build context must be the repository root:The multi-stage
apps/backend/Dockerfile produces a minimal node:20-alpine runner image that runs the compiled backend as a non-root user and listens on port 3001.Set backend environment variables
Provide the following environment variables in your platform’s secret management UI or vault:
| Variable | Notes |
|---|---|
NODE_ENV | Set to production |
DATABASE_URL | Full PostgreSQL connection string with SSL parameters |
JWT_SECRET | Random string ≥ 32 characters — must differ from AUTH_SECRET |
FRONTEND_URL | Comma-separated list of allowed CORS origins (production domain only) |
PORT | The platform typically assigns this automatically |
AI_SERVICE_API_KEY | Required if the Task Decomposer feature is enabled |
Frontend deployment on Vercel
Select Next.js as the framework
When creating a new Vercel project, choose Next.js as the framework preset. Vercel will automatically detect the Next.js application and configure build settings.
Set the project root to the repository root
Leave the Vercel project root pointing at the repository root — do not change it to
apps/frontend. This preserves the npm workspace structure and allows the build to resolve @mindflow/shared.Set frontend environment variables
Add the following variables in the Vercel project settings before triggering a build:
| Variable | Notes |
|---|---|
NEXT_PUBLIC_API_URL | Public URL of the backend including /api/v1, e.g. https://api.example.com/api/v1 |
NEXT_PUBLIC_APP_URL | Public URL of the frontend, e.g. https://example.com |
AUTH_SECRET | Random string ≥ 32 characters — must differ from JWT_SECRET |
AUTH_DEBUG | Set to false |
Pre-deployment verification
Run the following commands from the repository root to validate that the full build pipeline works before triggering a production deployment:Run backend tests
Execute the backend test suite in band (no parallel workers) to catch any regressions before deploying: