Amigo Invisible is deployed as two independent Vercel projects — one for the Angular frontend and one for the Node.js backend. The frontend is a static single-page application served from prebuilt HTML, CSS, and JavaScript files. The backend runs as a serverless function, meaning each incoming HTTP request spins up the Express app on demand without maintaining a persistent process.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Sufianeh7/AmigoInvisible/llms.txt
Use this file to discover all available pages before exploring further.
How Each Part Deploys
Backend
TheNode/vercel.json file tells Vercel to compile index.js using the @vercel/node builder and to forward every incoming request path to that same entry point. This gives the Express router full control over routing.
Node/vercel.json
Frontend
TheAngular/vercel.json file rewrites all URL paths to /index.html. This is the standard pattern for single-page applications — it ensures that navigating directly to any Angular route (e.g. /grupo/abc123) returns the app shell rather than a 404 from Vercel’s static file server.
Angular/vercel.json
Deploying the Backend
Create a new Vercel project
Log in to vercel.com and click Add New → Project. Import your GitHub repository (e.g.
AmigoInvisible). If prompted to authorise Vercel’s GitHub integration, do so now.Set the Root Directory to Node
In the project configuration screen, expand Root Directory and type
Node. This tells Vercel to treat the Node/ folder as the project root so it picks up index.js, package.json, and vercel.json from that directory.Add environment variables
Under Environment Variables, add the three required variables before the first deploy:
Setting
| Name | Value |
|---|---|
MONGO_URI | Your MongoDB Atlas connection string |
EMAIL_USER | Your Gmail address |
EMAIL_PASS | Your Gmail App Password |
NODE_ENV | production |
NODE_ENV=production tells the Express app to skip app.listen() so the module exports cleanly as a serverless function handler. See the Environment Variables page for details on how to obtain each value.Deploying the Frontend
Create a second Vercel project
From the Vercel dashboard click Add New → Project again and import the same repository. Vercel supports multiple projects from a single repo.
Set the Root Directory to Angular
Set the Root Directory to
Angular. Vercel will detect an Angular project and configure the framework preset automatically.Configure the build settings
Confirm or manually set the following build settings:
The
| Setting | Value |
|---|---|
| Build Command | npm run build |
| Output Directory | dist/Angular/browser |
dist/Angular/browser path is where the Angular CLI places the compiled static assets when building for production. The project name defined in angular.json is Angular (capital A), which determines this directory name.Update the backend URL in the source code
Before triggering the deploy, open
Angular/src/app/servicios/grupo.ts and replace the apiUrl value with the production URL of your backend project from the previous section. See Connecting Frontend to Backend for the exact line to change.Connecting Frontend to Backend
TheGrupoService class in Angular/src/app/servicios/grupo.ts contains the backend API URL hardcoded as a private class property:
Angular/src/app/servicios/grupo.ts
GrupoService — creating a sorteo, fetching group data by admin token, and triggering the draw — constructs its request URL from this base property, so an incorrect value will cause all API calls to fail silently.
Simply replace the URL string with the one Vercel assigned to your backend project, save the file, and re-run the Angular build.
Vercel’s free (Hobby) tier is entirely sufficient for personal Secret Santa groups. The serverless backend has no persistent connections to manage, and MongoDB Atlas’s free M0 cluster handles the light read/write load with no issue. You will not need to upgrade either service for a typical group of friends or family.