# ebuube/nervenex architecture

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

- Interactive diagram: https://gitdiagram.com/ebuube/nervenex
- Repository: https://github.com/ebuube/nervenex

## Overview

Nervenex is a learning and community web application: users register, browse or create quizzes, submit timed answers and review attempts, and can access learning resources and discussion forums. The repository exposes a Flask REST API and a separate server-rendered web app over shared domain models and configurable storage. The README documents community and resource capabilities whose detailed handlers were not sampled; those branches are represented at their exact view-directory paths without asserting unverified call wiring.

Main entry points: [`models/__init__.py`](https://github.com/ebuube/nervenex/blob/main/models/__init__.py) (Storage facade), [`api/v1/app.py`](https://github.com/ebuube/nervenex/blob/main/api/v1/app.py) (API app), [`web_dynamic/app.py`](https://github.com/ebuube/nervenex/blob/main/web_dynamic/app.py) (Web app), [`api/v1/views/answers.py`](https://github.com/ebuube/nervenex/blob/main/api/v1/views/answers.py) (Answer routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_dynamic["Web app<br/>[app.py]"]
end

subgraph group_api["REST API"]
  node_apiapp["API app<br/>[app.py]"]
  node_auth["Authentication<br/>[auth.py]"]
  node_quizviews["Quiz routes<br/>[quizzes.py]"]
  node_questionviews["Question routes<br/>[questions.py]"]
  node_attemptviews["Attempt routes<br/>[attempts.py]"]
  node_answerviews["Answer routes<br/>[answers.py]"]
  node_user_views["User routes<br/>[users.py]"]
  node_categoryviews["Category routes<br/>[categories.py]"]
end

subgraph group_learning["Quiz learning"]
  node_quiz["Quiz model<br/>[quiz.py]"]
  node_question["Question model<br/>[question.py]"]
  node_attempt["Attempt model<br/>[attempt.py]"]
  node_answer["Answer model<br/>[answer.py]"]
  node_category["Category model<br/>[category.py]"]
end

subgraph group_community["Community and resources"]
  node_resourceviews["Resource routes<br/>[resources.py]"]
  node_threadviews["Thread routes<br/>[threads.py]"]
  node_postviews["Post routes<br/>[posts.py]"]
  node_commentviews["Comment routes<br/>[comments.py]"]
  node_resource["Resource model<br/>[resource.py]"]
  node_thread["Thread model<br/>[thread.py]"]
  node_post["Post model<br/>[post.py]"]
  node_comment["Comment model<br/>[comment.py]"]
end

subgraph group_persistence["Domain and storage"]
  node_models["Domain models"]
  node_user["User model<br/>[user.py]"]
  node_authstate["Login state<br/>[authorized.py]"]
  node_storage["Storage facade<br/>[__init__.py]"]
  node_dbstorage["SQL storage<br/>[db_storage.py]"]
  node_filestorage["JSON storage<br/>[file_storage.py]"]
end

node_learner(("Learner"))
node_database[("SQL database")]
node_jsonfile["JSON file"]

node_learner -->|"browses"| node_dynamic
node_learner -->|"requests"| node_apiapp
node_apiapp -->|"dispatches"| node_auth
node_apiapp -->|"dispatches"| node_quizviews
node_apiapp -->|"dispatches"| node_questionviews
node_apiapp -->|"dispatches"| node_attemptviews
node_apiapp -->|"dispatches"| node_answerviews
node_apiapp -->|"dispatches"| node_user_views
node_apiapp -->|"dispatches"| node_categoryviews
node_apiapp -->|"dispatches"| node_resourceviews
node_apiapp -->|"dispatches"| node_threadviews
node_apiapp -->|"dispatches"| node_postviews
node_apiapp -->|"dispatches"| node_commentviews
node_dynamic -->|"queries"| node_storage
node_auth -->|"queries"| node_storage
node_auth -->|"loads"| node_user
node_auth -->|"authorizes"| node_authstate
node_answerviews -->|"queries and saves"| node_storage
node_answerviews -->|"creates"| node_attempt
node_answerviews -->|"records"| node_answer
node_answerviews -->|"checks"| node_question
node_answerviews -->|"loads"| node_quiz
node_answerviews -->|"loads"| node_user
node_answerviews -->|"checks"| node_authstate
node_quizviews -->|"uses"| node_storage
node_questionviews -->|"uses"| node_storage
node_attemptviews -->|"uses"| node_storage
node_user_views -->|"uses"| node_storage
node_categoryviews -->|"uses"| node_storage
node_resourceviews -->|"uses"| node_storage
node_threadviews -->|"uses"| node_storage
node_postviews -->|"uses"| node_storage
node_commentviews -->|"uses"| node_storage
node_storage -->|"selects"| node_dbstorage
node_storage -->|"selects"| node_filestorage
node_dbstorage -->|"reads and writes"| node_database
node_filestorage -->|"reads and writes"| node_jsonfile
node_dynamic -->|"loads"| node_quiz
node_dynamic -->|"loads"| node_attempt
node_dynamic -->|"loads"| node_category
node_dynamic -->|"loads"| node_user
node_dynamic -->|"checks"| node_authstate
node_dynamic -->|"reads"| node_answer
node_quiz -.->|"relates"| node_question
node_attempt -.->|"relates"| node_answer
node_attempt -.->|"relates"| node_quiz

click node_dynamic "https://github.com/ebuube/nervenex/blob/main/web_dynamic/app.py"
click node_apiapp "https://github.com/ebuube/nervenex/blob/main/api/v1/app.py"
click node_auth "https://github.com/ebuube/nervenex/blob/main/api/v1/views/auth.py"
click node_quizviews "https://github.com/ebuube/nervenex/blob/main/api/v1/views/quizzes.py"
click node_questionviews "https://github.com/ebuube/nervenex/blob/main/api/v1/views/questions.py"
click node_attemptviews "https://github.com/ebuube/nervenex/blob/main/api/v1/views/attempts.py"
click node_answerviews "https://github.com/ebuube/nervenex/blob/main/api/v1/views/answers.py"
click node_user_views "https://github.com/ebuube/nervenex/blob/main/api/v1/views/users.py"
click node_categoryviews "https://github.com/ebuube/nervenex/blob/main/api/v1/views/categories.py"
click node_resourceviews "https://github.com/ebuube/nervenex/blob/main/api/v1/views/resources.py"
click node_threadviews "https://github.com/ebuube/nervenex/blob/main/api/v1/views/threads.py"
click node_postviews "https://github.com/ebuube/nervenex/blob/main/api/v1/views/posts.py"
click node_commentviews "https://github.com/ebuube/nervenex/blob/main/api/v1/views/comments.py"
click node_models "https://github.com/ebuube/nervenex/tree/main/models"
click node_user "https://github.com/ebuube/nervenex/blob/main/models/user.py"
click node_authstate "https://github.com/ebuube/nervenex/blob/main/models/authorized.py"
click node_quiz "https://github.com/ebuube/nervenex/blob/main/models/quiz.py"
click node_question "https://github.com/ebuube/nervenex/blob/main/models/question.py"
click node_attempt "https://github.com/ebuube/nervenex/blob/main/models/attempt.py"
click node_answer "https://github.com/ebuube/nervenex/blob/main/models/answer.py"
click node_resource "https://github.com/ebuube/nervenex/blob/main/models/resource.py"
click node_thread "https://github.com/ebuube/nervenex/blob/main/models/thread.py"
click node_post "https://github.com/ebuube/nervenex/blob/main/models/post.py"
click node_comment "https://github.com/ebuube/nervenex/blob/main/models/comment.py"
click node_category "https://github.com/ebuube/nervenex/blob/main/models/category.py"
click node_storage "https://github.com/ebuube/nervenex/blob/main/models/__init__.py"
click node_dbstorage "https://github.com/ebuube/nervenex/blob/main/models/engine/db_storage.py"
click node_filestorage "https://github.com/ebuube/nervenex/blob/main/models/engine/file_storage.py"

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_dynamic toneBlue
class node_apiapp,node_auth,node_quizviews,node_questionviews,node_attemptviews,node_answerviews,node_user_views,node_categoryviews,node_database toneAmber
class node_quiz,node_question,node_attempt,node_answer,node_category toneMint
class node_resourceviews,node_threadviews,node_postviews,node_commentviews,node_resource,node_thread,node_post,node_comment toneRose
class node_models,node_user,node_authstate,node_storage,node_dbstorage,node_filestorage,node_learner,node_jsonfile toneIndigo
```

## Components

### Web experience

- [Web app](https://github.com/ebuube/nervenex/blob/main/web_dynamic/app.py): `web_dynamic/app.py`

### REST API

- [API app](https://github.com/ebuube/nervenex/blob/main/api/v1/app.py): `api/v1/app.py`
- [Authentication](https://github.com/ebuube/nervenex/blob/main/api/v1/views/auth.py): `api/v1/views/auth.py`
- [Quiz routes](https://github.com/ebuube/nervenex/blob/main/api/v1/views/quizzes.py): `api/v1/views/quizzes.py`
- [Question routes](https://github.com/ebuube/nervenex/blob/main/api/v1/views/questions.py): `api/v1/views/questions.py`
- [Attempt routes](https://github.com/ebuube/nervenex/blob/main/api/v1/views/attempts.py): `api/v1/views/attempts.py`
- [Answer routes](https://github.com/ebuube/nervenex/blob/main/api/v1/views/answers.py): `api/v1/views/answers.py`
- [User routes](https://github.com/ebuube/nervenex/blob/main/api/v1/views/users.py): `api/v1/views/users.py`
- [Category routes](https://github.com/ebuube/nervenex/blob/main/api/v1/views/categories.py): `api/v1/views/categories.py`

### Quiz learning

- [Quiz model](https://github.com/ebuube/nervenex/blob/main/models/quiz.py): `models/quiz.py`
- [Question model](https://github.com/ebuube/nervenex/blob/main/models/question.py): `models/question.py`
- [Attempt model](https://github.com/ebuube/nervenex/blob/main/models/attempt.py): `models/attempt.py`
- [Answer model](https://github.com/ebuube/nervenex/blob/main/models/answer.py): `models/answer.py`
- [Category model](https://github.com/ebuube/nervenex/blob/main/models/category.py): `models/category.py`

### Community and resources

- [Resource routes](https://github.com/ebuube/nervenex/blob/main/api/v1/views/resources.py): `api/v1/views/resources.py`
- [Thread routes](https://github.com/ebuube/nervenex/blob/main/api/v1/views/threads.py): `api/v1/views/threads.py`
- [Post routes](https://github.com/ebuube/nervenex/blob/main/api/v1/views/posts.py): `api/v1/views/posts.py`
- [Comment routes](https://github.com/ebuube/nervenex/blob/main/api/v1/views/comments.py): `api/v1/views/comments.py`
- [Resource model](https://github.com/ebuube/nervenex/blob/main/models/resource.py): `models/resource.py`
- [Thread model](https://github.com/ebuube/nervenex/blob/main/models/thread.py): `models/thread.py`
- [Post model](https://github.com/ebuube/nervenex/blob/main/models/post.py): `models/post.py`
- [Comment model](https://github.com/ebuube/nervenex/blob/main/models/comment.py): `models/comment.py`

### Domain and storage

- [Domain models](https://github.com/ebuube/nervenex/tree/main/models): `models`
- [User model](https://github.com/ebuube/nervenex/blob/main/models/user.py): `models/user.py`
- [Login state](https://github.com/ebuube/nervenex/blob/main/models/authorized.py): `models/authorized.py`
- [Storage facade](https://github.com/ebuube/nervenex/blob/main/models/__init__.py): `models/__init__.py`
- [SQL storage](https://github.com/ebuube/nervenex/blob/main/models/engine/db_storage.py): `models/engine/db_storage.py`
- [JSON storage](https://github.com/ebuube/nervenex/blob/main/models/engine/file_storage.py): `models/engine/file_storage.py`

### Other components

- **Learner**
- **SQL database**
- **JSON file**

## Connections

- Learner → Web app: browses
- Learner → API app: requests
- API app → Authentication: dispatches
- API app → Quiz routes: dispatches
- API app → Question routes: dispatches
- API app → Attempt routes: dispatches
- API app → Answer routes: dispatches
- API app → User routes: dispatches
- API app → Category routes: dispatches
- API app → Resource routes: dispatches
- API app → Thread routes: dispatches
- API app → Post routes: dispatches
- API app → Comment routes: dispatches
- Web app → Storage facade: queries
- Authentication → Storage facade: queries
- Authentication → User model: loads
- Authentication → Login state: authorizes
- Answer routes → Storage facade: queries and saves
- Answer routes → Attempt model: creates
- Answer routes → Answer model: records
- Answer routes → Question model: checks
- Answer routes → Quiz model: loads
- Answer routes → User model: loads
- Answer routes → Login state: checks
- Quiz routes → Storage facade: uses
- Question routes → Storage facade: uses
- Attempt routes → Storage facade: uses
- User routes → Storage facade: uses
- Category routes → Storage facade: uses
- Resource routes → Storage facade: uses
- Thread routes → Storage facade: uses
- Post routes → Storage facade: uses
- Comment routes → Storage facade: uses
- Storage facade → SQL storage: selects
- Storage facade → JSON storage: selects
- SQL storage → SQL database: reads and writes
- JSON storage → JSON file: reads and writes
- Web app → Quiz model: loads
- Web app → Attempt model: loads
- Web app → Category model: loads
- Web app → User model: loads
- Web app → Login state: checks
- Web app → Answer model: reads
- Quiz model → Question model: relates
- Attempt model → Answer model: relates
- Attempt model → Quiz model: relates
