How kunal1218/quadblitz works
Purpose and Topology
QuadBlitz is a campus-focused social platform for finding friends, collaborators, and cofounders. It is a TypeScript monorepo with three clients/services: Next.js web, Express API, and Expo mobile; shared contracts live in packages/shared/src/index.ts and packages/shared/src/types.ts.
Entrypoints and Clients
• The web application uses the Next.js App Router, rooted at apps/web/app/layout.tsx and apps/web/app/page.tsx. Route segments expose social, clubs, map, marketplace, messaging, profiles, and administration.
• The mobile Expo application starts through apps/mobile/index.ts and apps/mobile/App.tsx, with tab-oriented screens under apps/mobile/src/screens/tabs/.
• The API process starts at apps/api/src/index.ts; its route composition boundary is apps/api/src/routes/index.ts.
API Layering and Domain Modules
The Express backend follows routes → controllers → services → persistence/integrations. Representative boundaries are apps/api/src/routes/marketplaceRoutes.ts, apps/api/src/controllers/marketplaceController.ts, and apps/api/src/services/marketplaceService.ts. Domain modules cover authentication, feed/posts, friends, clubs, events/map, challenges, profiles, requests, notifications, direct/club chat, and marketplace conversations.
Identity, Session, and State Boundaries
Authentication is handled across apps/api/src/controllers/authController.ts and apps/api/src/services/authService.ts. User records are intended for PostgreSQL, while sessions are stored in Redis, accessed via apps/api/src/db/index.ts and apps/api/src/db/redis.ts. Web auth state is client-facing through apps/web/features/auth/AuthProvider.tsx; mobile API/session access is centralized in apps/mobile/src/api/client.ts.
Social Discovery Flow
Web pages and feature modules render campus activity, groups, friendship, requests, profiles, and discovery. The home feed is composed in apps/web/features/home/HomeDashboard.tsx; club views originate at apps/web/app/clubs/page.tsx; map discovery is organized around apps/web/features/map/MapDiscoveryPage.tsx. These clients call API endpoints, which delegate domain reads/writes to services; some provider data remains deliberately stubbed/mock-backed.
Real-Time and Communications
Chat, direct messages, club chat, notifications, and marketplace conversations are backend domains with a socket integration boundary in apps/api/src/services/socketService.ts. The web socket client is apps/web/lib/socket.ts; message routes include apps/web/app/messages/[handle]/page.tsx and marketplace-specific conversation pages under apps/web/app/marketplace/messages/.
Marketplace, Events, and Challenges
Marketplace supports listings, images, and buyer/seller conversations, with schema migrations in apps/api/src/db/migrations/20260209_create_listings_table.sql and apps/api/src/db/migrations/20260210_create_marketplace_conversations.sql. Map/events APIs are represented by apps/api/src/services/mapService.ts and apps/api/src/services/eventsService.ts; web maps use Mapbox through apps/web/features/map/MapCanvas.tsx. Challenges include attempt management and an AI judging boundary at apps/api/src/services/geminiJudgeService.ts.
Runtime and Infrastructure
Web deploys to Vercel; API, PostgreSQL, and Redis are intended for Railway. API configuration expects DATABASE_URL and REDIS_URL; browser/mobile clients use public API-base environment variables. Mapbox is an external browser-map dependency, and Gemini is an external challenge-evaluation integration. File upload handling is isolated at apps/api/src/middleware/upload.ts.
Main entry points: layout.tsx Next.js web app · src/index.ts API process · marketplaceService.ts Domain services · routes/index.ts Route composition
Components 21
Clients
- Next.js web app · Social, clubs, map, marketplace, messaging, profiles, and admin UI.
apps/web/app/layout.tsx - Home dashboard · Composes the campus activity feed.
apps/web/features/home/HomeDashboard.tsx - Web auth state
apps/web/features/auth/AuthProvider.tsx - Map discovery
apps/web/features/map/MapDiscoveryPage.tsx - Web socket client
apps/web/lib/socket.ts - Expo mobile app · Tab-oriented mobile experience.
apps/mobile/App.tsx - Mobile API client
apps/mobile/src/api/client.ts
Express API
- API process
apps/api/src/index.ts - Route composition · Composes domain endpoint modules.
apps/api/src/routes/index.ts - Controllers · Translate requests into domain operations.
apps/api/src/controllers/marketplaceController.ts - Domain services · Auth, social, clubs, events, chat, notifications, marketplace, and challenges.
apps/api/src/services/marketplaceService.ts - Authentication · Identity and session lifecycle.
apps/api/src/services/authService.ts - Socket integration · Supports chat, notifications, and conversations.
apps/api/src/services/socketService.ts - Upload handling · Isolated file upload boundary for marketplace images.
apps/api/src/middleware/upload.ts
Data & integrations
- PostgreSQL · User and domain records, including marketplace listings and conversations.
apps/api/src/db/index.ts - Redis
apps/api/src/db/redis.ts - Mapbox
apps/web/features/map/MapCanvas.tsx - Gemini judge · Evaluates challenge attempts.
apps/api/src/services/geminiJudgeService.ts
Deployment
- Vercel
- Railway
Other components
- Shared contracts · Shared types and API contracts for all runtimes.
packages/shared/src/index.ts
Connections 26
- Next.js web app → Home dashboard: renders
- Next.js web app → Web auth state: uses
- Next.js web app → Map discovery: renders
- Next.js web app → Web socket client: connects
- Expo mobile app → Mobile API client: uses
- Next.js web app → API process: HTTPS API
- Mobile API client → API process: HTTPS API
- Web socket client → Socket integration: real-time connection
- API process → Route composition: mounts
- Route composition → Controllers: dispatches
- Controllers → Domain services: invokes
- Controllers → Authentication: auth endpoints
- Domain services → PostgreSQL: persists domain data
- Authentication → PostgreSQL: user records
- Authentication → Redis: sessions
- Domain services → Socket integration: publishes events
- Route composition → Upload handling: upload routes
- Map discovery → Mapbox: renders maps
- Domain services → Gemini judge: judges challenges
- Next.js web app → Shared contracts: uses contracts
- Expo mobile app → Shared contracts: uses contracts
- API process → Shared contracts: uses contracts
- Vercel → Next.js web app: hosts
- Railway → API process: hosts
- Railway → PostgreSQL: hosts
- Railway → Redis: hosts