How amirun-nahin/stackunderflow-cse470-project works
Purpose and Entry Points
A full-stack developer community platform combining social posts, groups/chat, coding challenges, competitions, bounties, quizzes, jobs, news, and GitHub integration. The API starts at backend/index.js; database setup is centralized in backend/config/db.js. The Vite/React client mounts from frontend/src/main.jsx and composes the application in frontend/src/App.jsx.
Backend HTTP and Authentication Boundary
Express route modules expose domain APIs, with authentication enforced through backend/middlewares/AuthMiddleware.js. User identity and account operations are handled through backend/routes/auth.js and backend/routes/users.js. Protected route handlers are the main boundary between browser-driven actions and persistent platform state.
Persistence Model
The backend uses a model-centric data layer. backend/models/User.js anchors identities; community content is represented by backend/models/Post.js, backend/models/Comment.js, and backend/models/Vote.js. Relationship and collaboration state is persisted in backend/models/Group.js, backend/models/GroupMember.js, and backend/models/Message.js. Database connection details are isolated at backend/config/db.js.
Community, Discovery, and Notifications
Social feed and discussion workflows flow through backend/routes/posts.js, then into post/comment/vote models. Group creation, membership, and group interaction are served by backend/routes/groups.js and backend/routes/chat.js. Cross-feature user alerts are stored in backend/models/Notification.js and exposed through backend/routes/notifications.js; the client surfaces them via frontend/src/components/NotificationBell.jsx.
Challenge and Competition Domains
Three structured challenge modes have separate APIs and persistence boundaries:
• Bounties: backend/routes/bounty.js, backend/models/BountyEnrollment.js, backend/models/BountySubmission.js.
• Competitions: backend/routes/competition.js, backend/models/Competition.js, backend/models/CompetitionSubmission.js.
• Duels and quiz: backend/routes/duel.js, backend/models/Duel.js, backend/models/QuizAttempt.js.
The client presents these as discoverable boards and detail workflows in frontend/src/components/BountyBoard.jsx, frontend/src/components/CompetitionBoard.jsx, and frontend/src/pages/DuelDetail.jsx.
External Content and Developer Integrations
GitHub connection/request functionality is isolated behind backend/routes/github.js and backend/routes/repoRequest.js, with request state in backend/models/RepoRequestJoin.js. Jobs and technology news are distinct external-content-facing domains at backend/routes/jobs.js and backend/routes/news.js; saved news state uses backend/models/SavedNews.js. Search is provided separately at backend/routes/search.js.
Frontend Navigation and Feature Composition
The React SPA uses page-level route targets for major workflows, including frontend/src/pages/Home.jsx, frontend/src/pages/Discover.jsx, and frontend/src/pages/Profile.jsx. Reusable feature widgets compose dashboards and feeds, notably frontend/src/components/PostCard.jsx, frontend/src/components/DailyQuizCard.jsx, and frontend/src/components/GitHubConnect.jsx. Client-to-server integration is mediated by the route-oriented backend API rather than a separate backend-for-frontend layer.
Main entry points: index.js API server · App.jsx Application shell · db.js Database connection · posts.js Community APIs
Components 22
React SPA
- Client entry
frontend/src/main.jsx - Application shell
frontend/src/App.jsx - Main pages · Home, discovery, and profile workflows.
frontend/src/pages/Home.jsx - Community UI · Posts and notification surfaces.
frontend/src/components/PostCard.jsx - Challenge boards · Bounty, competition, and duel workflows.
frontend/src/components/BountyBoard.jsx - GitHub connect
frontend/src/components/GitHubConnect.jsx
Express API
- API server
backend/index.js - Auth boundary · Authenticates browser actions and manages accounts.
backend/middlewares/AuthMiddleware.js - Community APIs
backend/routes/posts.js - Notification API
backend/routes/notifications.js - Challenge APIs
backend/routes/bounty.js - GitHub and repo APIs
backend/routes/github.js - Jobs, news, search APIs
backend/routes/jobs.js
Persistence
- Database connection
backend/config/db.js - Identity data
backend/models/User.js - Community data
backend/models/Post.js - Group and chat data
backend/models/Group.js - Notification data
backend/models/Notification.js - Challenge data · Stores bounty, competition, duel, and quiz state.
backend/models/BountyEnrollment.js - Saved integration state
backend/models/RepoRequestJoin.js
External Content
- GitHub
- Jobs and news sources
Connections 27
- Client entry → Application shell: mounts
- Application shell → Main pages: routes to
- Application shell → Community UI: composes
- Application shell → Challenge boards: composes
- Application shell → GitHub connect: composes
- Main pages → API server: API requests
- Community UI → API server: API requests
- Challenge boards → API server: API requests
- GitHub connect → API server: API requests
- API server → Auth boundary: protects routes
- Auth boundary → Identity data: resolves user
- API server → Community APIs: serves
- API server → Notification API: serves
- API server → Challenge APIs: serves
- API server → GitHub and repo APIs: serves
- API server → Jobs, news, search APIs: serves
- Community APIs → Community data: persists
- Community APIs → Group and chat data: persists
- Notification API → Notification data: persists
- Challenge APIs → Challenge data: persists
- GitHub and repo APIs → Saved integration state: persists
- GitHub and repo APIs → GitHub: connects to
- Jobs, news, search APIs → Saved integration state: saves news
- Jobs, news, search APIs → Jobs and news sources: retrieves
- Database connection → Identity data: connects
- Database connection → Community data: connects
- Database connection → Challenge data: connects