This document describes how the app is run locally, packaged, and how CI/CD is set up. Secrets and exact Azure names live in your environment or GitHub; see .env.example for variable names.
- API —
npm run start:dev(NestJS, default port fromPORT, usually3000). - MongoDB —
docker compose up -dstartsmongo:7on port27017with a named volume for data. SetMONGODB_URI=mongodb://localhost:27017/ai-crate-diggerin.env. - Seed —
npm run seed:discogsneedsDISCOGS_USER_TOKENand usesDISCOGS_SEED_TARGET/DISCOGS_SKIP_EMBEDDINGSfor cost control. - Optional UI —
npm run dev:clientruns the Vite dev server pointed at the API.
Dockerfile (multi-stage):
- Builder —
npm ci, copy sources,npm run build(Nestdist/). - Runner — production
npm ci --omit=dev, copydist/,CMD ["node", "dist/main.js"], expose3000.
Build and run are standard Docker workflows; compose in this repo is Mongo-only, not the API (run the API on the host or add a service if you want an all-in-one stack).
.github/workflows/ci-cd.yml runs on pushes and PRs to main:
- Checkout, Node 22,
npm ci,lint,build,test.
A docker-deploy job is commented out but documented in-repo: it would log into Azure, build/push to Azure Container Registry, and update an Azure Container Apps app image. Turning it on requires GitHub secrets such as AZURE_CREDENTIALS, ACR_NAME, ACR_LOGIN_SERVER, ACA_APP_NAME, and ACA_RESOURCE_GROUP, plus the same runtime secrets you use locally (Mongo URI, Azure OpenAI keys, etc.) configured on the container app.
- Azure OpenAI — Chat, embeddings, and optional TTS; endpoints and deployments are configured via
AZURE_OPENAI_*variables in.env. - Discogs API — Used only for seeding, via
DISCOGS_USER_TOKEN.
- After rewriting git history or rotating secrets, force-push branches and re-clone collaborators as needed; GitHub Actions and Container Apps should pick up new images from the pipeline once deploy is enabled.
- MongoDB backups for production are not defined in this repo; use Atlas, managed disk snapshots, or your platform’s backup story if you move beyond local Docker.