Django REST + Socket.IO backend for the DARE (Dietrich Analysis Research Education Platform) — a multi-LLM research and conversation platform with file processing, vector RAG, workflow automation, and real-time streaming.
DARE provides a unified backend for working with multiple large language models (OpenAI, Anthropic Claude, Google Gemini, and self-hosted LLaMA via Ollama). 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
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.
# 1. Clone
git clone <repo-url> dare-backend && 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
# 4. Create an admin user
docker compose exec web python manage.py createsuperuser
# 5. Check health
docker compose ps
curl http://localhost:8000/api/health/
curl http://localhost:8000/api/ready/The API will be available at http://localhost:8000/. The OpenAPI schema is served at http://localhost:8000/api/schema/. Swagger UI is routed at http://localhost:8000/api/docs/, but it loads Swagger assets from a CDN, so use the raw schema if the UI does not render in an offline or restricted network.
Docker Compose starts the API server, RQ worker, Postgres + pgvector, Redis, and Weaviate. Optional Ollama and Weaviate console services are available through Compose profiles. See INSTALL.md for details.
Use this path when you want the Django process running directly on your machine.
cp .example.env .env
python3.13 -m venv .venv
source .venv/bin/activate
pip install -r requirements/local.txt
python manage.py migrate
uvicorn dare.asgi:application --host 0.0.0.0 --port 8000 --reloadIn a second terminal, start a worker:
source .venv/bin/activate
OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES python -Wd manage.py rqworker default -v 3Redis must be running for Socket.IO pub/sub and background jobs. See INSTALL.md for complete Docker, local, and production guidance.
| Doc | What's in it |
|---|---|
| INSTALL.md | Full deployment guide — Docker and bare metal |
| docs/configuration.md | Every environment variable, with type, default, and description |
| docs/architecture.md | Component diagram and request flows |
| docs/admin-guide.md | User/role management, access codes, analytics |
| CONTRIBUTING.md | Issues, pull requests, coding standards |
| CHANGELOG.md | Release notes |
| SECURITY.md | Vulnerability disclosure process |
| docs/integration/socraticbooks-dare-proxy.md | DARE/SocraticBooks integration contract and update rules |
| docs/architecture/socketio-events.md | Socket.IO event reference |
| docs/api/dare-backend.md | REST API reference |
| docs/code-standards.md | Coding conventions |
- 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
This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0-only). See the LICENSE file for the full license text, or visit https://www.gnu.org/licenses/agpl-3.0.en.html.