How hmaddocks/pohqer_ruby works
Main Components
a. Frontend Layer:
• Phlex View Components hierarchy
• ApplicationComponent as the root
• Specialized components (GameComponent, RoundComponent, etc.)
• JavaScript Controllers (using Stimulus.js based on the controllers directory)
• Assets (CSS/Tailwind, Images)
b. Backend Layer:
• Controllers (GamesController, RoundsController)
• Models Layer showing relationships:
• Game
• Player
• Round
• Vote
• Application Controller & Base Classes
c. Infrastructure Components:
• Database (PostgreSQL, indicated by database.yml)
• Action Cable (WebSocket, indicated by cable.yml)
• Cache Layer (indicated by cache.yml)
• Job Queue System (indicated by queue.yml)
[Client Layer]
• ↕
[Application Layer]
• ↕
[Data Layer]
Component Relationships
a. Client Layer (Top):
• How View Components interact with JavaScript controllers
• WebSocket connections for real-time features
• Asset pipeline flow
b. Application Layer (Middle):
• MVC pattern implementation
• Routing flow from routes.rb to controllers
• Component rendering pipeline
• Action Cable channels for real-time updates
c. Data Layer (Bottom):
• Model relationships
• Database interactions
• Caching mechanism
• Background job processing
Specific Elements
• PWA capabilities (indicated by pwa directory)
• Deployment flow (indicated by Kamal configuration)
• Testing infrastructure (RSpec)
• Background job processing
• Caching strategy
• Database migrations and schema
[PWA Shell]
• ↓
[View Components] ←→ [JavaScript Controllers]
• ↓
[Controllers] ←→ [Action Cable]
• ↓
[Models] ←→ [Background Jobs]
• ↓
[Database/Cache/Queue]
Additional Notes
• Annotations for key architectural decisions
• Scaling points and potential bottlenecks