How richardherold32/contesthub works
ContestHub lets visitors discover and inspect contests, then sign in to bookmark them; administrators can manage published contest records, while a background job synchronizes Codeforces contests. The frontend routes user actions through shared API and session helpers to Express routes, validation, services, and PostgreSQL. The README also documents filtering, pagination, account/session security, bookmarks, admin management, and synchronization. Edges below are limited to relationships shown in the README or source index/excerpts; some feature internals are unsampled, so their connections are left undocumented.
Main entry points: App.tsx App routes · prisma.ts Prisma client · app.ts Express app · api.ts API client
Components 27
ContestHub client
- App routes
client/src/App.tsx - API client
client/src/api.ts - Contest queries
client/src/contests.ts - Contest summary
client/src/ContestSummary.tsx - Sign-in pages
client/src/AuthPage.tsx - Bookmarks page
client/src/Bookmarks.tsx - Contest editor
client/src/AdminContests.tsx - Session state
client/src/session.ts
HTTP API
- Express app
server/src/app.ts - Contest routes
server/src/routes/contests.ts - Auth routes
server/src/routes/auth.ts - Bookmark routes
server/src/routes/bookmarks.ts - Admin routes
server/src/routes/admin-contests.ts
Contest and identity services
- Request validation
server/src/validation/contests.ts - Account validation
server/src/validation/auth.ts - Contest service
server/src/services/contests.ts - Auth service
server/src/services/auth.ts - Bookmark service
server/src/services/bookmarks.ts - Admin contest service
server/src/services/admin-contests.ts - Session middleware
server/src/middleware/auth.ts - Sync job
server/src/services/codeforces-job.ts - Codeforces adapter
server/src/services/codeforces.ts
Persistence and integrations
- Prisma client
server/src/lib/prisma.ts - PostgreSQL
server/prisma/schema.prisma
Other components
- Visitor
- Administrator
- Codeforces
Connections 40
- Visitor → App routes: uses
client/src/App.tsx - Administrator → App routes: uses
client/src/App.tsx - App routes → Contest queries: queries
client/src/App.tsx - App routes → Contest summary: renders
client/src/App.tsx - App routes → Sign-in pages: routes
client/src/App.tsx - App routes → Bookmarks page: routes
client/src/App.tsx - App routes → Contest editor: routes
client/src/App.tsx - Contest queries → API client: requests
client/src/contests.ts - Sign-in pages → API client: requests
client/src/AuthPage.tsx - Sign-in pages → Session state: updates
client/src/AuthPage.tsx - Bookmarks page → API client: requests
client/src/Bookmarks.tsx - Bookmarks page → Contest summary: renders
client/src/Bookmarks.tsx - Bookmarks page → Session state: reads
client/src/Bookmarks.tsx - Contest editor → API client: requests
client/src/AdminContests.tsx - Contest editor → Session state: reads
client/src/AdminContests.tsx - API client → Express app: HTTP calls
README.md - Express app → Contest routes: mounts
server/src/app.ts - Express app → Auth routes: mounts
server/src/app.ts - Express app → Bookmark routes: mounts
server/src/app.ts - Express app → Admin routes: mounts
server/src/app.ts - Contest routes → Request validation: parses
server/src/routes/contests.ts - Contest routes → Contest service: calls
server/src/routes/contests.ts - Auth routes → Account validation: parses
server/src/routes/auth.ts - Auth routes → Auth service: calls
server/src/routes/auth.ts - Auth routes → Session middleware: checks session
server/src/routes/auth.ts - Bookmark routes → Session middleware: checks session
server/src/routes/bookmarks.ts - Bookmark routes → Bookmark service: calls
server/src/routes/bookmarks.ts - Admin routes → Session middleware: checks session
server/src/routes/admin-contests.ts - Admin routes → Admin contest service: calls
server/src/routes/admin-contests.ts - Admin routes → Request validation: parses
server/src/routes/admin-contests.ts - Session middleware → Auth service: resolves user
server/src/middleware/auth.ts - Auth service → Prisma client: queries
server/src/services/auth.ts - Contest service → Prisma client: queries
server/src/services/contests.ts - Bookmark service → Prisma client: queries
server/src/services/bookmarks.ts - Admin contest service → Contest service: uses
server/src/services/admin-contests.ts - Admin contest service → Prisma client: queries
server/src/services/admin-contests.ts - Prisma client → PostgreSQL: persists
README.md - Sync job → Codeforces adapter: calls
server/src/services/codeforces-job.ts - Sync job → Prisma client: writes
server/src/services/codeforces-job.ts - Codeforces adapter → Codeforces: fetches contests