Carnero.Dev is configured for server-side rendering using theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/moradoadrian/carneroDev/llms.txt
Use this file to discover all available pages before exploring further.
@astrojs/node adapter in standalone mode. The production build generates a self-contained Node.js server in dist/ that can be deployed to any platform that runs Node.js. Unlike a static export, the SSR server processes every request at runtime, enabling dynamic registration handling, Supabase queries, and Resend email dispatch on each incoming request.
Production Build
Set environment variables
Ensure
RESEND_API_KEY is available in your deployment environment before starting the server. SUPABASE_URL and SUPABASE_ANON_KEY are currently hardcoded in src/lib/supabase.ts, so no env vars are required for Supabase connectivity in the default configuration — but you should replace those hardcoded values with environment variables before going to production. See the Environment Variables reference for details.Build the project
Run the production build from the project root:This executes
astro build and outputs a complete server bundle to dist/. The bundle includes the Node.js entry point at dist/server/entry.mjs, all compiled Astro pages and API routes, and all static assets under dist/client/.Start the production server
Launch the standalone Node.js server directly:The server listens on the port defined by the
PORT environment variable. If PORT is not set, it defaults to 4321. The process runs synchronously in the foreground — use a process manager such as PM2 or systemd to keep it alive in production.Node.js Requirements
The
engines field in package.json requires node >= 22.12.0. Ensure your deployment environment meets this requirement before running npm run build or starting the server. Most modern cloud platforms (Railway, Render, Fly.io) allow you to pin the Node.js version via a config file or environment variable — set it to 22 or higher to guarantee compatibility.Deployment Platforms
The standalone bundle runs on any platform that can execute a Node.js process. The following options cover the most common deployment targets:Railway
Set
RESEND_API_KEY in the Railway dashboard under Variables. Connect your GitHub repository and Railway will auto-detect the Node.js project. Set the start command to node dist/server/entry.mjs and the build command to npm run build in the service settings. If you have migrated src/lib/supabase.ts to read from env vars, add SUPABASE_URL and SUPABASE_ANON_KEY here as well.Render
Create a Web Service and point it to your repository. Set the Build Command to
npm run build and the Start Command to node dist/server/entry.mjs. Add RESEND_API_KEY as an environment variable in the Render dashboard under Environment. Add SUPABASE_URL and SUPABASE_ANON_KEY if you have updated src/lib/supabase.ts to read them from the environment.Fly.io
Use
fly launch with Node.js auto-detection, or provide a Dockerfile that runs npm run build and then node dist/server/entry.mjs. Inject secrets at deploy time with fly secrets set RESEND_API_KEY=... — Fly exposes these as standard environment variables at runtime. Add Supabase secrets if you have moved the credentials out of the hardcoded src/lib/supabase.ts.VPS / Self-hosted
Run
npm run build locally or in CI, then copy the dist/ directory to the target server via rsync or scp. Start the server with node dist/server/entry.mjs and manage the process using PM2 (pm2 start dist/server/entry.mjs) or a systemd service unit to ensure automatic restarts on failure or reboot.Environment Variables at Runtime
Environment variables must be available in the runtime environment, not just at build time. Because Carnero.Dev uses SSR (output: 'server' in astro.config.mjs), Astro reads process.env and import.meta.env on every incoming request — they are never baked into the static bundle.
The registration API route resolves the Resend key from both sources to handle every Node.js runtime context:
RESEND_API_KEY is missing or still set to the placeholder value, the registration is still saved to the database but email delivery is skipped and { email_sent: false } is returned in the response. See Behavior When Missing for the full breakdown.
Health Check
Carnero.Dev does not expose a dedicated health endpoint. Use the root/ route as a basic HTTP health check — a 200 OK response from GET / confirms that the Node.js server process is running and the Astro SSR runtime has initialized successfully. Configure your load balancer or uptime monitor to poll GET / and alert on non-200 responses or connection timeouts.