# gajendarkodela/questions_blog architecture

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

- Interactive diagram: https://gitdiagram.com/gajendarkodela/questions_blog
- Repository: https://github.com/gajendarkodela/questions_blog

## Overview

This Rails application is a simple expert-discussion forum. A user enters through the routed web interface, browses questions, creates or updates questions, and posts answers or follow-up discussion comments; users can also review their own questions and responses. The domain centers on questions and polymorphic comments, with Devise-backed accounts and a SQLite database. Controller excerpts show question and comment persistence; the README describes the broader user workflow. The users controller and question model were not sampled, so their detailed behavior and associations are not asserted.

Main entry points: [`config/routes.rb`](https://github.com/gajendarkodela/questions_blog/blob/master/config/routes.rb) (Routes), [`app/models/comment.rb`](https://github.com/gajendarkodela/questions_blog/blob/master/app/models/comment.rb) (Comments and discussions), [`app/models/user.rb`](https://github.com/gajendarkodela/questions_blog/blob/master/app/models/user.rb) (User account model), [`app/controllers/questions_controller.rb`](https://github.com/gajendarkodela/questions_blog/blob/master/app/controllers/questions_controller.rb) (Question actions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web entry and workflows"]
  node_routes["Routes<br/>[routes.rb]"]
  node_questions_controller["Question actions"]
  node_comments_controller["Comment actions"]
  node_users_controller["User actions"]
end

subgraph group_domain["Forum domain"]
  node_question["Questions<br/>[question.rb]"]
  node_comment["Comments and discussions<br/>[comment.rb]"]
end

subgraph group_identity["Accounts and storage"]
  node_user["User account model<br/>[user.rb]"]
  node_devise["Authentication configuration<br/>[devise.rb]"]
  node_database[("SQLite records<br/>[schema.rb]")]
end

node_visitor(("Forum user"))

node_visitor -->|"requests pages"| node_routes
node_routes -->|"routes questions"| node_questions_controller
node_routes -->|"routes comments"| node_comments_controller
node_routes -->|"routes users"| node_users_controller
node_routes -->|"enables sign-in"| node_devise
node_questions_controller -->|"loads and saves"| node_question
node_questions_controller -.->|"builds answer"| node_comment
node_comments_controller -->|"loads and saves"| node_comment
node_user -->|"uses authentication"| node_devise
node_user -->|"owns questions"| node_question
node_user -->|"owns comments"| node_comment
node_comment -->|"belongs to"| node_user
node_comment -.->|"persists records"| node_database
node_question -.->|"persists records"| node_database

click node_routes "https://github.com/gajendarkodela/questions_blog/blob/master/config/routes.rb"
click node_questions_controller "https://github.com/gajendarkodela/questions_blog/blob/master/app/controllers/questions_controller.rb"
click node_comments_controller "https://github.com/gajendarkodela/questions_blog/blob/master/app/controllers/comments_controller.rb"
click node_users_controller "https://github.com/gajendarkodela/questions_blog/blob/master/app/controllers/users_controller.rb"
click node_question "https://github.com/gajendarkodela/questions_blog/blob/master/app/models/question.rb"
click node_comment "https://github.com/gajendarkodela/questions_blog/blob/master/app/models/comment.rb"
click node_user "https://github.com/gajendarkodela/questions_blog/blob/master/app/models/user.rb"
click node_devise "https://github.com/gajendarkodela/questions_blog/blob/master/config/initializers/devise.rb"
click node_database "https://github.com/gajendarkodela/questions_blog/blob/master/db/schema.rb"

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_routes,node_questions_controller,node_comments_controller,node_users_controller,node_visitor toneBlue
class node_question,node_comment toneAmber
class node_user,node_devise,node_database toneMint
```

## Components

### Web entry and workflows

- [Routes](https://github.com/gajendarkodela/questions_blog/blob/master/config/routes.rb): `config/routes.rb`
- [Question actions](https://github.com/gajendarkodela/questions_blog/blob/master/app/controllers/questions_controller.rb): `app/controllers/questions_controller.rb`
- [Comment actions](https://github.com/gajendarkodela/questions_blog/blob/master/app/controllers/comments_controller.rb): `app/controllers/comments_controller.rb`
- [User actions](https://github.com/gajendarkodela/questions_blog/blob/master/app/controllers/users_controller.rb): `app/controllers/users_controller.rb`

### Forum domain

- [Questions](https://github.com/gajendarkodela/questions_blog/blob/master/app/models/question.rb): `app/models/question.rb`
- [Comments and discussions](https://github.com/gajendarkodela/questions_blog/blob/master/app/models/comment.rb): `app/models/comment.rb`

### Accounts and storage

- [User account model](https://github.com/gajendarkodela/questions_blog/blob/master/app/models/user.rb): `app/models/user.rb`
- [Authentication configuration](https://github.com/gajendarkodela/questions_blog/blob/master/config/initializers/devise.rb): `config/initializers/devise.rb`
- [SQLite records](https://github.com/gajendarkodela/questions_blog/blob/master/db/schema.rb): `db/schema.rb`

### Other components

- **Forum user**

## Connections

- Forum user → Routes: requests pages (evidence: `config/routes.rb`)
- Routes → Question actions: routes questions (evidence: `config/routes.rb`)
- Routes → Comment actions: routes comments (evidence: `config/routes.rb`)
- Routes → User actions: routes users (evidence: `config/routes.rb`)
- Routes → Authentication configuration: enables sign-in (evidence: `config/routes.rb`)
- Question actions → Questions: loads and saves (evidence: `app/controllers/questions_controller.rb`)
- Question actions → Comments and discussions: builds answer
- Comment actions → Comments and discussions: loads and saves (evidence: `app/controllers/comments_controller.rb`)
- User account model → Authentication configuration: uses authentication (evidence: `app/models/user.rb`)
- User account model → Questions: owns questions (evidence: `app/models/user.rb`)
- User account model → Comments and discussions: owns comments (evidence: `app/models/user.rb`)
- Comments and discussions → User account model: belongs to (evidence: `app/models/comment.rb`)
- Comments and discussions → SQLite records: persists records
- Questions → SQLite records: persists records
