# avinashrai20/dev-nexus26 architecture

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

- Interactive diagram: https://gitdiagram.com/avinashrai20/dev-nexus26
- Repository: https://github.com/avinashrai20/dev-nexus26

## Overview

DEV.NEXUS26 is a developer learning and technology-discovery platform. Visitors browse and search AI tools and learning content; registered users authenticate, manage profiles, and save content; administrators manage the library, users, and uploaded files. The client routes screens and sends credentialed API requests to an Express service, whose routes dispatch to controllers and MongoDB-backed models. The README documents the broader feature set; some unsampled screens and route relationships are represented at subsystem level rather than inferred in detail.

Main entry points: [`client/src/App.tsx`](https://github.com/avinashrai20/dev-nexus26/blob/main/client/src/App.tsx) (Application routes), [`server/src/routes/contentRoutes.ts`](https://github.com/avinashrai20/dev-nexus26/blob/main/server/src/routes/contentRoutes.ts) (Content routes), [`client/src/services/api.ts`](https://github.com/avinashrai20/dev-nexus26/blob/main/client/src/services/api.ts) (API client), [`server/src/models`](https://github.com/avinashrai20/dev-nexus26/tree/main/server/src/models) (Content collections)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client experience"]
  node_client_routes["Application routes<br/>[App.tsx]"]
  node_public_screens["Discovery screens"]
  node_dashboard["User dashboard<br/>[Dashboard.tsx]"]
  node_search_screen["Search screen<br/>[Search.tsx]"]
  node_api_client["API client<br/>[api.ts]"]
end

subgraph group_identity["Identity and access"]
  node_auth_ui["Session state<br/>[useAuthStore.ts]"]
  node_auth_routes["Authentication routes<br/>[authRoutes.ts]"]
  node_auth_logic["Account operations<br/>[authController.ts]"]
  node_access_control["Access checks<br/>[authMiddleware.ts]"]
  node_user_model["User collection<br/>[User.ts]"]
end

subgraph group_content["Content platform"]
  node_api_server["REST API server<br/>[server.ts]"]
  node_content_routes["Content routes<br/>[contentRoutes.ts]"]
  node_content_logic["Search and saved content"]
  node_ai_logic["AI tool operations"]
  node_post_logic["Post operations<br/>[postController.ts]"]
  node_content_models["Content collections"]
end

subgraph group_admin["Admin workspace"]
  node_admin_screens["Admin screens"]
end

subgraph group_files["File management"]
  node_file_routes["File routes<br/>[fileRoutes.ts]"]
  node_upload_middleware["Upload handling<br/>[upload.ts]"]
  node_file_logic["File operations<br/>[fileController.ts]"]
  node_gridfs["GridFS service<br/>[gridfs.service.ts]"]
end

node_visitor(("Visitor or user"))
node_mongo[("MongoDB")]

node_visitor -->|"opens screens"| node_client_routes
node_client_routes -->|"routes to"| node_public_screens
node_client_routes -->|"protects routes"| node_dashboard
node_client_routes -->|"routes to"| node_admin_screens
node_client_routes -->|"checks session"| node_auth_ui
node_dashboard -->|"requests data"| node_api_client
node_search_screen -->|"searches"| node_api_client
node_admin_screens -->|"manages content"| node_api_client
node_auth_ui -->|"calls auth API"| node_api_client
node_api_client -->|"sends API requests"| node_api_server
node_api_server -->|"mounts routes"| node_auth_routes
node_api_server -->|"mounts routes"| node_content_routes
node_api_server -->|"mounts routes"| node_file_routes
node_auth_routes -->|"dispatches to"| node_auth_logic
node_auth_routes -->|"protects endpoints"| node_access_control
node_auth_logic -->|"reads and updates"| node_user_model
node_access_control -->|"loads account"| node_user_model
node_content_routes -->|"dispatches to"| node_content_logic
node_content_routes -->|"protects writes"| node_access_control
node_content_logic -->|"queries and updates"| node_content_models
node_content_routes -->|"routes tool requests"| node_ai_logic
node_content_routes -->|"routes post requests"| node_post_logic
node_ai_logic -->|"uses tool model"| node_content_models
node_post_logic -->|"uses post model"| node_content_models
node_content_models -->|"persists content"| node_mongo
node_user_model -->|"persists accounts"| node_mongo
node_file_routes -->|"protects uploads"| node_access_control
node_file_routes -->|"parses uploads"| node_upload_middleware
node_file_routes -->|"dispatches to"| node_file_logic
node_file_logic -->|"records resources"| node_content_models
node_file_logic -->|"uploads and streams"| node_gridfs
node_gridfs -->|"stores file binaries"| node_mongo

click node_client_routes "https://github.com/avinashrai20/dev-nexus26/blob/main/client/src/App.tsx"
click node_public_screens "https://github.com/avinashrai20/dev-nexus26/tree/main/client/src/pages"
click node_dashboard "https://github.com/avinashrai20/dev-nexus26/blob/main/client/src/pages/Dashboard.tsx"
click node_search_screen "https://github.com/avinashrai20/dev-nexus26/blob/main/client/src/pages/Search.tsx"
click node_admin_screens "https://github.com/avinashrai20/dev-nexus26/tree/main/client/src/pages/admin"
click node_auth_ui "https://github.com/avinashrai20/dev-nexus26/blob/main/client/src/store/useAuthStore.ts"
click node_api_client "https://github.com/avinashrai20/dev-nexus26/blob/main/client/src/services/api.ts"
click node_api_server "https://github.com/avinashrai20/dev-nexus26/blob/main/server/src/server.ts"
click node_auth_routes "https://github.com/avinashrai20/dev-nexus26/blob/main/server/src/routes/authRoutes.ts"
click node_auth_logic "https://github.com/avinashrai20/dev-nexus26/blob/main/server/src/controllers/authController.ts"
click node_access_control "https://github.com/avinashrai20/dev-nexus26/blob/main/server/src/middleware/authMiddleware.ts"
click node_content_routes "https://github.com/avinashrai20/dev-nexus26/blob/main/server/src/routes/contentRoutes.ts"
click node_content_logic "https://github.com/avinashrai20/dev-nexus26/blob/main/server/src/controllers/contentController.ts"
click node_ai_logic "https://github.com/avinashrai20/dev-nexus26/blob/main/server/src/controllers/aiToolController.ts"
click node_post_logic "https://github.com/avinashrai20/dev-nexus26/blob/main/server/src/controllers/postController.ts"
click node_content_models "https://github.com/avinashrai20/dev-nexus26/tree/main/server/src/models"
click node_user_model "https://github.com/avinashrai20/dev-nexus26/blob/main/server/src/models/User.ts"
click node_file_routes "https://github.com/avinashrai20/dev-nexus26/blob/main/server/src/routes/fileRoutes.ts"
click node_upload_middleware "https://github.com/avinashrai20/dev-nexus26/blob/main/server/src/middleware/upload.ts"
click node_file_logic "https://github.com/avinashrai20/dev-nexus26/blob/main/server/src/controllers/fileController.ts"
click node_gridfs "https://github.com/avinashrai20/dev-nexus26/blob/main/server/src/services/gridfs.service.ts"

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_client_routes,node_public_screens,node_dashboard,node_search_screen,node_api_client,node_visitor toneBlue
class node_auth_ui,node_auth_routes,node_auth_logic,node_access_control,node_user_model,node_mongo toneAmber
class node_api_server,node_content_routes,node_content_logic,node_ai_logic,node_post_logic,node_content_models toneMint
class node_admin_screens toneRose
class node_file_routes,node_upload_middleware,node_file_logic,node_gridfs toneIndigo
```

## Components

### Client experience

- [Application routes](https://github.com/avinashrai20/dev-nexus26/blob/main/client/src/App.tsx): `client/src/App.tsx`
- [Discovery screens](https://github.com/avinashrai20/dev-nexus26/tree/main/client/src/pages): `client/src/pages`
- [User dashboard](https://github.com/avinashrai20/dev-nexus26/blob/main/client/src/pages/Dashboard.tsx): `client/src/pages/Dashboard.tsx`
- [Search screen](https://github.com/avinashrai20/dev-nexus26/blob/main/client/src/pages/Search.tsx): `client/src/pages/Search.tsx`
- [API client](https://github.com/avinashrai20/dev-nexus26/blob/main/client/src/services/api.ts): `client/src/services/api.ts`

### Identity and access

- [Session state](https://github.com/avinashrai20/dev-nexus26/blob/main/client/src/store/useAuthStore.ts): `client/src/store/useAuthStore.ts`
- [Authentication routes](https://github.com/avinashrai20/dev-nexus26/blob/main/server/src/routes/authRoutes.ts): `server/src/routes/authRoutes.ts`
- [Account operations](https://github.com/avinashrai20/dev-nexus26/blob/main/server/src/controllers/authController.ts): `server/src/controllers/authController.ts`
- [Access checks](https://github.com/avinashrai20/dev-nexus26/blob/main/server/src/middleware/authMiddleware.ts): `server/src/middleware/authMiddleware.ts`
- [User collection](https://github.com/avinashrai20/dev-nexus26/blob/main/server/src/models/User.ts): `server/src/models/User.ts`

### Content platform

- [REST API server](https://github.com/avinashrai20/dev-nexus26/blob/main/server/src/server.ts): `server/src/server.ts`
- [Content routes](https://github.com/avinashrai20/dev-nexus26/blob/main/server/src/routes/contentRoutes.ts): `server/src/routes/contentRoutes.ts`
- [Search and saved content](https://github.com/avinashrai20/dev-nexus26/blob/main/server/src/controllers/contentController.ts): `server/src/controllers/contentController.ts`
- [AI tool operations](https://github.com/avinashrai20/dev-nexus26/blob/main/server/src/controllers/aiToolController.ts): `server/src/controllers/aiToolController.ts`
- [Post operations](https://github.com/avinashrai20/dev-nexus26/blob/main/server/src/controllers/postController.ts): `server/src/controllers/postController.ts`
- [Content collections](https://github.com/avinashrai20/dev-nexus26/tree/main/server/src/models): `server/src/models`

### Admin workspace

- [Admin screens](https://github.com/avinashrai20/dev-nexus26/tree/main/client/src/pages/admin): `client/src/pages/admin`

### File management

- [File routes](https://github.com/avinashrai20/dev-nexus26/blob/main/server/src/routes/fileRoutes.ts): `server/src/routes/fileRoutes.ts`
- [Upload handling](https://github.com/avinashrai20/dev-nexus26/blob/main/server/src/middleware/upload.ts): `server/src/middleware/upload.ts`
- [File operations](https://github.com/avinashrai20/dev-nexus26/blob/main/server/src/controllers/fileController.ts): `server/src/controllers/fileController.ts`
- [GridFS service](https://github.com/avinashrai20/dev-nexus26/blob/main/server/src/services/gridfs.service.ts): `server/src/services/gridfs.service.ts`

### Other components

- **Visitor or user**
- **MongoDB**

## Connections

- Visitor or user → Application routes: opens screens (evidence: `README.md`)
- Application routes → Discovery screens: routes to (evidence: `client/src/App.tsx`)
- Application routes → User dashboard: protects routes (evidence: `client/src/App.tsx`)
- Application routes → Admin screens: routes to (evidence: `client/src/App.tsx`)
- Application routes → Session state: checks session (evidence: `client/src/App.tsx`)
- User dashboard → API client: requests data (evidence: `client/src/pages/Dashboard.tsx`)
- Search screen → API client: searches (evidence: `client/src/pages/Search.tsx`)
- Admin screens → API client: manages content (evidence: `client/src/pages/admin/ManageRoadmaps.tsx`)
- Session state → API client: calls auth API (evidence: `client/src/store/useAuthStore.ts`)
- API client → REST API server: sends API requests (evidence: `README.md`)
- REST API server → Authentication routes: mounts routes (evidence: `server/src/server.ts`)
- REST API server → Content routes: mounts routes (evidence: `server/src/server.ts`)
- REST API server → File routes: mounts routes (evidence: `server/src/server.ts`)
- Authentication routes → Account operations: dispatches to (evidence: `server/src/routes/authRoutes.ts`)
- Authentication routes → Access checks: protects endpoints (evidence: `server/src/routes/authRoutes.ts`)
- Account operations → User collection: reads and updates (evidence: `server/src/controllers/authController.ts`)
- Access checks → User collection: loads account (evidence: `server/src/middleware/authMiddleware.ts`)
- Content routes → Search and saved content: dispatches to (evidence: `server/src/routes/contentRoutes.ts`)
- Content routes → Access checks: protects writes (evidence: `server/src/routes/contentRoutes.ts`)
- Search and saved content → Content collections: queries and updates (evidence: `server/src/controllers/contentController.ts`)
- Content routes → AI tool operations: routes tool requests
- Content routes → Post operations: routes post requests
- AI tool operations → Content collections: uses tool model (evidence: `server/src/controllers/aiToolController.ts`)
- Post operations → Content collections: uses post model (evidence: `server/src/controllers/postController.ts`)
- Content collections → MongoDB: persists content (evidence: `README.md`)
- User collection → MongoDB: persists accounts (evidence: `README.md`)
- File routes → Access checks: protects uploads (evidence: `server/src/routes/fileRoutes.ts`)
- File routes → Upload handling: parses uploads (evidence: `server/src/routes/fileRoutes.ts`)
- File routes → File operations: dispatches to (evidence: `server/src/routes/fileRoutes.ts`)
- File operations → Content collections: records resources (evidence: `server/src/controllers/fileController.ts`)
- File operations → GridFS service: uploads and streams (evidence: `server/src/controllers/fileController.ts`)
- GridFS service → MongoDB: stores file binaries (evidence: `README.md`)
