How microclub-usthb/mcid works
MCID is a Discord identity and access platform: its NestJS API is the runtime center, with a Next.js admin panel and a CLI as user-facing clients. The main workflow is an admin or project client authenticating, managing projects and access, then using API capabilities such as channels, sync, and webhooks. Inbound webhook submissions have distinct schema, draft, file, and ingest stages. The README documents shared contracts and schema validation; unsampled subsystems are included without asserting unshown call paths. Edges are limited to relationships evidenced by excerpts, the source index, or README statements.
Main entry points: inbound-webhook-ingest.controller.ts Ingest endpoints · database.module.ts Postgres · dashboard Admin panel · webhook-flow.ts Webhook flow
Components 27
User clients
- Admin panel
apps/web/src/app/dashboard - Web API client
apps/web/src/shared/lib/api-client.ts - CLI commands
apps/cli/src/commands/webhook.ts - Webhook flow
apps/cli/src/webhook-flow.ts - CLI session
apps/cli/src/session.ts - CLI profiles
apps/cli/src/config.ts - CLI API client
apps/cli/src/lib/client.ts
Identity and access
- Authentication routes
apps/api/src/modules/auth/auth.controller.ts - Auth services
apps/api/src/modules/auth/auth.service.ts - Admin access guard
apps/api/src/common/guards/admin-access.guard.ts - Project API-key guard
apps/api/src/common/guards/api-key.guard.ts - Permissions
apps/api/src/modules/permissions/permissions.controller.ts
Project operations
- Project management
apps/api/src/modules/projects/projects.service.ts - Discord channels
apps/api/src/modules/channels/channels.controller.ts - Server sync
apps/api/src/modules/sync - Outbound webhooks
apps/api/src/modules/webhooks/webhooks.controller.ts
Inbound webhooks
- Ingest endpoints
apps/api/src/modules/inbound-webhooks/inbound-webhook-ingest.controller.ts - Submission handling
apps/api/src/modules/inbound-webhooks/inbound-webhooks.service.ts - Form schema validation
packages/form-schema/src/payload.validator.ts - File storage
apps/api/src/modules/inbound-webhooks/files/s3.storage.ts
Shared runtime
- Postgres
apps/api/src/database/database.module.ts - Redis
apps/api/src/common/redis/redis.service.ts - Shared contracts
packages/contracts/src/inbound-webhooks.ts
Other components
- Admin user
- Project client
- Discord
- S3-compatible store
Connections 29
- Admin user → Admin panel: uses
README.md - Admin panel → Web API client: requests via
apps/web/src/shared/lib/api-client.ts - Project client → Project API-key guard: authenticates with key
apps/api/src/common/guards/api-key.guard.ts - Project API-key guard → Postgres: checks project key
apps/api/src/common/guards/api-key.guard.ts - Admin user → Authentication routes: signs in
apps/api/src/modules/auth/auth.controller.ts - Authentication routes → Auth services: delegates to
apps/api/src/modules/auth/auth.controller.ts - Admin access guard → Postgres: validates session
apps/api/src/common/guards/admin-access.guard.ts - Permissions → Admin access guard: guards routes
apps/api/src/modules/permissions/permissions.controller.ts - Admin user → Project management: manages projects
README.md - Project management → Postgres: stores project state
- Project client → Discord channels: uses API
README.md - Discord channels → Discord: performs Discord operations
- Server sync → Discord: synchronizes server state
- Admin user → Server sync: manages sync
README.md - Project client → Outbound webhooks: configures webhooks
README.md - Project client → Ingest endpoints: submits payloads
apps/api/src/modules/inbound-webhooks/inbound-webhook-ingest.controller.ts - Ingest endpoints → Submission handling: delegates handling
apps/api/src/modules/inbound-webhooks/inbound-webhook-ingest.controller.ts - Submission handling → Form schema validation: validates payload
README.md - Ingest endpoints → File storage: accepts file uploads
apps/api/src/modules/inbound-webhooks/inbound-webhook-ingest.controller.ts - File storage → S3-compatible store: stores files
apps/api/src/modules/inbound-webhooks/files/s3.storage.ts - CLI commands → Webhook flow: runs webhook flow
apps/cli/src/commands/webhook.ts - Webhook flow → CLI session: resolves session
apps/cli/src/webhook-flow.ts - CLI session → CLI profiles: reads profile
apps/cli/src/session.ts - Webhook flow → Form schema validation: prechecks schema
README.md - CLI commands → CLI API client: sends API requests
apps/cli/src/commands/webhook.ts - CLI API client → Ingest endpoints: calls API
- Admin panel → Shared contracts: shares wire types
- Submission handling → Postgres: persists submissions
- Authentication routes → Redis: uses runtime cache