This guide walks you through running the complete Amigo Invisible stack on your local machine. By the end you will have the Node.js/Express API connected to MongoDB, the Angular SPA served onDocumentation 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.
localhost:4200, and everything wired together so you can create a group and trigger a real Secret Santa draw with emails going out.
Prerequisites
Make sure the following are available on your machine before you start:- Node.js 18+ and npm — verify with
node -vandnpm -v. - Angular CLI — install globally if you do not already have it:
- MongoDB connection string — either a free MongoDB Atlas cluster or a locally running MongoDB instance.
- Gmail account with an App Password — standard Gmail passwords will not work; see the tip at the bottom of this page.
Clone the Repository
Setup Steps
Configure the Backend
Create a
.env file inside the Node/ directory. The server reads these four variables at startup via dotenv:Node/.env
| Variable | Purpose |
|---|---|
MONGO_URI | Full MongoDB connection string including database name |
EMAIL_USER | The Gmail address Nodemailer will send from |
EMAIL_PASS | A Gmail App Password (not your regular Gmail password) |
PORT | The port Express will listen on (defaults to 3000) |
Start the Backend
Open a terminal, navigate to the If you see
Node/ directory, install dependencies, and start the development server:npm run dev uses nodemon so the server restarts automatically on any file change. You should see both of these lines in the console before continuing:❌ Error al conectar a MongoDB, double-check your MONGO_URI value and that your Atlas cluster allows connections from your IP address.Start the Frontend
Open a new terminal (keep the backend running), navigate to the You should see the group-creation form. The Angular app is pre-configured to call the production backend URL in
Angular/ directory, install dependencies, and start the dev server:npm start runs ng serve. Once compilation finishes, open your browser and navigate to:GrupoService. To point it at your local backend instead, open Angular/src/app/servicios/grupo.ts and change apiUrl to http://localhost:3000/api/sorteos.Create Your First Group
With both servers running, use the form at
http://localhost:4200 to create a test draw:- Enter a group name (e.g., “Office Party 2025”).
- Optionally set a budget.
- Add at least 3 participants, each with a name and a valid email address. You can add exclusions to any participant by listing the names of people they must not give a gift to.
- Click Create Group. The backend generates a UUID
adminTokenand redirects you to/sorteo/:adminToken. - On the admin page, review the participant list, then click Launch Draw. The algorithm runs, updates the draw status to
completado, and immediately sends an individual email to each participant.
EMAIL_USER address revealing only their own assignment.