Tech Stack
Backend
- Django 1.11
- Django REST Framework
- PostgreSQL
- Celery for async tasks
Frontend
- Vue.js 2.7
- Vuex for state management
- Vue Router
- IndexedDB with Dexie.js
Frontend Architecture
Multiple Single-Page Applications
Studio is divided into multiple SPAs, each with a distinct purpose:| SPA | Purpose |
|---|---|
| Channel List | Display and manage channels (public, editable), create channels and collections |
| Channel Edit | Edit channel contents and structure - the primary Studio interface |
| Accounts | User registration, login, password recovery |
| Administration | Staff-only admin panel for user and channel management |
| Settings | User account settings |
Frontend Code Structure
All frontend code lives undercontentcuration/contentcuration/frontend/:
SPA Code Conventions
Each SPA follows these conventions:Backend Architecture
Django Structure
The backend uses Django with custom viewsets and serializers:Custom Base Classes
Studio uses custom DRF base classes for performance:ValuesViewset
ValuesViewset
Located in
viewsets/base.py, this viewset optimizes read performance by:- Using
.values()queries instead of serializer reads - Defining a
valuestuple for fields to return - Using
field_mapto rename/transform fields - Supporting custom methods:
get_queryset,prefetch_queryset,annotate_queryset,consolidate
BulkModelSerializer
BulkModelSerializer
Located in
viewsets/base.py, this serializer enables bulk operations:bulk_create- Create multiple instancesbulk_update- Update multiple instancesbulk_delete- Delete multiple instances- Tracks changes via
self.changeslist
Data Flow
Read Flow
Check IndexedDB cache
Resource API checks IndexedDB for cached data. If found and fresh (< 5 seconds old), returns immediately.
Write Flow
Backend validates and applies
The sync endpoint validates changes and calls appropriate viewset methods (
bulk_update, bulk_create, etc.).Sync Mechanism
The sync system enables offline-first editing:- Change Types
- Sync Endpoint
- Conflict Resolution
Four change types are tracked:
IndexedDB Resources
Frontend data is persisted in IndexedDB tables managed by Dexie.js.Resource API
Resources are defined infrontend/shared/data/resources.js:
Common Resources
| Resource | Table | Purpose |
|---|---|---|
Channel | channel | Channel metadata |
ContentNode | contentnode | Content items in tree |
File | file | File metadata |
AssessmentItem | assessmentitem | Exercise questions |
User | user | User information |
Vuex Integration
Vuex stores listen to IndexedDB changes via Dexie Observable:Data Flow Diagram
Key Technologies
Dexie.js
IndexedDB wrapper for client-side storage
Dexie Observable
Track IndexedDB changes automatically
Django REST Framework
REST API framework for Django
Celery
Distributed task queue for async operations
Next Steps
Frontend Development
Build Vue.js components and Vuex modules
Backend Development
Create Django models and viewsets
