How luckyxjx/cipherschool-sqlstudo-assignment works
CipherSQLStudio is a browser-based SQL practice app. Learners browse assignments, inspect sample tables, edit and run SQL, compare results with expected output, and optionally request hints; attempts are saved under a session identity. The graph follows the documented API flow and sampled call sites. Assignment/progress persistence is MongoDB-backed, and query execution uses PostgreSQL. The seed-data path and several UI components are represented only where the README or indexed references support their role; unsampled internal links are omitted.
Main entry points: assignmentController.js Request controller · AssignmentAttemptPage.jsx Practice workspace · App.jsx App routing · queryService.js Query execution
Components 22
Learner interface
- App routing
client/src/App.jsx - Assignment list
client/src/pages/AssignmentListPage.jsx - Practice workspace
client/src/pages/AssignmentAttemptPage.jsx - API client
client/src/services/api.js - SQL editor
client/src/ui/QueryEditor.jsx - Results table
client/src/ui/ResultsTable.jsx - Sample data viewer
client/src/ui/SampleDataViewer.jsx - Difficulty badge
client/src/ui/DifficultyBadge.jsx
Assignment API
- HTTP application
server/src/app.js - Assignment routes
server/src/routes/assignmentRoutes.js - Request controller
server/src/controllers/assignmentController.js - Environment config
server/src/config/env.js
Query practice
- SQL safety
server/src/utils/sqlSafety.js - Query execution
server/src/services/queryService.js - PostgreSQL
- Output evaluation
server/src/services/resultService.js - Hint generation
server/src/services/hintService.js
Assignment state
- Assignment records
server/src/models/Assignment.js - Learner progress
server/src/models/UserProgress.js - MongoDB
Other components
- Learner
- OpenAI-compatible service
Connections 25
- Learner → App routing: uses
README.md - App routing → API client: loads data
client/src/App.jsx - App routing → Assignment list: renders
client/src/App.jsx - App routing → Practice workspace: opens assignment
client/src/App.jsx - Assignment list → Difficulty badge: shows difficulty
client/src/pages/AssignmentListPage.jsx - Practice workspace → API client: requests
client/src/pages/AssignmentAttemptPage.jsx - Practice workspace → SQL editor: renders
client/src/pages/AssignmentAttemptPage.jsx - Practice workspace → Results table: renders
client/src/pages/AssignmentAttemptPage.jsx - Practice workspace → Sample data viewer: renders
client/src/pages/AssignmentAttemptPage.jsx - API client → HTTP application: HTTP requests
README.md - HTTP application → Assignment routes: mounts routes
server/src/app.js - Assignment routes → Request controller: dispatches
server/src/routes/assignmentRoutes.js - Request controller → Assignment records: reads
server/src/controllers/assignmentController.js - Request controller → Learner progress: reads and saves
server/src/controllers/assignmentController.js - Assignment records → MongoDB: persists in
- Learner progress → MongoDB: persists in
- Request controller → Query execution: executes SQL
server/src/controllers/assignmentController.js - Query execution → SQL safety: validates SQL
server/src/services/queryService.js - Query execution → PostgreSQL: runs query
server/src/services/queryService.js - Request controller → Output evaluation: checks output
server/src/controllers/assignmentController.js - Request controller → Hint generation: requests hint
server/src/controllers/assignmentController.js - Hint generation → OpenAI-compatible service: asks for hint
server/src/services/hintService.js - HTTP application → Environment config: configures CORS
server/src/app.js - Hint generation → Environment config: reads settings
server/src/services/hintService.js - Query execution → Environment config: reads timeout
server/src/services/queryService.js