How raspberrypifoundation/editor-api works
This Rails monolith exposes project and curriculum-management APIs for the Raspberry Pi Code Editor. Users and service clients enter through REST or GraphQL; project operations support persistence, remixing, images, and Scratch assets, while education workflows manage schools, classes, lessons, teachers, and students. Authentication and authorization underpin these interfaces. The README also documents asynchronous curriculum synchronization and GitHub webhook imports. The graph reflects documented capabilities and sampled controller behavior; unsampled controller wiring is intentionally not inferred.
Main entry points: projects_controller.rb Project endpoints · school_classes_controller.rb Class endpoints · api REST API · graphql_controller.rb GraphQL API
Components 27
API interfaces
- REST API
app/controllers/api - GraphQL API
app/controllers/graphql_controller.rb - Editor schema
app/graphql/editor_api_schema.rb
Projects and assets
- Project endpoints
app/controllers/api/projects_controller.rb - Project operations
lib/concepts/project/operations - Project records
app/models/project.rb - Project images
app/controllers/api/projects/images_controller.rb - Scratch projects
app/controllers/api/scratch/projects_controller.rb - Scratch assets
app/controllers/api/scratch/assets_controller.rb - Asset storage
app/models/scratch_asset.rb
Education management
- School endpoints
app/controllers/api/schools_controller.rb - Class endpoints
app/controllers/api/school_classes_controller.rb - Class operations
lib/concepts/school_class/operations - Student management
app/controllers/api/school_students_controller.rb - Lesson management
app/controllers/api/lessons_controller.rb - Education operations
lib/concepts - School records
app/models/school.rb
Identity and access
- Login and sessions
app/controllers/auth_controller.rb - Authorization
app/models/ability.rb - Profile identity
lib/profile_api_client.rb
External integrations
- Raspberry Pi Accounts
- Experience CS sync
app/controllers/api/experience_cs_project_migrations_controller.rb - GitHub webhook
app/controllers/github_webhooks_controller.rb - Curriculum upload job
app/jobs/upload_job.rb - GitHub
Other components
- Editor user
- Service client
Connections 28
- Editor user → REST API: calls REST
- Service client → REST API: calls REST
- Editor user → GraphQL API: calls GraphQL
- GraphQL API → Editor schema: executes schema
- Editor user → Login and sessions: signs in
- Login and sessions → Profile identity: authenticates
- Profile identity → Raspberry Pi Accounts: requests identity
- REST API → Authorization: checks access
- GraphQL API → Authorization: checks access
- REST API → Project endpoints: dispatches project requests
- Project endpoints → Project operations: runs operations
- Project endpoints → Project records: reads and writes
- Project endpoints → Project images: serves image routes
- Project endpoints → Scratch projects: serves Scratch routes
- Scratch projects → Scratch assets: serves asset routes
- Scratch assets → Asset storage: reads and writes
- Service client → Experience CS sync: migrates projects
- Experience CS sync → Project records: updates projects
- Editor user → School endpoints: manages schools
- Editor user → Class endpoints: manages classes
- Class endpoints → Class operations: calls operations
- Class endpoints → Education operations: creates students
- Editor user → Student management: manages students
- Editor user → Lesson management: manages lessons
- School endpoints → School records: reads and writes
- Class endpoints → School records: reads and writes
- GitHub → GitHub webhook: sends push event
- GitHub webhook → Curriculum upload job: schedules job