How haiderimam07/doc-campus works
DocCampus is a student-focused resource-sharing and social platform. Users register or sign in, publish document or link posts, browse a personalized feed and profiles, then save, discuss, like, share, and follow. The backend exposes these domain stages through Fastify routes and services backed by PostgreSQL; the Next.js frontend provides feed, post, profile, saved-resource, and login experiences. The route-to-service and app-to-route links are shown where excerpts establish them. Frontend-to-backend wiring and some integrations were not sampled, so those links are omitted.
Main entry points: app.ts Fastify app · schema.ts Domain schema · auth.routes.ts Auth routes · posts.routes.ts Post routes
Components 28
Student interface
- Next.js interface
frontend/app/layout.tsx - Feed and posts
frontend/app/feed/page.tsx - Profiles
frontend/app/profile/[username]/page.tsx - Saved resources
frontend/app/saved/page.tsx - Sign-in forms
frontend/app/(login)/login.tsx - API client
frontend/lib/doc-campus-api.ts
Backend runtime
- Fastify app
backend/src/app.ts - Database plugin
backend/src/plugins/db.ts - Auth plugin
backend/src/plugins/auth.ts - Domain schema
backend/src/db/schema.ts - Environment config
backend/src/config/env.ts
Identity and profiles
- Auth routes
backend/src/modules/auth/auth.routes.ts - Auth service
backend/src/modules/auth/auth.service.ts - User routes
backend/src/modules/users/users.routes.ts - User service
backend/src/modules/users/users.service.ts
Resources and feed
- Post routes
backend/src/modules/posts/posts.routes.ts - Post service
backend/src/modules/posts/posts.service.ts - Feed routes
backend/src/modules/feed/feed.routes.ts - Feed service
backend/src/modules/feed/feed.service.ts - File storage helper
backend/src/lib/upload.ts
Community engagement
- Comment routes
backend/src/modules/comments/comments.routes.ts - Comment service
backend/src/modules/comments/comments.service.ts - Like routes
backend/src/modules/likes/likes.routes.ts - Like service
backend/src/modules/likes/likes.service.ts - Share routes
backend/src/modules/shares/shares.routes.ts - Share service
backend/src/modules/shares/shares.service.ts - Social graph
backend/src/modules/social-graph/social-graph.service.ts
Other components
- Students
Connections 27
- Students → Next.js interface: use
- Fastify app → Auth routes: registers
backend/src/app.ts - Fastify app → User routes: registers
backend/src/app.ts - Fastify app → Post routes: registers
backend/src/app.ts - Fastify app → Feed routes: registers
backend/src/app.ts - Fastify app → Like routes: registers
backend/src/app.ts - Fastify app → Comment routes: registers
backend/src/app.ts - Fastify app → Share routes: registers
backend/src/app.ts - Fastify app → Database plugin: registers
backend/src/app.ts - Fastify app → Auth plugin: registers
backend/src/app.ts - Auth routes → Auth service: calls
backend/src/modules/auth/auth.routes.ts - Auth service → Domain schema: queries
backend/src/modules/auth/auth.service.ts - Auth routes → Environment config: reads config
backend/src/modules/auth/auth.routes.ts - User routes → User service: calls
backend/src/modules/users/users.routes.ts - User service → Domain schema: queries
backend/src/modules/users/users.service.ts - Post routes → Post service: calls
backend/src/modules/posts/posts.routes.ts - Post routes → File storage helper: uploads files
backend/src/modules/posts/posts.routes.ts - Post service → Domain schema: queries
backend/src/modules/posts/posts.service.ts - Feed routes → Feed service: calls
backend/src/modules/feed/feed.routes.ts - Feed service → Domain schema: queries
backend/src/modules/feed/feed.service.ts - Feed service → Social graph: uses graph
backend/src/modules/feed/feed.service.ts - Comment routes → Comment service: calls
backend/src/modules/comments/comments.routes.ts - Comment service → Domain schema: queries
backend/src/modules/comments/comments.service.ts - Like routes → Like service: calls
backend/src/modules/likes/likes.routes.ts - Like service → Domain schema: queries
backend/src/modules/likes/likes.service.ts - Share routes → Share service: calls
backend/src/modules/shares/shares.routes.ts - Share service → Domain schema: queries