DDARE Docs
Backend

Backend README

Django REST and Socket.IO backend overview.

License: AGPL v3 Python

Django REST + Socket.IO backend for the Dietrich Analysis Research Education (DARE) Platform.

Table of Contents

What is DARE?

The Dietrich Analysis Research Education (DARE) Platform is an open-source, multi-LLM research and conversation platform. It provides a single, vendor-agnostic interface to OpenAI, Anthropic Claude, Google Gemini, and self-hosted LLaMA models, with file-grounded retrieval (RAG), Model Context Protocol (MCP) tool integration, visual multi-step workflows, and real-time streaming. DARE is built for researchers and institutions that need more than a chatbot — document intelligence, reproducible workflows, and per-user usage tracking in one place.

This repository is the DARE backend — the Django ASGI service that powers the platform. It handles:

  • Real-time streaming chat across providers
  • Document upload, processing, and RAG over vector stores (Pinecone, Weaviate)
  • Multi-step AI workflow execution via a visual DAG builder
  • Token usage tracking and per-user billing
  • Access-code based registration for institutional deployments
  • Inter-service authentication for partner platforms (e.g. SocraticBooks)

DARE runs standalone. The DARE backend and frontend are all you need to run the platform — nothing else is required. SocraticBooks is a separate, optional platform built on top of DARE.

Overview

Mermaid
flowchart TB
    clients["Clients\nDARE Frontend, partner frontends, mobile"]

    subgraph backend["DARE Backend (Django ASGI)"]
        auth["Auth / Users"]
        chat["Conversations + Chat"]
        files["Files / RAG"]
        workflows["Workflow Engine"]
        services["Service Layer\nLLM, vector, MCP, email"]
    end

    postgres["Postgres"]
    redis["Redis + RQ"]
    vectors["Vector Stores\nPinecone / Weaviate"]
    llms["LLM APIs\nOpenAI, Claude, Gemini"]
    ollama["Ollama\nself-hosted models"]

    clients <-->|REST + Socket.IO| backend
    auth --> postgres
    chat --> services
    files --> services
    workflows --> services
    services --> postgres
    services --> redis
    services --> vectors
    services --> llms
    services --> ollama

See docs/architecture.md for the full diagram and docs/architecture/overview.md for component-level detail.

Quick Start

Fastest path — Docker brings up the whole stack (API, worker, Postgres, Redis, Weaviate):

For local development, scripts/dev-setup.sh --demo-user does all of the below in one command (submodule init, env files, build, demo login) — see INSTALL.md.

Document generation is powered by quillmark-mcp (Typst rendering over MCP), vendored as the quillmark-mcp/ git submodule and run as a service in the compose stack.

# 1. Clone (with the quillmark-mcp submodule)
git clone --recurse-submodules https://github.com/cmudco/dare-backend.git
cd dare-backend

# 2. Configure
cp .example.env .env
# Edit .env. At minimum, set DJANGO_SECRET_KEY and one provider key
# such as OPENAI_API_KEY, CLAUDE_API_KEY, or GEMINI_API_KEY.

# 3. Build and start the backend stack
docker compose up --build -d
docker compose exec web python manage.py createsuperuser
docker compose exec web python manage.py collectstatic --noinput   # so the admin panel renders with its CSS/JS
curl http://localhost:8000/api/health/

The API is at http://localhost:8000/; Swagger UI at /api/docs/.

See QUICKSTART.md for the full walkthrough — the local-Python path, collecting static files, and creating an access code so users can register — and DEPLOYMENT.md for production and server deployment.

Documentation

DocWhat's in it
QUICKSTART.mdRun the backend locally — Docker stack, or local Python in a venv
DEPLOYMENT.mdProduction deployment — Docker and bare metal
docs/configuration.mdEvery environment variable, with type, default, and description
docs/architecture.mdComponent diagram and request flows
docs/admin-guide.mdUser/role management, access codes, analytics
CONTRIBUTING.mdIssues, pull requests, coding standards
CHANGELOG.mdRelease notes
SECURITY.mdVulnerability disclosure process
docs/integration/socraticbooks-dare-proxy.mdDARE/SocraticBooks integration contract and update rules
docs/architecture/socketio-events.mdSocket.IO event reference
docs/api/dare-backend.mdREST API reference
docs/code-standards.mdCoding conventions

Tech Stack

  • Python 3.13, Django 5.1, Django REST Framework
  • Django Channels + python-socketio for real-time streaming
  • Django RQ + Redis for background jobs
  • PostgreSQL (production) / SQLite (local dev)
  • Weaviate and Pinecone for vector storage
  • Ollama for self-hosted LLaMA models

