Vercel is the recommended platform for deploying Balsamoa Backend to production. Because Vercel runs your code as serverless functions, a few configuration details — particularly around the database connection and file storage — are important to get right before you go live. This guide walks you through every step, from importing the repository to verifying the live deployment.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/MateoNavarroMN/Balsamoa-Backend/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Before you begin, make sure you have the following ready:- A Vercel account (the free Hobby plan is sufficient)
- A Supabase project with the Balsamoa database schema already initialized
- Node.js 18 or later installed locally (for running the project during development)
- The repository pushed to a GitHub account that Vercel can access
Deployment steps
Push your repository to GitHub
Make sure the latest version of your code is on the
main branch of your GitHub repository. Vercel will pull directly from GitHub on every deploy.Import the project in the Vercel dashboard
- Log in to vercel.com and click Add New → Project.
- Under Import Git Repository, select the GitHub account that owns the repo, then choose Balsamoa-Backend from the list.
- Click Import to proceed to the build configuration screen.
Configure build settings
On the configuration screen, set the following options and leave everything else at its default:
Balsamoa Backend is a plain Node.js/Express server — there is no build step and no compiled output directory. Setting the framework to Other tells Vercel not to apply any framework-specific defaults.
| Setting | Value |
|---|---|
| Framework Preset | Other |
| Build Command | (leave empty) |
| Output Directory | (leave empty) |
| Install Command | pnpm install |
Add environment variables
Scroll down to the Environment Variables section and add the following:
| Name | Value |
|---|---|
DATABASE_URL | Your Supabase connection pooler URI (see Supabase pooler URL below) |
PUERTO does not need to be set. Vercel assigns the port automatically; the Express server falls back to port 3000 locally when the variable is absent, but on Vercel the platform handles port binding entirely.The vercel.json file
The repository includes avercel.json file at the project root that controls how Vercel handles incoming URLs:
| Option | What it does |
|---|---|
cleanUrls: true | Strips .html extensions from static file URLs (e.g. /admin/index instead of /admin/index.html). This keeps the public-facing URLs tidy and consistent. |
trailingSlash: false | Ensures Vercel redirects https://your-app.vercel.app/api/v1/tienda/productos/ to the version without a trailing slash. This prevents duplicate-URL issues and matches the route definitions in Express. |
Supabase pooler URL
Supabase provides two ways to connect to your PostgreSQL database:| Connection type | Port | When to use |
|---|---|---|
| Direct connection | 5432 | Long-lived processes — local development, dedicated servers, Docker containers |
| Connection pooler (PgBouncer) | 6543 | Serverless functions — Vercel, AWS Lambda, Netlify Functions |
5432, you would exhaust Supabase’s connection limit very quickly. The pooler on port 6543 uses PgBouncer to multiplex many short-lived connections through a smaller pool of real database connections, keeping the total count manageable.
To get your pooler URL:
- Open your Supabase project → Project Settings → Database.
- Under Connection string, select the URI tab.
- Copy the URI — it will look like
postgresql://postgres.[ref]:[password]@aws-0-[region].pooler.supabase.com:5432/postgres. - Change the port from
5432to6543and append?pgbouncer=trueto the query string.
DATABASE_URL environment variable in Vercel.
Image uploads on Vercel
Verifying the deployment
Once Vercel reports a successful deployment, confirm the API is reachable by calling the public products endpoint withcurl:
500 error, double-check that DATABASE_URL is set correctly in the Vercel project’s environment variable settings and that the pooler port is 6543.