How anushkag21/legal-aid-advisor works
Purpose and top-level shape
This repository appears to be a legal-services application centered on a Django site, with separate UI areas for chat, legal knowledge, cases, lawyers, courts, and booking. It also contains a standalone legal-document summarizer service/prototype. The README provides no operational documentation, so behavior must be inferred from layout.
Primary entry points
• Django management and deployment entry points: manage.py, chatbot_project/wsgi.py, chatbot_project/asgi.py.
• Django configuration and root URL composition: chatbot_project/settings.py, chatbot_project/urls.py.
• The document summarizer has independent Python application entry points: Legal_summarizer/Legal_summarizer/app3.py and Legal_summarizer/Legal_summarizer/app4.py.
Django application shell and routing
The chatbot_project package is the host runtime. It configures installed applications, middleware, static handling, database, and URL routing; individual feature apps are expected to attach their routes under the project URL configuration.
• chatbot_project/settings.py
• chatbot_project/urls.py
• chatbot_project/asgi.py
Control flow is standard Django: HTTP request → root router → app router → view → template or response. Both WSGI and ASGI endpoints are present, allowing conventional synchronous deployment and an ASGI-capable server.
Frontend feature application
The frontend Django app owns the primary server-rendered legal-services experience. Its views and URL module connect pages to templates, while feature-specific browser JavaScript and CSS implement client behavior.
• frontend/urls.py
• frontend/views.py
• frontend/templates/index.html
Major presentation boundaries include booking, case, court, legal knowledge, lawyer, chat, and sign-in pages. Assets are organized by feature, e.g. frontend/static/js/booking.js, frontend/static/js/chat.js, and frontend/static/css/knowledge.css. This indicates browser behavior is primarily page-specific rather than a separately built SPA.
Chatbot application
The chatbot Django app isolates chat-specific request handling, persistence definitions, and routing from the broader frontend application.
• chatbot/urls.py
• chatbot/views.py
• chatbot/models.py
Its expected flow is chat-page/client JavaScript invoking chatbot routes, with views processing requests and potentially reading or writing chat-domain models. The available tree does not identify a specific LLM provider or remote chatbot service, so integrations should be verified in source before planning changes.
Legal document summarization subsystem
Legal_summarizer/Legal_summarizer is a separate Python subsystem with its own dependency manifest, environment file, static HTML, and upload workspace. It likely receives or selects a legal PDF, processes it through one of the app scripts, and presents a summary through static pages.
• Legal_summarizer/Legal_summarizer/app3.py
• Legal_summarizer/Legal_summarizer/app4.py
• Legal_summarizer/Legal_summarizer/uploads/legal_documnet.pdf
This subsystem is architecturally separate from Django: no shared package or route linkage is evident in the tree. Its upload directory is a filesystem boundary and should be treated as untrusted input/storage.
Persistence, static delivery, and operational boundaries
Django currently uses a checked-in SQLite database, indicating local or prototype-oriented persistence. App migrations exist but no generated migration files are shown beyond initialization.
• db.sqlite3
• frontend/models.py
• chatbot/models.py
Source static assets live under frontend/static/; staticfiles/ is a collected static-output tree, including Django admin and app assets. The summarizer independently serves/uses Legal_summarizer/Legal_summarizer/static/. Environment files at root, chatbot, and summarizer levels suggest secrets or provider configuration may be split across subsystems; they should not be relied upon as a unified configuration model.
Main entry points: chatbot_project/urls.py Root URL router · settings.py Project configuration · views.py Legal-services views · chatbot/urls.py Chat routes
Components 17
Django legal-services site
- Django entry points · Management, WSGI, and ASGI deployment entry points.
manage.py - Project configuration · Settings and root URL composition.
chatbot_project/settings.py - Root URL router
chatbot_project/urls.py - ASGI endpoint
chatbot_project/asgi.py - WSGI endpoint
chatbot_project/wsgi.py - Frontend routes
frontend/urls.py - Legal-services views · Renders booking, cases, courts, knowledge, lawyers, chat, and sign-in pages.
frontend/views.py - Page templates
frontend/templates/index.html - Feature static assets · Page-specific browser behavior and styling.
- Chat routes
chatbot/urls.py - Chat handlers
chatbot/views.py - Domain models · Frontend and chat persistence definitions.
frontend/models.py - SQLite database · Checked-in prototype-oriented database.
db.sqlite3
Document summarizer
Standalone Python subsystem.
- Summarizer applications · Independent legal-document processing entry points.
Legal_summarizer/Legal_summarizer/app3.py - Summarizer static UI
- PDF upload workspace · Untrusted document input and storage boundary.
Legal_summarizer/Legal_summarizer/uploads/legal_documnet.pdf
Other components
- Browser · Server-rendered pages with feature-specific JavaScript.
Connections 19
- Django entry points → Project configuration: loads
- ASGI endpoint → Project configuration: loads
- WSGI endpoint → Project configuration: loads
- Project configuration → Root URL router: configures
- Browser → Root URL router: HTTP request
- Root URL router → Frontend routes: dispatches
- Root URL router → Chat routes: dispatches
- Frontend routes → Legal-services views: maps to
- Legal-services views → Page templates: renders
- Page templates → Browser: HTML response
- Feature static assets → Browser: served to
- Browser → Chat routes: chat requests
- Chat routes → Chat handlers: maps to
- Legal-services views → Domain models: uses
- Chat handlers → Domain models: reads and writes
- Domain models → SQLite database: persists in
- Browser → Summarizer static UI: uses independently
- Summarizer static UI → Summarizer applications: invokes
- Summarizer applications → PDF upload workspace: reads document