Skip to main content

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.

Amigo Invisible is a full-stack Secret Santa organizer that removes all the friction from running a gift-exchange draw. Instead of shuffling names in a hat or trusting a spreadsheet, an organizer fills out a single form and the app handles participant management, the random-assignment algorithm (with exclusion rules), and the delivery of personalized emails — all without requiring anyone to create an account. It is built as an Angular single-page application talking to a Node.js/Express REST API backed by MongoDB, and it can be deployed to Vercel in minutes.

What It Does

The entire experience — from blank form to everyone’s inboxes — takes only a few clicks.
1

Create a Group

The organizer visits the homepage, enters the group name, an optional budget, and the list of participants (name + email). Each participant can optionally exclude one or more other participants — people they must not be assigned to give a gift to.
2

Receive Your Admin Link

After submitting the form, the backend generates a cryptographically random adminToken (a UUID v4) and returns a unique admin URL in the format /sorteo/:adminToken. The organizer bookmarks this URL — it is the only credential needed to manage the group.
3

Review the Group

Navigating to the admin URL shows the full participant list and the current draw status (borrador / completado), so the organizer can double-check everything before proceeding.
4

Launch the Draw

One click triggers the backend algorithm. It shuffles participants up to 1,000 times until a valid assignment is found — one where no one is assigned to themselves and no exclusion rule is violated.
5

Emails Are Sent

Immediately after a valid draw is found, Nodemailer sends each participant a personalized HTML email telling them exactly who they are buying a gift for. The organizer is never shown the full results.

Tech Stack

Angular 22

A single-page application with two routes, two components (Grupo and Sorteo), and one service (GrupoService). Styled with Tailwind CSS and deployed as a static bundle to Vercel.

Node.js / Express 5

A lightweight REST API with three endpoints mounted at /api/sorteos. Uses dotenv for configuration, cors for cross-origin requests, and Node’s built-in crypto module for token generation. Runs as a Vercel serverless function in production.

MongoDB / Mongoose 9

A single Sorteo collection stores every group document, including the participant list, exclusions, draw status, adminToken, and historical pairings. Mongoose 9 provides the schema and validation layer.

Nodemailer 8 / Gmail SMTP

Sends individualized HTML emails through Gmail’s SMTP server (port 465, SSL). The sender address and credentials are kept entirely server-side via environment variables — participants only ever see their own assignment.

Core Concepts

Sorteo is the central domain object — it represents both the group and the draw itself. A Sorteo document holds the group name, an optional budget, an optional delivery date, the participant list, the draw state (borrador while pending, completado once run), and a history of past pairings for future re-use. Every interaction with the API is scoped to a single Sorteo. Participante is an embedded sub-document inside a Sorteo. Each participant has a nombre (name), an email address (used both for delivery and as the unique key in the pairing algorithm), and an optional exclusiones array listing the names of participants they must not give a gift to. The algorithm enforces both the self-assignment rule and all exclusion rules before accepting any draw result. adminToken is a UUID generated by Node’s built-in crypto.randomUUID() at the moment the group is created. It is stored on the Sorteo document and embedded in the admin URL. There is no login, no password, and no session — whoever holds the URL can view and launch the draw. This token is the sole identity mechanism for managing a group.

Repository Layout

The repository contains two top-level directories that map directly to the two tiers of the application: Angular/ holds the full Angular workspace — components, routes, services, and Tailwind configuration — and Node/ holds the Express server — routes, controllers, Mongoose models, and utility modules for the draw algorithm and email delivery. The two directories are entirely independent; each has its own package.json and can be installed, run, and deployed separately.
No user accounts or registration are required at any point. The adminToken URL is the identity — anyone who has it can manage the group. Keep it safe and share it only with trusted organizers. If it is lost, there is no account-recovery flow.

Build docs developers (and LLMs) love