# mohammed-uwais/fullstackproject architecture

> Architecture diagram of the GitHub repository mohammed-uwais/fullstackproject, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mohammed-uwais/fullstackproject
- Repository: https://github.com/mohammed-uwais/fullstackproject

## Overview

This is a student/staff coding-practice portal: users authenticate, browse or receive scheduled problems, run code against test cases, submit solutions, and view leaderboard/solver results; staff can manage the problem bank and daily schedule. The Angular workspace calls an Express API backed by MongoDB, with server-side execution and submission tracking. Major UI branches are retained from the source index. Some frontend-to-backend links are inferred from matching HTTP endpoints, so those edges are dashed; unsampled implementation details are not asserted.

Main entry points: [`frontend/src/app/app.component.ts`](https://github.com/mohammed-uwais/fullstackproject/blob/main/frontend/src/app/app.component.ts) (Workspace shell), [`backend/src/server.js`](https://github.com/mohammed-uwais/fullstackproject/blob/main/backend/src/server.js) (API server), [`backend/src/routes/auth.routes.js`](https://github.com/mohammed-uwais/fullstackproject/blob/main/backend/src/routes/auth.routes.js) (Authentication routes), [`backend/src/routes/problem.routes.js`](https://github.com/mohammed-uwais/fullstackproject/blob/main/backend/src/routes/problem.routes.js) (Problem routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Angular workspace"]
  node_app["Workspace shell<br/>[app.component.ts]"]
  node_authui["Sign-in and registration"]
  node_editor["Daily challenge editor"]
  node_library["Problem library"]
  node_staffbank["Staff problem bank"]
  node_leaderboard["Leaderboard"]
end

subgraph group_services["Frontend services"]
  node_authsvc["Authentication service<br/>[auth.service.ts]"]
  node_problemsvc["Problem service<br/>[problem.service.ts]"]
  node_execsvc["Execution service"]
end

subgraph group_api["Backend API"]
  node_authapi["Authentication routes<br/>[auth.routes.js]"]
  node_authctrl["Authentication handlers<br/>[auth.controller.js]"]
  node_authmw["Token and role middleware<br/>[auth.middleware.js]"]
  node_problemroutes["Problem routes<br/>[problem.routes.js]"]
  node_problemctrl["Problem and daily schedule"]
  node_subroutes["Submission routes"]
  node_subctrl["Submission and leaderboard"]
  node_server["API server<br/>[server.js]"]
end

subgraph group_execution["Code evaluation"]
  node_runner["Code runner<br/>[runner.js]"]
end

subgraph group_data["Domain data"]
  node_dbconfig["Database connection<br/>[db.js]"]
  node_models[("User, profile, problem and submission models<br/>[index.js]")]
end

node_user(("Student or staff"))

node_user -->|"uses"| node_app
node_app -->|"renders"| node_authui
node_app -->|"renders"| node_editor
node_app -->|"renders"| node_leaderboard
node_app -->|"renders"| node_library
node_app -->|"renders"| node_staffbank
node_app -->|"reads session"| node_authsvc
node_authui -->|"authenticates"| node_authsvc
node_editor -->|"runs or submits"| node_execsvc
node_editor -->|"loads problems"| node_problemsvc
node_library -->|"loads problems"| node_problemsvc
node_staffbank -->|"manages problems"| node_problemsvc
node_staffbank -->|"checks solvers"| node_execsvc
node_leaderboard -->|"loads rankings"| node_execsvc
node_authsvc -.->|"HTTP auth"| node_authapi
node_problemsvc -.->|"HTTP problem requests"| node_problemroutes
node_execsvc -.->|"HTTP execution requests"| node_subroutes
node_server -->|"connects database"| node_dbconfig
node_server -->|"mounts routes"| node_authapi
node_server -->|"mounts routes"| node_problemroutes
node_server -->|"mounts routes"| node_subroutes
node_authapi -->|"dispatches"| node_authctrl
node_authapi -->|"applies auth"| node_authmw
node_problemroutes -->|"dispatches"| node_problemctrl
node_problemroutes -->|"applies optional auth"| node_authmw
node_subroutes -->|"dispatches"| node_subctrl
node_subroutes -->|"applies auth"| node_authmw
node_authctrl -->|"reads and writes"| node_models
node_authmw -->|"loads profiles"| node_models
node_problemctrl -->|"reads and writes"| node_models
node_subctrl -->|"executes code"| node_runner
node_subctrl -->|"reads and stores results"| node_models

click node_app "https://github.com/mohammed-uwais/fullstackproject/blob/main/frontend/src/app/app.component.ts"
click node_authui "https://github.com/mohammed-uwais/fullstackproject/blob/main/frontend/src/app/components/landing-auth/landing-auth.component.ts"
click node_editor "https://github.com/mohammed-uwais/fullstackproject/blob/main/frontend/src/app/components/code-editor/code-editor.component.ts"
click node_library "https://github.com/mohammed-uwais/fullstackproject/blob/main/frontend/src/app/components/solution-library/solution-library.component.ts"
click node_staffbank "https://github.com/mohammed-uwais/fullstackproject/blob/main/frontend/src/app/components/staff-bank/staff-bank.component.ts"
click node_leaderboard "https://github.com/mohammed-uwais/fullstackproject/blob/main/frontend/src/app/components/leaderboard/leaderboard.component.ts"
click node_authsvc "https://github.com/mohammed-uwais/fullstackproject/blob/main/frontend/src/app/core/services/auth.service.ts"
click node_problemsvc "https://github.com/mohammed-uwais/fullstackproject/blob/main/frontend/src/app/core/services/problem.service.ts"
click node_execsvc "https://github.com/mohammed-uwais/fullstackproject/blob/main/frontend/src/app/core/services/execution.service.ts"
click node_authapi "https://github.com/mohammed-uwais/fullstackproject/blob/main/backend/src/routes/auth.routes.js"
click node_authctrl "https://github.com/mohammed-uwais/fullstackproject/blob/main/backend/src/controllers/auth.controller.js"
click node_authmw "https://github.com/mohammed-uwais/fullstackproject/blob/main/backend/src/middleware/auth.middleware.js"
click node_problemroutes "https://github.com/mohammed-uwais/fullstackproject/blob/main/backend/src/routes/problem.routes.js"
click node_problemctrl "https://github.com/mohammed-uwais/fullstackproject/blob/main/backend/src/controllers/problem.controller.js"
click node_subroutes "https://github.com/mohammed-uwais/fullstackproject/blob/main/backend/src/routes/submission.routes.js"
click node_subctrl "https://github.com/mohammed-uwais/fullstackproject/blob/main/backend/src/controllers/submission.controller.js"
click node_runner "https://github.com/mohammed-uwais/fullstackproject/blob/main/backend/src/utils/runner.js"
click node_dbconfig "https://github.com/mohammed-uwais/fullstackproject/blob/main/backend/src/config/db.js"
click node_models "https://github.com/mohammed-uwais/fullstackproject/blob/main/backend/src/models/index.js"
click node_server "https://github.com/mohammed-uwais/fullstackproject/blob/main/backend/src/server.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_authui,node_editor,node_library,node_staffbank,node_leaderboard toneBlue
class node_authsvc,node_problemsvc,node_execsvc toneAmber
class node_authapi,node_authctrl,node_authmw,node_problemroutes,node_problemctrl,node_subroutes,node_subctrl,node_server toneMint
class node_runner toneRose
class node_dbconfig,node_models,node_user toneIndigo
```

## Components

### Angular workspace

- [Workspace shell](https://github.com/mohammed-uwais/fullstackproject/blob/main/frontend/src/app/app.component.ts): `frontend/src/app/app.component.ts`
- [Sign-in and registration](https://github.com/mohammed-uwais/fullstackproject/blob/main/frontend/src/app/components/landing-auth/landing-auth.component.ts): `frontend/src/app/components/landing-auth/landing-auth.component.ts`
- [Daily challenge editor](https://github.com/mohammed-uwais/fullstackproject/blob/main/frontend/src/app/components/code-editor/code-editor.component.ts): `frontend/src/app/components/code-editor/code-editor.component.ts`
- [Problem library](https://github.com/mohammed-uwais/fullstackproject/blob/main/frontend/src/app/components/solution-library/solution-library.component.ts): `frontend/src/app/components/solution-library/solution-library.component.ts`
- [Staff problem bank](https://github.com/mohammed-uwais/fullstackproject/blob/main/frontend/src/app/components/staff-bank/staff-bank.component.ts): `frontend/src/app/components/staff-bank/staff-bank.component.ts`
- [Leaderboard](https://github.com/mohammed-uwais/fullstackproject/blob/main/frontend/src/app/components/leaderboard/leaderboard.component.ts): `frontend/src/app/components/leaderboard/leaderboard.component.ts`

### Frontend services

- [Authentication service](https://github.com/mohammed-uwais/fullstackproject/blob/main/frontend/src/app/core/services/auth.service.ts): `frontend/src/app/core/services/auth.service.ts`
- [Problem service](https://github.com/mohammed-uwais/fullstackproject/blob/main/frontend/src/app/core/services/problem.service.ts): `frontend/src/app/core/services/problem.service.ts`
- [Execution service](https://github.com/mohammed-uwais/fullstackproject/blob/main/frontend/src/app/core/services/execution.service.ts): `frontend/src/app/core/services/execution.service.ts`

### Backend API

- [Authentication routes](https://github.com/mohammed-uwais/fullstackproject/blob/main/backend/src/routes/auth.routes.js): `backend/src/routes/auth.routes.js`
- [Authentication handlers](https://github.com/mohammed-uwais/fullstackproject/blob/main/backend/src/controllers/auth.controller.js): `backend/src/controllers/auth.controller.js`
- [Token and role middleware](https://github.com/mohammed-uwais/fullstackproject/blob/main/backend/src/middleware/auth.middleware.js): `backend/src/middleware/auth.middleware.js`
- [Problem routes](https://github.com/mohammed-uwais/fullstackproject/blob/main/backend/src/routes/problem.routes.js): `backend/src/routes/problem.routes.js`
- [Problem and daily schedule](https://github.com/mohammed-uwais/fullstackproject/blob/main/backend/src/controllers/problem.controller.js): `backend/src/controllers/problem.controller.js`
- [Submission routes](https://github.com/mohammed-uwais/fullstackproject/blob/main/backend/src/routes/submission.routes.js): `backend/src/routes/submission.routes.js`
- [Submission and leaderboard](https://github.com/mohammed-uwais/fullstackproject/blob/main/backend/src/controllers/submission.controller.js): `backend/src/controllers/submission.controller.js`
- [API server](https://github.com/mohammed-uwais/fullstackproject/blob/main/backend/src/server.js): `backend/src/server.js`

### Code evaluation

- [Code runner](https://github.com/mohammed-uwais/fullstackproject/blob/main/backend/src/utils/runner.js): `backend/src/utils/runner.js`

### Domain data

- [Database connection](https://github.com/mohammed-uwais/fullstackproject/blob/main/backend/src/config/db.js): `backend/src/config/db.js`
- [User, profile, problem and submission models](https://github.com/mohammed-uwais/fullstackproject/blob/main/backend/src/models/index.js): `backend/src/models/index.js`

### Other components

- **Student or staff**

## Connections

- Student or staff → Workspace shell: uses (evidence: `frontend/src/app/app.component.ts`)
- Workspace shell → Sign-in and registration: renders (evidence: `frontend/src/app/app.component.ts`)
- Workspace shell → Daily challenge editor: renders (evidence: `frontend/src/app/app.component.ts`)
- Workspace shell → Leaderboard: renders (evidence: `frontend/src/app/app.component.ts`)
- Workspace shell → Problem library: renders (evidence: `frontend/src/app/app.component.ts`)
- Workspace shell → Staff problem bank: renders (evidence: `frontend/src/app/app.component.ts`)
- Workspace shell → Authentication service: reads session (evidence: `frontend/src/app/app.component.ts`)
- Sign-in and registration → Authentication service: authenticates (evidence: `frontend/src/app/components/landing-auth/landing-auth.component.ts`)
- Daily challenge editor → Execution service: runs or submits (evidence: `frontend/src/app/components/code-editor/code-editor.component.ts`)
- Daily challenge editor → Problem service: loads problems (evidence: `frontend/src/app/components/code-editor/code-editor.component.ts`)
- Problem library → Problem service: loads problems (evidence: `frontend/src/app/components/solution-library/solution-library.component.ts`)
- Staff problem bank → Problem service: manages problems (evidence: `frontend/src/app/components/staff-bank/staff-bank.component.ts`)
- Staff problem bank → Execution service: checks solvers (evidence: `frontend/src/app/components/staff-bank/staff-bank.component.ts`)
- Leaderboard → Execution service: loads rankings (evidence: `frontend/src/app/components/leaderboard/leaderboard.component.ts`)
- Authentication service → Authentication routes: HTTP auth
- Problem service → Problem routes: HTTP problem requests
- Execution service → Submission routes: HTTP execution requests
- API server → Database connection: connects database (evidence: `backend/src/server.js`)
- API server → Authentication routes: mounts routes (evidence: `backend/src/server.js`)
- API server → Problem routes: mounts routes (evidence: `backend/src/server.js`)
- API server → Submission routes: mounts routes (evidence: `backend/src/server.js`)
- Authentication routes → Authentication handlers: dispatches (evidence: `backend/src/routes/auth.routes.js`)
- Authentication routes → Token and role middleware: applies auth (evidence: `backend/src/routes/auth.routes.js`)
- Problem routes → Problem and daily schedule: dispatches (evidence: `backend/src/routes/problem.routes.js`)
- Problem routes → Token and role middleware: applies optional auth (evidence: `backend/src/routes/problem.routes.js`)
- Submission routes → Submission and leaderboard: dispatches (evidence: `backend/src/routes/submission.routes.js`)
- Submission routes → Token and role middleware: applies auth (evidence: `backend/src/routes/submission.routes.js`)
- Authentication handlers → User, profile, problem and submission models: reads and writes (evidence: `backend/src/controllers/auth.controller.js`)
- Token and role middleware → User, profile, problem and submission models: loads profiles (evidence: `backend/src/middleware/auth.middleware.js`)
- Problem and daily schedule → User, profile, problem and submission models: reads and writes (evidence: `backend/src/controllers/problem.controller.js`)
- Submission and leaderboard → Code runner: executes code (evidence: `backend/src/controllers/submission.controller.js`)
- Submission and leaderboard → User, profile, problem and submission models: reads and stores results (evidence: `backend/src/controllers/submission.controller.js`)
