How elialbert/starchess works
Main Components
A. Frontend Layer:
• Angular Single Page Application (SPA)
• Key components:
• Controllers (HomeCtrl, StarchessGameCtrl, StarchessGamesCtrl)
• Directives (boardDirective, aiBoardDirective, chatBoxDirective)
• Services (boardService, gameService)
B. Backend Layer:
• Ruby on Rails Application
• API Controllers
• Models (User, StarchessGame, Rating, Event, Attendrequest)
• Game Logic (lib/starchess/)
C. External Services:
• Firebase (for real-time multiplayer features)
• OAuth providers (indicated by omniauth configuration)
D. Database Layer:
• SQL Database (indicated by ActiveRecord migrations)
[Client Layer]
• ↑↓
[Application Layer]
• ↑↓
[Data Layer]
Specific Implementation Details
a) Client Layer:
• Separate sections for:
• UI Components (templates)
• Game Controllers
• Services
• Directives
b) Application Layer:
• Rails API Controllers
• Game Logic Components:
• AI Module
• Board Logic
• Piece Definitions
• Game Rules
c) Real-time Communication:
• Firebase integration for multiplayer features
• WebSocket connections
d) Authentication Flow:
• OAuth providers
• Devise integration
Key Relationships to Highlight
• Real-time game state updates between players via Firebase
• API communication between Angular and Rails
• Authentication flow with OAuth providers
• Game logic interaction with both frontend and backend
Create distinct sections for:
Flow Indicators
• HTTP/HTTPS API calls
• WebSocket connections
• Database queries
• Real-time updates
• Authentication flows
This architecture requires special attention to the real-time gaming aspects while maintaining clarity about the overall web application structure.