What is included in this repo?

  • Django apps for auth/users, conversations + chat, files/RAG, and the workflow engine
  • core/services/ — the service layer (LLM providers, vector stores, MCP, email)
  • docs/ — architecture, configuration, admin, API reference, deployment, and integration guides
  • Docker Compose stack (API, RQ worker, Postgres + pgvector, Redis, Weaviate) and requirements/
  • Supporting docs — QUICKSTART.md, DEPLOYMENT.md, CONTRIBUTING.md, CHANGELOG.md, SECURITY.md, BRAND.md

What is not included in this repo?

  • dare-frontend — the React/TypeScript web client (run it separately)
  • socraticbooks-backend and socraticbooks-react — the SocraticBooks platform that proxies to DARE
  • External infrastructure you provide yourself — LLM provider API keys, an Ollama host for self-hosted models, and managed Postgres/Redis/vector-store instances in production

Stay in touch

  • Found a bug or have a feature request? Open an issue on the project's GitHub repository.
  • Questions or general inquiries? Email the project team at vks@andrew.cmu.edu.
  • Security disclosures: see SECURITY.md.

Acknowledgements

DARE is an Open Forum for AI (OFAI) initiative, Carnegie Mellon University Libraries.

The DARE name and marks are owned by Carnegie Mellon University. Use of the name, wordmark, Scotty dog mark, header lockup, and footer badge is governed by the DARE Brand Guidelines & Usage Policy, independently of the software license.

This software integrates with third-party APIs (Anthropic, OpenAI, Google, and others); use of those APIs is subject to each provider's own Terms of Service.

Contributors

DARE is built and maintained by contributors at Carnegie Mellon University and in the open-source community.

Creators

<table> <tr> <td align="center" valign="top" width="33.33%"><img src="https://ui-avatars.com/api/?name=Sayeed+Choudhury&size=100&background=162B4B&color=fff" width="100" height="100" style="border-radius:50%" alt="Sayeed Choudhury" /><br /><sub><b>Sayeed Choudhury</b></sub><br />Creator</td> <td align="center" valign="top" width="33.33%"><img src="https://raw.githubusercontent.com/cmudco/dare-backend/main/.github/assets/team/vince.png" width="100" height="100" style="border-radius:50%" alt="Vincent Sha" /><br /><sub><b>Vincent Sha</b></sub><br />Creator</td> <td align="center" valign="top" width="33.33%"><img src="https://raw.githubusercontent.com/cmudco/dare-backend/main/.github/assets/team/george.png" width="100" height="100" style="border-radius:50%" alt="George Cann" /><br /><sub><b>George Cann</b></sub><br />Creator</td> </tr> </table>

Team

<table> <tr> <td align="center" valign="top" width="33.33%"><img src="https://raw.githubusercontent.com/cmudco/dare-backend/main/.github/assets/team/carl.png" width="100" height="100" style="border-radius:50%" alt="Carl Skipper" /><br /><sub><b>Carl Skipper</b></sub><br />Contributor</td> <td align="center" valign="top" width="33.33%"><img src="https://ui-avatars.com/api/?name=Muhammad+Abdurrehman&size=100&background=162B4B&color=fff" width="100" height="100" style="border-radius:50%" alt="Muhammad Abdurrehman" /><br /><sub><b>Muhammad Abdurrehman</b></sub><br />Team Lead</td> <td align="center" valign="top" width="33.33%"><img src="https://ui-avatars.com/api/?name=Brian+Wingenroth&size=100&background=162B4B&color=fff" width="100" height="100" style="border-radius:50%" alt="Brian Wingenroth" /><br /><sub><b>Brian Wingenroth</b></sub><br />Developer</td> </tr> <tr> <td align="center" valign="top" width="33.33%"><img src="https://ui-avatars.com/api/?name=Farhat+Abbas&size=100&background=162B4B&color=fff" width="100" height="100" style="border-radius:50%" alt="Farhat Abbas" /><br /><sub><b>Farhat Abbas</b></sub><br />Developer</td> <td align="center" valign="top" width="33.33%"><img src="https://ui-avatars.com/api/?name=Hariss+M&size=100&background=162B4B&color=fff" width="100" height="100" style="border-radius:50%" alt="Hariss M." /><br /><sub><b>Hariss M.</b></sub><br />Developer</td> <td align="center" valign="top" width="33.33%"><img src="https://ui-avatars.com/api/?name=Eira+Khan&size=100&background=162B4B&color=fff" width="100" height="100" style="border-radius:50%" alt="Eira Khan" /><br /><sub><b>Eira Khan</b></sub><br />QA</td> </tr> </table>

License

This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0-only). The software license does not grant rights to the DARE name or marks; see the DARE Brand Guidelines & Usage Policy.

See the LICENSE file for the full license text, or visit <https://www.gnu.org/licenses/agpl-3.0.en.html>.

On this page