How jvinix/comp229.f2026.004-codeexamples works
This repository is a COMP229 code-example application with a React frontend and Express/Mongoose backend. The main user workflow is signing up or signing in, then browsing projects and using authenticated routes to add, edit, or delete projects; public project listing is also available. The graph includes routing, authorization, API access, persistence, and the main page branches. Evidence is limited to the README and sampled/indexed files, so unsampled controller and view links are omitted where their wiring is not shown.
Main entry points: express.js Express application · mainRouter.jsx Page routes · auth.js Authentication · Signin.jsx Sign-in and signup
Components 23
Web interface
- React app
frontend/src/App.jsx - Page routes
frontend/src/mainRouter.jsx - Project pages
frontend/src/Pages/Projects.jsx - Sign-in and signup
frontend/src/components/auth/Signin.jsx - Auth state
frontend/src/components/auth/auth-helper.js - Private route
frontend/src/components/auth/PrivateRoute.jsx - Project management views
frontend/src/components/projects - Project form
frontend/src/components/projects/ProjectForm.jsx - Project API client
frontend/src/datasource/api-project.js - User API client
frontend/src/datasource/api-user.js
API and domain
- Express application
backend/config/express.js - Auth routes
backend/app/routers/auth.js - Project routes
backend/app/routers/projects.js - User routes
backend/app/routers/users.js - Authentication
backend/app/controllers/auth.js - Project operations
backend/app/controllers/projects.js - User operations
backend/app/controllers/users.js - HTTP server
backend/server.js
Persistence
- Project model
backend/app/models/projects.js - User model
backend/app/models/users.js - Database connection
backend/config/db.js
Other components
- Visitor
- MongoDB
Connections 30
- Visitor → React app: opens
- React app → Page routes: renders
frontend/src/App.jsx - Page routes → Project pages: routes to
frontend/src/mainRouter.jsx - Page routes → Sign-in and signup: routes to
frontend/src/mainRouter.jsx - Page routes → Private route: guards routes
frontend/src/mainRouter.jsx - Private route → Auth state: checks session
frontend/src/components/auth/PrivateRoute.jsx - Sign-in and signup → User API client: submits credentials
frontend/src/components/auth/Signin.jsx - Sign-in and signup → Auth state: stores token
frontend/src/components/auth/Signin.jsx - Page routes → Project management views: routes to
frontend/src/mainRouter.jsx - Project management views → Project form: renders
frontend/src/components/projects/AddProject.jsx - Project management views → Project API client: requests projects
frontend/src/components/projects/ListProjects.jsx - Project API client → Auth state: gets token
frontend/src/datasource/api-project.js - Project API client → Express application: calls REST API
frontend/src/datasource/api-project.js - User API client → Express application: calls REST API
- HTTP server → Database connection: connects
backend/server.js - HTTP server → Express application: serves
backend/server.js - Database connection → MongoDB: connects
backend/config/db.js - Express application → Auth routes: mounts
backend/config/express.js - Express application → Project routes: mounts
backend/config/express.js - Express application → User routes: mounts
backend/config/express.js - Auth routes → Authentication: dispatches
backend/app/routers/auth.js - Project routes → Project operations: dispatches
backend/app/routers/projects.js - Project routes → Authentication: validates token
backend/app/routers/projects.js - User routes → User operations: dispatches
backend/app/routers/users.js - User routes → Authentication: validates token
backend/app/routers/users.js - Authentication → User model: finds account
backend/app/controllers/auth.js - Project operations → Project model: reads and writes
backend/app/controllers/projects.js - Project operations → User model: checks admin
backend/app/controllers/projects.js - Project model → MongoDB: persists records
- User model → MongoDB: persists accounts