How dxxdev/ai-creative-hub works
AI Creative Hub is a web application for account-based creative publishing. Users register or sign in, then create posts that can include uploaded images; posts are processed asynchronously before publication, and clients can browse or view posts. The API also supports email verification, password recovery, session refresh/logout, media upload and real-time processing updates. The tree and sampled files establish these capabilities and several key connections; source for some routes and services was not sampled, so uncertain internal wiring is omitted.
Main entry points: server.ts API server · auth.service.ts Auth service · image-processing.worker.ts Image worker · api-client.ts API client
Components 24
Web client
- Auth pages
apps/web/app/(auth)/login/page.tsx - Home page
apps/web/app/page.tsx - API client
apps/web/lib/api-client.ts - Auth store
apps/web/store/auth.store.ts
Identity and accounts
- API server
apps/api/src/server.ts - Auth routes
apps/api/src/routes/auth.routes.ts - Login controller
apps/api/src/modules/auth/login.controller.ts - Auth service
apps/api/src/services/auth.service.ts - Account flows
apps/api/src/modules/auth - Email delivery
apps/api/src/lib/mailer.ts
Posts and media
- Post routes
apps/api/src/routes/posts.routes.ts - Post controller
apps/api/src/controllers/posts.controller.ts - Post service
apps/api/src/services/posts.service.ts - Media routes
apps/api/src/routes/media.routes.ts - Media controller
apps/api/src/controllers/media.controller.ts - Local storage
apps/api/src/services/local-storage.service.ts
Background processing
- Image queue
apps/api/src/queues/image-processing.queue.ts - Image worker
apps/api/src/queues/image-processing.worker.ts - Live updates
apps/api/src/websocket/socket.ts
Shared contracts
- Shared schemas
packages/shared/src/schemas/index.ts
Connections 26
- Visitor → Auth pages: uses
- Visitor → Home page: browses
- Auth pages → API client: requests
- Home page → API client: requests
- API client → API server: fetches API
- API client → Auth store: refreshes session
- API server → Auth routes: mounts routes
- Auth routes → Login controller: dispatches login
- Login controller → Auth service: calls login
- Auth service → Postgres: reads/writes
- Auth service → Redis: stores reset token
- Auth service → Email delivery: queues reset email
- Email delivery → Email provider: sends email
- API server → Post routes: mounts routes
- Post routes → Post controller: dispatches
- Post controller → Post service: calls
- Post service → Postgres: reads/writes
- API server → Media routes: mounts routes
- Media routes → Media controller: dispatches
- Media controller → Local storage: stores upload
- API server → Image worker: registers worker
- Image worker → Local storage: reads source file
- Image worker → Postgres: updates post
- Image worker → Live updates: emits status
- Post controller → Shared schemas: uses schemas
- Auth routes → Shared schemas: validates inputs