How okturan/catching-app works
Project type and purpose
• Catching App is a full-stack web application built in Ruby on Rails.
• Its main purpose is event planning and scheduling among friends, with features like user authentication, event creation, invitations, and time-slot visualization.
File structure
• Top-level “app” directory splits MVC concerns:
• app/controllers (business logic & HTTP endpoints)
• app/models (domain objects: User, Event, Activity, TimeSlot, UserEvent)
• app/views (ERB templates for HTML rendering)
• app/javascript & app/assets handle front-end assets:
• JavaScript packs (Webpacker), custom components, ActionCable channels
• SCSS stylesheets organized by components/pages
• config/: Rails environment & routing (config/routes.rb)
• db/: migrations, schema, seeds (PostgreSQL)
• lib/: custom rake tasks or code generators
• test/: automated tests (controllers, models, system)
Key insights from README
• Uses Devise for authentication
• ActionCable enables real-time features (e.g., live time-slot updates)
• Bootstrap + SCSS for styling; Moment.js for date/time in JS components
• PostgreSQL database
• Standard Rails toolchain (Rake, Puma, Webpacker)
Main components & their interactions
a. Client (Browser)
• Issues HTTP requests for pages (Rails views) and JSON endpoints via AJAX
• Opens WebSocket channel for real-time updates (ActionCable)
• Runs JS components (time-slot definer, multiple select) bundled by Webpacker
b. Rails App Server (Puma)
• Routes incoming HTTP to controllers
• Renders views or serves JSON
• Authenticates via Devise
• Broadcasts/subscribes over ActionCable
c. Database (PostgreSQL)
• Persists Users, Events, TimeSlots, Activities, UserEvents
• Schema defined via db/migrate/ and db/schema.rb
d. Background Jobs (ActiveJob + optional adapter)
• Handles asynchronous tasks (e.g., sending invitation emails via ActionMailer)
e. Asset Pipeline & Webpacker
• SCSS → CSS (Sprockets pipeline)
• JS modules → bundled scripts (Webpack)
f. External Services
• Email delivery via SMTP or third-party (SendGrid, Mailgun)
• File storage if using ActiveStorage (e.g., AWS S3)
Architectural patterns & design principles
• MVC separation (app/controllers, models, views)
• Real-time pub/sub via WebSockets (ActionCable)
• Single code-base deployment (monolith) with clear modular sub-directories
• Convention-over-configuration (standard Rails conventions)
• RESTful routing (config/routes.rb)
• Controllers (HTTP entry points)
• Views (ERB templates)
• Models (ActiveRecord, business logic)
• Channels (ActionCable)
• Assets (SCSS & Webpacker bundles)
• Initializers & config modules