How dcowett/jubilant-engine works
Project type and purpose
• This is a monolithic, full-stack Ruby on Rails web application that implements a simple microblog: users sign up, log in, post “microposts,” follow/unfollow other users, and receive email notifications (activation, password reset).
• It uses MVC (Model-View-Controller), the Rails asset pipeline (SCSS, Importmap, Stimulus), Active Storage for image uploads, Action Mailer for emails, and Active Job/Action Cable hooks for background jobs and real-time channels.
Main high-level components
a. Client (Web Browser)
– Renders HTML/ERB views and CSS (application.scss, custom.scss)
– Runs Stimulus controllers and custom JavaScript (app/javascript)
b. Rails Application Server
– Rack stack + Puma web server (Procfile, puma.rb)
– Rails Router (config/routes.rb) dispatching to Controllers
– Controllers (app/controllers/*) implementing RESTful endpoints
– Views (app/views/*.erb) generating HTML responses
– Models (app/models/*.rb) with ActiveRecord ORM, validations, associations
– Mailers (app/mailers/*) sending account‐activation & password‐reset emails
– Jobs (app/jobs/*) for background processing (Active Job)
– Channels (app/channels/*) for WebSocket connections (Action Cable)
– Active Storage (config/storage.yml + service adapters) for file uploads
c. Data Stores
– Relational Database (SQLite in development, PostgreSQL in production)
– File storage (local disk in dev, AWS S3 in prod via Active Storage)
– (Optional) Redis for Action Cable or background adapter in production
d. External Services
– SMTP service (e.g. SendGrid) for outbound mail
– AWS S3 for image storage (production)
– Heroku platform for deployment (web & worker dynos)
Relationships and data flows
– Browser → HTTP(S) request → Puma/Rack middleware → Rails Router → Controller action
– Controller ↔ Model (ActiveRecord) ↔ Database
– Controller → View → HTML → Browser
– Browser ↔ WebSocket → Action Cable server → Channel classes
– Controller/Mailer/Job → SMTP → External mail service → User email inbox
– Controller/Job → Active Storage adapter → AWS S3 (prod)
– Controller enqueues background jobs → Active Job adapter → (Redis/DB) → Worker dyno
Architectural patterns & design principles
– MVC: clear separation of concerns (Models, Controllers, Views)
– RESTful resource routing for Users, Sessions, Microposts, Relationships, PasswordResets, AccountActivations
– Asset pipeline + Importmap + Stimulus for progressive enhancement
– Layered architecture: Web layer, Application layer, Data layer
– Use of background jobs and Action Cable hooks for scalability and responsiveness
Final checklist
• MVC boundaries, the asset‐pipeline/client boundary, and the external service boundary