Backend principal para LPM. Guarda metadata en MongoDB y tarballs en R2/S3. (Nota: Por mientras no se usa Tarball directamentes, si no que se comprime el paquete en un archivo zip y se sube a R2, en un futuro se podria usar Tarball directamente).
Variables requeridas con NODE_ENV=production:
NODE_ENV=production
PORT=8787
CORS_ORIGIN=https://tu-frontend.com
JWT_SECRET=un-secreto-largo
JWT_EXPIRES_IN_SECONDS=2592000
MONGO_URI=mongodb+srv://...
MONGO_DB_NAME=latipm_registry
MONGO_SERVER_SELECTION_TIMEOUT_MS=10000
R2_ACCESS_KEY_ID=...
R2_SECRET_ACCESS_KEY=...
R2_BUCKET=...
R2_ENDPOINT=https://<account>.r2.cloudflarestorage.com
R2_PUBLIC_URL=https://cdn.tu-dominio.com
RATE_LIMIT_WINDOW_MS=60000
RATE_LIMIT_MAX=300
MAX_PACKAGE_BYTES=26214400bun install
bun run typecheck
bun run startGET /healthPOST /v1/auth/signupPOST /v1/auth/loginGET /v1/auth/mePATCH /v1/users/meGET /v1/search?q=mathGET /v1/packages/:nameGET /v1/packages/:name/:versionGET /v1/packages/:name/dependentsGET /v1/packages/:name/stats?days=30POST /v1/packages/:name/:versionGET /v1/download/:name/:versionGET /v1/users/me/packagesGET /v1/users/:id
Los usuarios pueden tener metadata publica para el frontend:
{
"username": "latino-dev",
"displayName": "Latino Dev",
"avatarUrl": "https://example.com/avatar.png",
"bio": "Mantengo paquetes para Latino",
"website": "https://example.com",
"github": "usuario-github"
}GET /v1/packages/:name devuelve owner con este perfil publico, listo para mostrarlo en una pagina tipo npm.