collaborative_editor/
├── collaborative_editor/ # Django project settings
│ ├── settings.py # Main configuration
│ ├── asgi.py # ASGI entrypoint (WebSocket + HTTP)
│ └── urls.py # Root URL routing
├── editor/ # Main application
│ ├── models.py # Document, DocumentCollaborator, DocumentVersion
│ ├── consumers.py # WebSocket consumer for live editing
│ ├── routing.py # WebSocket URL routing
│ ├── views.py # Document CRUD, collaborator management
│ ├── forms.py # Registration/document forms
│ ├── static/ # CSS and JS (editor.js, collaborators.js)
│ └── templates/editor/ # Document list, editor, collaborator UI
└── manage.py
I wanted to understand what actually happens under the hood in tools like Google Docs or VS Code Live Share — not just "it syncs," but the concrete plumbing: rooms, broadcast vs. echo-to-sender, per-user cursor state, and where permissions have to be checked (view vs. edit) before any of that is trusted. Django Channels turned out to be a good way to build that from first principles without reinventing a WebSocket server.