How alexeymezenin/ruby-on-rails-realworld-example-app works
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: routes.rb API routes · articles_controller.rb Article endpoints · comments_controller.rb Comment endpoints · article.rb Article model
Components 17
API routing
- API routes
config/routes.rb
Accounts and profiles
- Authentication
app/controllers/authentication_controller.rb - JWT concern
app/controllers/concerns/json_web_token.rb - User endpoints
app/controllers/users_controller.rb - Profile endpoints
app/controllers/profiles_controller.rb - User model
app/models/user.rb
Publishing and social
- Article endpoints
app/controllers/articles_controller.rb - Comment endpoints
app/controllers/comments_controller.rb - Tag endpoints
app/controllers/tags_controller.rb - Article model
app/models/article.rb - Comment model
app/models/comment.rb - Tag model
app/models/tag.rb - Relational database
config/database.yml
Rails foundation
- Controller base
app/controllers/application_controller.rb - Rails application
config/application.rb - Rails boot
config/boot.rb
Other components
- API client
Connections 17
- API client → API routes: sends requests
config/routes.rb - API routes → Authentication: dispatches login
config/routes.rb - API routes → User endpoints: dispatches users
config/routes.rb - API routes → Profile endpoints: dispatches profiles
config/routes.rb - API routes → Article endpoints: dispatches articles
config/routes.rb - API routes → Comment endpoints: dispatches comments
config/routes.rb - API routes → Tag endpoints: dispatches tags
config/routes.rb - Article endpoints → Article model: queries and updates
app/controllers/articles_controller.rb - Comment endpoints → Article model: finds article
app/controllers/comments_controller.rb - Comment endpoints → Comment model: creates comment
app/controllers/comments_controller.rb - Profile endpoints → User model: finds and follows
app/controllers/profiles_controller.rb - User endpoints → User model: creates and updates
app/controllers/users_controller.rb - Article model → Tag model: syncs tags
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
config/application.rb