How martynasmatdev/labelflow works
LabelFlow is a single Django monolith with server-rendered pages. The backend, routing, templates, static assets, and persistence all live in one repository. The app uses SQLite by default and stores user-uploaded files separately under media/, while CSS/JS live in static/.
The Django project config is in labelflow/ (settings.py, urls.py, asgi.py, wsgi.py). manage.py is the entry point for migrations, tests, admin setup, and local server startup.
The application is split into three main domain apps under apps/, which form the core architectural boundaries:
• accounts for authentication and user profile management
• projects for project and team organization
• images for image upload, listing, and annotation workflows
accounts owns registration/login/profile flows. The presence of forms.py, views.py, urls.py, and an admin.py suggests it handles Django auth-driven screens plus profile editing, with templates for login/register/profile in the shared templates/ tree.
projects is the collaboration layer. Its migrations show project lifecycle changes, including an archived-state field, so this app likely manages project creation, project detail views, lists, archived projects, and team membership/management.
images is the labeling/annotation layer. Its migrations indicate richer image metadata: tags, status changes, and bounding boxes. That points to a workflow where uploaded images are associated with projects and then annotated or categorized.
The main data flow is request-driven and page-based:
1. Browser requests hit labelflow/urls.py.
2. URLs dispatch into one of the three apps.
3. Views read/write Django models via SQLite.
4. Templates render HTML responses.
5. Static JS/CSS provide client-side behavior on interactive pages like image annotation.
The templates are organized by concern. templates/base.html and templates/app/app_base.html provide shared layout, while templates/app/ contains feature pages such as dashboard, project list/detail/create, image list/detail/upload/annotate, team management, archived projects, and profile. templates/registration/ contains the auth pages.
The front end is intentionally lightweight: HTML templates with a shared stylesheet and a small JavaScript bundle. This suggests the app relies primarily on Django server-side rendering, with JavaScript augmenting annotation and interaction-heavy screens rather than running a full SPA.
Django admin support is present in each app, which means the domain objects are manageable through the built-in admin interface in addition to the custom UI. That gives the system two administrative entry points: end-user pages and staff/admin CRUD.
Architecturally, the key boundaries are:
• configuration layer (labelflow/)
• domain apps (accounts, projects, images)
• presentation layer (templates/, static/)
• persistence layer (SQLite + migrations + media files)
Overall, LabelFlow is best understood as a modular Django web application for team-based image labeling, with projects as the organizing container, accounts as the identity layer, and images as the annotation workload.
Main entry points: settings.py Settings · accounts/views.py Account views · images/views.py Image views · urls.py Root URLs
Components 21
Configuration
Django project entrypoints and runtime config.
- manage.py · CLI entrypoint for admin tasks, migrations, tests, and local runs.
manage.py - Settings · Project settings, including database and app wiring.
labelflow/settings.py - Root URLs · Top-level URL dispatcher for the Django site.
labelflow/urls.py - ASGI/WSGI · Server adapters for async and WSGI deployment.
Accounts
Authentication and profile domain.
- Account data · Users, profiles, and auth-related persistence.
apps/accounts/models.py - Account forms · Registration, login, and profile editing forms.
apps/accounts/forms.py - Account views · Authentication and profile page handlers.
apps/accounts/views.py - Account URLs · URL patterns for auth and profile flows.
apps/accounts/urls.py
Projects
Project and team collaboration domain.
- Project data · Projects, archived state, and team membership data.
apps/projects/models.py - Project views · Project list, detail, create, archive, and team screens.
apps/projects/views.py - Project URLs · URL patterns for project and team management pages.
apps/projects/urls.py
Images
Upload and annotation domain.
- Image data · Uploaded images, tags, statuses, and bounding boxes.
apps/images/models.py - Image views · Upload, list, detail, and annotation handlers.
apps/images/views.py - Image URLs · URL patterns for labeling workflow pages.
apps/images/urls.py
Presentation
Server-rendered templates and static assets.
- Base templates · Shared HTML shell for the site and app area.
templates/base.html - App pages · Server-rendered pages for dashboard, projects, images, team, and profile.
templates/app/app_base.html - Auth pages · Login and registration screens.
templates/registration/login.html - Main CSS · Shared styling for the server-rendered UI.
static/css/main.css - Main JS · Client-side behavior for interactive pages such as annotation.
static/js/main.js
Data
Persistence and schema evolution.
- SQLite DB · Default local persistence backend configured by Django settings.
- Migrations · Schema evolution for accounts, projects, and images.
apps/accounts/migrations/0001_initial.py
Connections 27
- manage.py → Settings: loads · Management commands resolve project configuration.
- manage.py → Root URLs: starts · Runs the site or administrative workflows through the project entrypoints.
- ASGI/WSGI → Root URLs: serves · ASGI/WSGI adapters hand requests to the URL router.
- Settings → SQLite DB: configures · Settings define the default SQLite persistence backend.
- Settings → Account URLs: installs · Project settings include the domain apps.
- Settings → Project URLs: installs · Project settings include the domain apps.
- Settings → Image URLs: installs · Project settings include the domain apps.
- Root URLs → Account URLs: routes · Top-level routes delegate auth paths to the accounts app.
- Root URLs → Project URLs: routes · Top-level routes delegate project paths to the projects app.
- Root URLs → Image URLs: routes · Top-level routes delegate labeling paths to the images app.
- Account URLs → Account views: dispatches · Account routes resolve to page handlers.
- Account views → Account forms: uses · Views rely on forms for registration and profile editing.
- Account views → Account data: reads/writes · Authentication and profile screens persist account data.
- Project URLs → Project views: dispatches · Project routes resolve to collaboration handlers.
- Project views → Project data: reads/writes · Project pages manage project and membership records.
- Project views → App pages: renders · Project screens are server-rendered from shared app templates.
- Image URLs → Image views: dispatches · Image routes resolve to upload and annotation handlers.
- Image views → Image data: reads/writes · Labeling workflows persist image metadata and annotations.
- Image views → Main JS: augments · Interactive annotation screens use client-side behavior.
- Image views → App pages: renders · Image workflow pages are rendered through the shared app shell.
- Account views → Auth pages: renders · Auth and profile flows use registration/login templates.
- Account views → Base templates: extends · Account pages share the global layout.
- Project views → Main CSS: styles · Project pages share the common stylesheet.
- Image views → Main CSS: styles · Annotation pages share the common stylesheet.
- Migrations → Account data: evolves · Schema history tracks account model changes.
- Migrations → Project data: evolves · Schema history tracks project model changes.
- Migrations → Image data: evolves · Schema history tracks image model changes.