# alexeymezenin/ruby-on-rails-realworld-example-app architecture

> Architecture diagram of the GitHub repository alexeymezenin/ruby-on-rails-realworld-example-app, 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/alexeymezenin/ruby-on-rails-realworld-example-app
- Repository: https://github.com/alexeymezenin/ruby-on-rails-realworld-example-app

## Overview

This is a Rails API for Conduit, the RealWorld Medium-style publishing app. Clients send requests through Rails routes to account, authentication, article, comment, profile, and tag endpoints; controllers build JSON responses and use Active Record models for publishing and social relationships. Article handling includes filtering and feeds, tag synchronization, and favoriting; profiles support following. The README identifies the API as conforming to the RealWorld specification. Routes and sampled controller/model excerpts support the shown dispatches and calls; database wiring and unsampled controller behavior are not asserted.

Main entry points: [`config/routes.rb`](https://github.com/alexeymezenin/ruby-on-rails-realworld-example-app/blob/main/config/routes.rb) (API routes), [`app/controllers/articles_controller.rb`](https://github.com/alexeymezenin/ruby-on-rails-realworld-example-app/blob/main/app/controllers/articles_controller.rb) (Article endpoints), [`app/controllers/comments_controller.rb`](https://github.com/alexeymezenin/ruby-on-rails-realworld-example-app/blob/main/app/controllers/comments_controller.rb) (Comment endpoints), [`app/models/article.rb`](https://github.com/alexeymezenin/ruby-on-rails-realworld-example-app/blob/main/app/models/article.rb) (Article model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_routing["API routing"]
  node_routes["API routes<br/>[routes.rb]"]
end

subgraph group_accounts["Accounts and profiles"]
  node_auth["Authentication"]
  node_jwt["JWT concern<br/>[json_web_token.rb]"]
  node_users_controller["User endpoints"]
  node_profiles["Profile endpoints"]
  node_user_model["User model<br/>[user.rb]"]
end

subgraph group_publishing["Publishing and social"]
  node_articles["Article endpoints"]
  node_comments_controller["Comment endpoints"]
  node_tags_controller["Tag endpoints<br/>[tags_controller.rb]"]
  node_article_model["Article model<br/>[article.rb]"]
  node_comment_model["Comment model<br/>[comment.rb]"]
  node_tag_model["Tag model<br/>[tag.rb]"]
  node_database[("Relational database<br/>[database.yml]")]
end

subgraph group_framework["Rails foundation"]
  node_application_controller["Controller base"]
  node_application["Rails application<br/>[application.rb]"]
  node_boot["Rails boot<br/>[boot.rb]"]
end

node_client(("API client"))

node_client -->|"sends requests"| node_routes
node_routes -->|"dispatches login"| node_auth
node_routes -->|"dispatches users"| node_users_controller
node_routes -->|"dispatches profiles"| node_profiles
node_routes -->|"dispatches articles"| node_articles
node_routes -->|"dispatches comments"| node_comments_controller
node_routes -->|"dispatches tags"| node_tags_controller
node_articles -->|"queries and updates"| node_article_model
node_comments_controller -->|"finds article"| node_article_model
node_comments_controller -->|"creates comment"| node_comment_model
node_profiles -->|"finds and follows"| node_user_model
node_users_controller -->|"creates and updates"| node_user_model
node_article_model -->|"syncs tags"| node_tag_model
node_articles -.->|"reads followed users"| node_user_model
node_articles -.->|"persists records"| node_database
node_comments_controller -.->|"persists records"| node_database
node_application -->|"loads boot"| node_boot

click node_routes "https://github.com/alexeymezenin/ruby-on-rails-realworld-example-app/blob/main/config/routes.rb"
click node_auth "https://github.com/alexeymezenin/ruby-on-rails-realworld-example-app/blob/main/app/controllers/authentication_controller.rb"
click node_jwt "https://github.com/alexeymezenin/ruby-on-rails-realworld-example-app/blob/main/app/controllers/concerns/json_web_token.rb"
click node_users_controller "https://github.com/alexeymezenin/ruby-on-rails-realworld-example-app/blob/main/app/controllers/users_controller.rb"
click node_profiles "https://github.com/alexeymezenin/ruby-on-rails-realworld-example-app/blob/main/app/controllers/profiles_controller.rb"
click node_user_model "https://github.com/alexeymezenin/ruby-on-rails-realworld-example-app/blob/main/app/models/user.rb"
click node_articles "https://github.com/alexeymezenin/ruby-on-rails-realworld-example-app/blob/main/app/controllers/articles_controller.rb"
click node_comments_controller "https://github.com/alexeymezenin/ruby-on-rails-realworld-example-app/blob/main/app/controllers/comments_controller.rb"
click node_tags_controller "https://github.com/alexeymezenin/ruby-on-rails-realworld-example-app/blob/main/app/controllers/tags_controller.rb"
click node_article_model "https://github.com/alexeymezenin/ruby-on-rails-realworld-example-app/blob/main/app/models/article.rb"
click node_comment_model "https://github.com/alexeymezenin/ruby-on-rails-realworld-example-app/blob/main/app/models/comment.rb"
click node_tag_model "https://github.com/alexeymezenin/ruby-on-rails-realworld-example-app/blob/main/app/models/tag.rb"
click node_database "https://github.com/alexeymezenin/ruby-on-rails-realworld-example-app/blob/main/config/database.yml"
click node_application_controller "https://github.com/alexeymezenin/ruby-on-rails-realworld-example-app/blob/main/app/controllers/application_controller.rb"
click node_application "https://github.com/alexeymezenin/ruby-on-rails-realworld-example-app/blob/main/config/application.rb"
click node_boot "https://github.com/alexeymezenin/ruby-on-rails-realworld-example-app/blob/main/config/boot.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_client toneBlue
class node_auth,node_jwt,node_users_controller,node_profiles,node_user_model toneAmber
class node_articles,node_comments_controller,node_tags_controller,node_article_model,node_comment_model,node_tag_model,node_database toneMint
class node_application_controller,node_application,node_boot toneRose
```

## Components

### API routing

- [API routes](https://github.com/alexeymezenin/ruby-on-rails-realworld-example-app/blob/main/config/routes.rb): `config/routes.rb`

### Accounts and profiles

- [Authentication](https://github.com/alexeymezenin/ruby-on-rails-realworld-example-app/blob/main/app/controllers/authentication_controller.rb): `app/controllers/authentication_controller.rb`
- [JWT concern](https://github.com/alexeymezenin/ruby-on-rails-realworld-example-app/blob/main/app/controllers/concerns/json_web_token.rb): `app/controllers/concerns/json_web_token.rb`
- [User endpoints](https://github.com/alexeymezenin/ruby-on-rails-realworld-example-app/blob/main/app/controllers/users_controller.rb): `app/controllers/users_controller.rb`
- [Profile endpoints](https://github.com/alexeymezenin/ruby-on-rails-realworld-example-app/blob/main/app/controllers/profiles_controller.rb): `app/controllers/profiles_controller.rb`
- [User model](https://github.com/alexeymezenin/ruby-on-rails-realworld-example-app/blob/main/app/models/user.rb): `app/models/user.rb`

### Publishing and social

- [Article endpoints](https://github.com/alexeymezenin/ruby-on-rails-realworld-example-app/blob/main/app/controllers/articles_controller.rb): `app/controllers/articles_controller.rb`
- [Comment endpoints](https://github.com/alexeymezenin/ruby-on-rails-realworld-example-app/blob/main/app/controllers/comments_controller.rb): `app/controllers/comments_controller.rb`
- [Tag endpoints](https://github.com/alexeymezenin/ruby-on-rails-realworld-example-app/blob/main/app/controllers/tags_controller.rb): `app/controllers/tags_controller.rb`
- [Article model](https://github.com/alexeymezenin/ruby-on-rails-realworld-example-app/blob/main/app/models/article.rb): `app/models/article.rb`
- [Comment model](https://github.com/alexeymezenin/ruby-on-rails-realworld-example-app/blob/main/app/models/comment.rb): `app/models/comment.rb`
- [Tag model](https://github.com/alexeymezenin/ruby-on-rails-realworld-example-app/blob/main/app/models/tag.rb): `app/models/tag.rb`
- [Relational database](https://github.com/alexeymezenin/ruby-on-rails-realworld-example-app/blob/main/config/database.yml): `config/database.yml`

### Rails foundation

- [Controller base](https://github.com/alexeymezenin/ruby-on-rails-realworld-example-app/blob/main/app/controllers/application_controller.rb): `app/controllers/application_controller.rb`
- [Rails application](https://github.com/alexeymezenin/ruby-on-rails-realworld-example-app/blob/main/config/application.rb): `config/application.rb`
- [Rails boot](https://github.com/alexeymezenin/ruby-on-rails-realworld-example-app/blob/main/config/boot.rb): `config/boot.rb`

### Other components

- **API client**

## Connections

- API client → API routes: sends requests (evidence: `config/routes.rb`)
- API routes → Authentication: dispatches login (evidence: `config/routes.rb`)
- API routes → User endpoints: dispatches users (evidence: `config/routes.rb`)
- API routes → Profile endpoints: dispatches profiles (evidence: `config/routes.rb`)
- API routes → Article endpoints: dispatches articles (evidence: `config/routes.rb`)
- API routes → Comment endpoints: dispatches comments (evidence: `config/routes.rb`)
- API routes → Tag endpoints: dispatches tags (evidence: `config/routes.rb`)
- Article endpoints → Article model: queries and updates (evidence: `app/controllers/articles_controller.rb`)
- Comment endpoints → Article model: finds article (evidence: `app/controllers/comments_controller.rb`)
- Comment endpoints → Comment model: creates comment (evidence: `app/controllers/comments_controller.rb`)
- Profile endpoints → User model: finds and follows (evidence: `app/controllers/profiles_controller.rb`)
- User endpoints → User model: creates and updates (evidence: `app/controllers/users_controller.rb`)
- Article model → Tag model: syncs tags (evidence: `app/models/article.rb`)
- Article endpoints → User model: reads followed users
- Article endpoints → Relational database: persists records
- Comment endpoints → Relational database: persists records
- Rails application → Rails boot: loads boot (evidence: `config/application.rb`)
