How mdilovar/rubik_n works
rubik_n is an online 3D Rubik’s Cube game, rendered with three.js, with selectable cube sizes from 2×2×2 to 10×10×10. The main user journey is to enter the game, manipulate a cube, and use the solution guide; the README establishes the product but the supplied excerpts do not show the browser event wiring, so those links are marked unverified. PHP files indicate supporting account, score, and leaderboard features. The graph includes those server-side stages and the Facebook SDK’s documented-by-source request layers; source details for several PHP endpoints were not excerpted, so their internal behavior is not expanded.
Main entry points: db_connect.php Database connection · FacebookClient.php Facebook client · fbauth.php Authentication · score.php Score submission
Components 24
Cube gameplay
- Game page
index.php - Game runtime
js/game.js - Cube model
js/cube.js - Cube layers
js/cubeLayer.js - Cube controls
js/cubeControls.js - View controls
js/main.js - Solution guide
js/solutionGuide.js
Accounts
- Login UI
js/login.js - Authentication
php/fbauth.php - Auth helpers
php/auth_helpers.php - Registration
php/register.php - Login endpoint
php/login.php - Logout
php/logout.php
Scores
- Score submission
php/score.php - Leaderboard
php/leaderboard.php - Request validation
php/validate.php - Database connection
php/db_connect.php - Application database
php/config.php
Facebook SDK
- Facebook client
php/lib/facebook-php-sdk-v4-5.0.0/src/Facebook/FacebookClient.php - Graph request
php/lib/facebook-php-sdk-v4-5.0.0/src/Facebook/FacebookRequest.php - Graph response
php/lib/facebook-php-sdk-v4-5.0.0/src/Facebook/FacebookResponse.php - HTTP transport
php/lib/facebook-php-sdk-v4-5.0.0/src/Facebook/HttpClients/FacebookHttpClientInterface.php
Other components
- Player
- Facebook Graph API
Connections 25
- Player → Game page: opens
- Game page → Game runtime: starts
- Game runtime → Cube model: manipulates
- Cube model → Cube layers: uses
- Player → Cube controls: turns cube
- Player → View controls: changes view
- Player → Solution guide: requests guidance
- Player → Login UI: signs in
- Login UI → Authentication: authenticates
- Authentication → Auth helpers: uses
php/fbauth.php - Authentication → Facebook Graph API: checks identity
- Player → Registration: registers
- Player → Login endpoint: submits login
- Player → Logout: logs out
- Player → Score submission: submits score
- Score submission → Request validation: validates
php/score.php - Score submission → Database connection: uses
php/score.php - Leaderboard → Request validation: validates
php/leaderboard.php - Leaderboard → Database connection: queries through
php/leaderboard.php - Database connection → Application database: loads config
php/db_connect.php - Auth helpers → Database connection: uses
php/auth_helpers.php - Facebook client → Graph request: sends
php/lib/facebook-php-sdk-v4-5.0.0/src/Facebook/FacebookClient.php - Facebook client → HTTP transport: dispatches via
php/lib/facebook-php-sdk-v4-5.0.0/src/Facebook/FacebookClient.php - HTTP transport → Facebook Graph API: calls
- Facebook client → Graph response: builds
php/lib/facebook-php-sdk-v4-5.0.0/src/Facebook/FacebookClient.php