# harimuthuganesh/nec_sports_management architecture

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

- Interactive diagram: https://gitdiagram.com/harimuthuganesh/nec_sports_management
- Repository: https://github.com/harimuthuganesh/nec_sports_management

## Overview

This is a college sports-management portal: staff and athletes manage sports, events, tournaments, teams and rosters, record match activity, handle attendance and official-duty requests, and view reports and public updates. The frontend serves role-specific and public pages through a shared API layer to an Express backend, which routes requests to controllers and persists application data in MySQL. The graph preserves documented feature areas, but unsampled modules are represented at their enclosing source directories; cross-frontend/backend links are shown as unverified HTTP interactions.

Main entry points: [`backend/src/routes/apiRoutes.js`](https://github.com/harimuthuganesh/nec_sports_management/blob/master/backend/src/routes/apiRoutes.js) (Sports API routes), [`frontend/src/App.jsx`](https://github.com/harimuthuganesh/nec_sports_management/blob/master/frontend/src/App.jsx) (Role-based portal), [`frontend/src/services/api/apiServices.js`](https://github.com/harimuthuganesh/nec_sports_management/blob/master/frontend/src/services/api/apiServices.js) (API client), [`backend/src/models/sql`](https://github.com/harimuthuganesh/nec_sports_management/tree/master/backend/src/models/sql) (SQL domain models)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web portal"]
  node_frontend["Role-based portal<br/>[App.jsx]"]
  node_common["Shared UI"]
  node_authui["Sign-in and session<br/>[AuthContext.jsx]"]
  node_api["API client<br/>[apiServices.js]"]
  node_admin["Administration"]
  node_coord["Coordinator tools"]
  node_player["Player and captain"]
  node_public["Public sports views"]
  node_odui["Official OD manager"]
end

subgraph group_server["API backend"]
  node_app["Express application<br/>[app.js]"]
  node_authroutes["Authentication routes<br/>[authRoutes.js]"]
  node_routes["Sports API routes<br/>[apiRoutes.js]"]
  node_galleryroutes["Gallery routes<br/>[galleryRoutes.js]"]
end

subgraph group_domain["Sports operations"]
  node_sports["Sports and events"]
  node_teams["Teams and rosters<br/>[teamController.js]"]
  node_operations["Match and attendance"]
  node_od["OD and documents"]
  node_reports["Reports and audit"]
end

subgraph group_identity["Identity and messaging"]
  node_auth["Authentication<br/>[authController.js]"]
  node_security["Request security<br/>[authMiddleware.js]"]
  node_email["Email and notices<br/>[emailService.js]"]
end

subgraph group_persistence["Persistence"]
  node_models["SQL domain models"]
  node_db[("MySQL database<br/>[db.js]")]
end

node_visitor(("Portal users"))

node_visitor -->|"uses"| node_frontend
node_frontend -->|"uses"| node_authui
node_frontend -->|"renders"| node_common
node_frontend -->|"routes to"| node_admin
node_frontend -->|"routes to"| node_coord
node_frontend -->|"routes to"| node_player
node_frontend -->|"routes to"| node_public
node_admin -->|"calls"| node_api
node_coord -->|"calls"| node_api
node_odui -->|"calls"| node_api
node_api -.->|"HTTP requests"| node_routes
node_app -->|"mounts"| node_authroutes
node_app -->|"mounts"| node_routes
node_app -->|"mounts"| node_galleryroutes
node_authroutes -->|"dispatches"| node_auth
node_authroutes -->|"protects"| node_security
node_routes -->|"dispatches"| node_sports
node_routes -->|"dispatches"| node_teams
node_routes -->|"dispatches"| node_operations
node_routes -->|"dispatches"| node_od
node_routes -->|"dispatches"| node_reports
node_routes -->|"protects"| node_security
node_sports -->|"queries"| node_models
node_teams -->|"queries"| node_models
node_auth -->|"queries"| node_models
node_auth -.->|"sends notices"| node_email
node_models -.->|"uses pool"| node_db
node_reports -->|"queries"| node_db
node_email -->|"stores notifications"| node_db

click node_frontend "https://github.com/harimuthuganesh/nec_sports_management/blob/master/frontend/src/App.jsx"
click node_common "https://github.com/harimuthuganesh/nec_sports_management/tree/master/frontend/src/components/common"
click node_authui "https://github.com/harimuthuganesh/nec_sports_management/blob/master/frontend/src/context/AuthContext.jsx"
click node_api "https://github.com/harimuthuganesh/nec_sports_management/blob/master/frontend/src/services/api/apiServices.js"
click node_admin "https://github.com/harimuthuganesh/nec_sports_management/tree/master/frontend/src/pages/admin"
click node_coord "https://github.com/harimuthuganesh/nec_sports_management/tree/master/frontend/src/pages/coordinator"
click node_player "https://github.com/harimuthuganesh/nec_sports_management/tree/master/frontend/src/pages/player"
click node_public "https://github.com/harimuthuganesh/nec_sports_management/tree/master/frontend/src/pages/public"
click node_odui "https://github.com/harimuthuganesh/nec_sports_management/blob/master/frontend/src/components/od/OfficialOdManager.jsx"
click node_app "https://github.com/harimuthuganesh/nec_sports_management/blob/master/backend/src/app.js"
click node_authroutes "https://github.com/harimuthuganesh/nec_sports_management/blob/master/backend/src/routes/authRoutes.js"
click node_routes "https://github.com/harimuthuganesh/nec_sports_management/blob/master/backend/src/routes/apiRoutes.js"
click node_galleryroutes "https://github.com/harimuthuganesh/nec_sports_management/blob/master/backend/src/routes/galleryRoutes.js"
click node_sports "https://github.com/harimuthuganesh/nec_sports_management/blob/master/backend/src/controllers/sportsController.js"
click node_teams "https://github.com/harimuthuganesh/nec_sports_management/blob/master/backend/src/controllers/teamController.js"
click node_operations "https://github.com/harimuthuganesh/nec_sports_management/tree/master/backend/src/controllers"
click node_od "https://github.com/harimuthuganesh/nec_sports_management/blob/master/backend/src/controllers/officialOdDocController.js"
click node_reports "https://github.com/harimuthuganesh/nec_sports_management/blob/master/backend/src/controllers/reportsController.js"
click node_auth "https://github.com/harimuthuganesh/nec_sports_management/blob/master/backend/src/controllers/authController.js"
click node_security "https://github.com/harimuthuganesh/nec_sports_management/blob/master/backend/src/middleware/authMiddleware.js"
click node_email "https://github.com/harimuthuganesh/nec_sports_management/blob/master/backend/src/services/emailService.js"
click node_models "https://github.com/harimuthuganesh/nec_sports_management/tree/master/backend/src/models/sql"
click node_db "https://github.com/harimuthuganesh/nec_sports_management/blob/master/backend/src/config/db.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_frontend,node_common,node_authui,node_api,node_admin,node_coord,node_player,node_public,node_odui,node_visitor toneBlue
class node_app,node_authroutes,node_routes,node_galleryroutes toneAmber
class node_sports,node_teams,node_operations,node_od,node_reports toneMint
class node_auth,node_security,node_email toneRose
class node_models,node_db toneIndigo
```

## Components

### Web portal

- [Role-based portal](https://github.com/harimuthuganesh/nec_sports_management/blob/master/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Shared UI](https://github.com/harimuthuganesh/nec_sports_management/tree/master/frontend/src/components/common): `frontend/src/components/common`
- [Sign-in and session](https://github.com/harimuthuganesh/nec_sports_management/blob/master/frontend/src/context/AuthContext.jsx): `frontend/src/context/AuthContext.jsx`
- [API client](https://github.com/harimuthuganesh/nec_sports_management/blob/master/frontend/src/services/api/apiServices.js): `frontend/src/services/api/apiServices.js`
- [Administration](https://github.com/harimuthuganesh/nec_sports_management/tree/master/frontend/src/pages/admin): `frontend/src/pages/admin`
- [Coordinator tools](https://github.com/harimuthuganesh/nec_sports_management/tree/master/frontend/src/pages/coordinator): `frontend/src/pages/coordinator`
- [Player and captain](https://github.com/harimuthuganesh/nec_sports_management/tree/master/frontend/src/pages/player): `frontend/src/pages/player`
- [Public sports views](https://github.com/harimuthuganesh/nec_sports_management/tree/master/frontend/src/pages/public): `frontend/src/pages/public`
- [Official OD manager](https://github.com/harimuthuganesh/nec_sports_management/blob/master/frontend/src/components/od/OfficialOdManager.jsx): `frontend/src/components/od/OfficialOdManager.jsx`

### API backend

- [Express application](https://github.com/harimuthuganesh/nec_sports_management/blob/master/backend/src/app.js): `backend/src/app.js`
- [Authentication routes](https://github.com/harimuthuganesh/nec_sports_management/blob/master/backend/src/routes/authRoutes.js): `backend/src/routes/authRoutes.js`
- [Sports API routes](https://github.com/harimuthuganesh/nec_sports_management/blob/master/backend/src/routes/apiRoutes.js): `backend/src/routes/apiRoutes.js`
- [Gallery routes](https://github.com/harimuthuganesh/nec_sports_management/blob/master/backend/src/routes/galleryRoutes.js): `backend/src/routes/galleryRoutes.js`

### Sports operations

- [Sports and events](https://github.com/harimuthuganesh/nec_sports_management/blob/master/backend/src/controllers/sportsController.js): `backend/src/controllers/sportsController.js`
- [Teams and rosters](https://github.com/harimuthuganesh/nec_sports_management/blob/master/backend/src/controllers/teamController.js): `backend/src/controllers/teamController.js`
- [Match and attendance](https://github.com/harimuthuganesh/nec_sports_management/tree/master/backend/src/controllers): `backend/src/controllers`
- [OD and documents](https://github.com/harimuthuganesh/nec_sports_management/blob/master/backend/src/controllers/officialOdDocController.js): `backend/src/controllers/officialOdDocController.js`
- [Reports and audit](https://github.com/harimuthuganesh/nec_sports_management/blob/master/backend/src/controllers/reportsController.js): `backend/src/controllers/reportsController.js`

### Identity and messaging

- [Authentication](https://github.com/harimuthuganesh/nec_sports_management/blob/master/backend/src/controllers/authController.js): `backend/src/controllers/authController.js`
- [Request security](https://github.com/harimuthuganesh/nec_sports_management/blob/master/backend/src/middleware/authMiddleware.js): `backend/src/middleware/authMiddleware.js`
- [Email and notices](https://github.com/harimuthuganesh/nec_sports_management/blob/master/backend/src/services/emailService.js): `backend/src/services/emailService.js`

### Persistence

- [SQL domain models](https://github.com/harimuthuganesh/nec_sports_management/tree/master/backend/src/models/sql): `backend/src/models/sql`
- [MySQL database](https://github.com/harimuthuganesh/nec_sports_management/blob/master/backend/src/config/db.js): `backend/src/config/db.js`

### Other components

- **Portal users**

## Connections

- Portal users → Role-based portal: uses
- Role-based portal → Sign-in and session: uses (evidence: `frontend/src/App.jsx`)
- Role-based portal → Shared UI: renders (evidence: `frontend/src/App.jsx`)
- Role-based portal → Administration: routes to (evidence: `frontend/src/App.jsx`)
- Role-based portal → Coordinator tools: routes to (evidence: `frontend/src/App.jsx`)
- Role-based portal → Player and captain: routes to (evidence: `frontend/src/App.jsx`)
- Role-based portal → Public sports views: routes to (evidence: `frontend/src/App.jsx`)
- Administration → API client: calls (evidence: `frontend/src/pages/admin/TournamentsManager.jsx`)
- Coordinator tools → API client: calls (evidence: `frontend/src/pages/coordinator/RosterManager.jsx`)
- Official OD manager → API client: calls (evidence: `frontend/src/components/od/OfficialOdManager.jsx`)
- API client → Sports API routes: HTTP requests
- Express application → Authentication routes: mounts (evidence: `backend/src/app.js`)
- Express application → Sports API routes: mounts (evidence: `backend/src/app.js`)
- Express application → Gallery routes: mounts (evidence: `backend/src/app.js`)
- Authentication routes → Authentication: dispatches (evidence: `backend/src/routes/authRoutes.js`)
- Authentication routes → Request security: protects (evidence: `backend/src/routes/authRoutes.js`)
- Sports API routes → Sports and events: dispatches (evidence: `backend/src/routes/apiRoutes.js`)
- Sports API routes → Teams and rosters: dispatches (evidence: `backend/src/routes/apiRoutes.js`)
- Sports API routes → Match and attendance: dispatches (evidence: `backend/src/routes/apiRoutes.js`)
- Sports API routes → OD and documents: dispatches (evidence: `backend/src/routes/apiRoutes.js`)
- Sports API routes → Reports and audit: dispatches (evidence: `backend/src/routes/apiRoutes.js`)
- Sports API routes → Request security: protects (evidence: `backend/src/routes/apiRoutes.js`)
- Sports and events → SQL domain models: queries (evidence: `backend/src/controllers/sportsController.js`)
- Teams and rosters → SQL domain models: queries (evidence: `backend/src/controllers/teamController.js`)
- Authentication → SQL domain models: queries (evidence: `backend/src/controllers/authController.js`)
- Authentication → Email and notices: sends notices (evidence: `backend/src/controllers/authController.js`)
- SQL domain models → MySQL database: uses pool (evidence: `backend/src/models/sql/imsStudentModel.js`)
- Reports and audit → MySQL database: queries (evidence: `backend/src/controllers/reportsController.js`)
- Email and notices → MySQL database: stores notifications (evidence: `backend/src/services/emailService.js`)
