LegalA Moroccan law firm
One platform to manage cases, draft court documents and query Moroccan law
Context
The firm tracked its cases, hearings and documents across several tools, with a lot of manual work: re-typing information, drafting court documents from templates, and regularly checking the courts’ portal for progress on each case.
What we built
Case management
A web application brings clients, cases, hearings and documents together, with role-based access. It runs on Django 5.2 and PostgreSQL 17; long-running work goes through Celery and Redis.
Automatic court documents
Court documents are generated as .docx and .pdf from the case data, ready for review and filing.
JuristAI, the legal assistant
A French and Arabic assistant answers legal questions from a corpus of Moroccan law. The RAG pipeline combines vector search (pgvector) with Cohere reranking, calls several LLM providers with automatic fallback, and cites the texts it relies on. Lawyers use it through a React/Vite chat widget built into the platform.
Automated monitoring of court decisions
A dedicated service regularly polls Mahakim, the Moroccan courts’ portal, and flags new decisions and status changes on tracked cases.
Operations
Everything runs as Docker Compose containers behind Caddy, which handles HTTPS automatically. Every change is checked by GitHub Actions CI and then deployed automatically by Watchtower.