Developer Documentation
Technical documentation for developers working with Caliper β an AI-powered educational assessment platform.
Overviewβ
Caliper is built with:
- Backend: Django 5.2 + Django REST Framework
- Frontend: React 18 + TypeScript + Material UI (MUI)
- Database: PostgreSQL 15
- Task Queue: Celery + Redis
- AI: Anthropic Claude, DeepSeek, and OpenAI-compatible APIs (environment-switched)
- Storage: GitHub integration + local storage
- Deployment: Docker Compose + Nginx
Note on FastAPI: an earlier FastAPI migration was archived and is not part of the current production stack. The live backend is Django. See the archived
_api_archived_fastapi/directory in the repo for history.
Architectureβ
βββββββββββββββ ββββββββββββββββ ββββββββββββββ
β React β βββββββΊ β Nginx β βββββββΊ β Django β
β Frontend β β Reverse Proxyβ β Backend β
βββββββββββββββ ββββββββββββββββ ββββββββββββββ
β
βΌ
ββββββββββββββββ ββββββββββββββ
β Redis β βββββββΊ β PostgreSQL β
β (Celery) β β Database β
ββββββββββββββββ ββββββββββββββ
β
βΌ
ββββββββββββββββ ββββββββββββββ
β Celery β βββββββΊ β GitHub β
β Workers β β Storage β
ββββββββββββββββ ββββββββββββββ
β
βΌ
ββββββββββββββββ
β AI Provider β
β (Claude/etc) β
ββββββββββββββββ
Key modelsβ
Organisation & licensing:
Organisation,UserProfile,License,Policy
Educational structure:
School,Teacher,Learner,SchoolClass,Subject,Cluster
Assessment:
Assessment,Assignment,Submission,Grade,Rubric
PAT system:
PATAssessment,PATPhase,PATConsolidatedReport,Portfolio
Reporting:
LaTeXReportTemplate,GeneratedReport,CommentTemplate,CommentGeneration,GeneratedComment
AI assistant:
ChatSession,ChatMessage,ChatJob,AssistantSession,Artifact,MemoryTopic
Curriculum & paper generation:
CurriculumPage,PastPaperQuestion,PaperTemplate,PaperNode,Workspace,StyleProfile
Release & privacy:
ResultRelease,TeacherDataExport,TeacherDataCleanup,ImpersonationSession
Rolesβ
UserProfile.role is one of: student, teacher, admin, school_admin, organisation_admin.
AI provider configurationβ
The marking engine reads the provider from environment variables:
| Variable | Purpose |
|---|---|
AI_API_KEY | API key for the AI service |
AI_MARKING_SERVICE_URL | Endpoint URL (e.g. https://api.deepseek.com/v1/chat/completions) |
MODEL_NAME | Model name (e.g. deepseek-chat, claude-3-5-sonnet) |
The system auto-detects the provider from the URL β Anthropic uses the x-api-key header
and its message format; other providers use Authorization: Bearer and the
OpenAI-compatible format. The in-app AI assistant defaults to deepseek-v4-pro.
GitHub storage modesβ
FILE_STORAGE_MODE selects the storage backend:
LOCAL_ONLYβ local storage only (default)GITHUB_ONLYβ GitHub only, no local storageGITHUB_PRIMARYβ GitHub first, local as cacheLOCAL_PRIMARYβ local first, backup to GitHub
Deploymentβ
Docker servicesβ
services:
caliper-db: # PostgreSQL 15
caliper-redis: # Redis 7 for Celery
caliper-django: # Django (Gunicorn)
nginx: # Reverse proxy + SSL
Environment variablesβ
# Database
DB_NAME, DB_USER, DB_PASSWORD, DB_HOST, DB_PORT
# AI provider
AI_API_KEY
AI_MARKING_SERVICE_URL
MODEL_NAME
# GitHub storage
FILE_STORAGE_MODE
# Django
SECRET_KEY, DEBUG, ALLOWED_HOSTS
CORS_ALLOWED_ORIGINS
Local developmentβ
# Backend
cd backend/django_app
python manage.py runserver
# Frontend
cd frontend
npm start
# Celery worker
celery -A config worker -l info
# Redis
redis-server
Complianceβ
Supportβ
- Email: dev@caliper.restrat.co.za
- Repository: DevBitserfGit/crammed-caliper