# tushar-81/doc-connect architecture

> Architecture diagram of the GitHub repository tushar-81/doc-connect, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tushar-81/doc-connect
- Repository: https://github.com/tushar-81/doc-connect

## Overview

##### Project type and purpose
- DocConnect is a full-stack web application built on Django.
- It combines three Django “apps”—authentication (user management), docAI (automated medical report generation and visualization), and docbot (NLP-powered chatbot)—alongside a small NodeJS service (puppeteer) for PDF/HTML rendering.
- It uses Django templates, Ajax for dynamic updates, Plotly/Dash for charts, PyTorch/NLTK for ML, and Google OAuth2 for secure login.

##### File structure
- Top-level Django project in “backend/” with asgi.py, wsgi.py, settings.py, urls.py.
- Three Django apps:
- authentication/ – user login/signup, OAuth commands, templates, static CSS
- docAI/ – models for tests, views to generate reports, chart assets, Plotly/Dash code
- docbot/ – chatbot models, training script, NLTK utilities, static/chatbot templates
- Database: sqlite3 with migrations in each app.
- PuppetEE microservice in “puppeteer/” (NodeJS) likely for PDF export.
- scripts/setup.sh for environment setup; requirements.txt for Python dependencies.

##### README for additional insights
- Tech stack summary: Django, Ajax, Sqlite3, Google OAuth, Dash, Django-allauth, Plotly, PyTorch, NLTK.
- Feature breakdown: automated report generation, interactive visualizations, secure authentication, virtual assistant bot.

##### Detail without overcomplicating
- Django apps as separate modules.
- NodeJS puppeteer service as a distinct microservice.
- External OAuth2 dependency.
- Static/media file serving (templates, CSS, JS) versus dynamic API calls.
- Don’t omit the ML and visualization libraries—they’re core to docAI and docbot.

## Diagram (Mermaid)

```mermaid
flowchart TD
    classDef frontend fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef backend fill:#90EE90,stroke:#000,stroke-width:1px
    classDef ml fill:#FFA500,stroke:#000,stroke-width:1px
    classDef micro fill:#D3D3D3,stroke:#000,stroke-width:1px
    classDef database fill:#FFE4B5,stroke:#000,stroke-width:1px
    classDef external fill:#D8BFD8,stroke:#000,stroke-width:1px

    subgraph "Client Layer"
        B["Web Browser"]:::frontend
    end

    subgraph "Server Layer"
        subgraph "Django Core"
            CoreASGI["ASGI/WSGI"]:::backend
            CoreSettings["Settings"]:::backend
            CoreURLs["URLs Router"]:::backend
        end

        subgraph "Authentication Service"
            AuthViews["authentication/views.py"]:::backend
            AuthURLs["authentication/urls.py"]:::backend
            AuthTemplates["Templates"]:::backend
            AuthStatic["Static CSS"]:::backend
            AuthMgmt["Management Commands"]:::backend
        end

        subgraph "docAI Service"
            docAIModels["docAI/models.py"]:::ml
            docAIData["docAI/data.py"]:::ml
            docAIViews["docAI/views.py"]:::backend
            docAIURLs["docAI/urls.py"]:::backend
            Plotter["docAI/plotter.py"]:::ml
            LayoutPlot["docAI/layout_plotter.py"]:::ml
            SimpleExample["docAI/simpleexample.py"]:::ml
            docAIAssets["Assets"]:::backend
            docAIStatic["Static CSS"]:::backend
            docAITemplates["Templates"]:::backend
        end

        subgraph "docbot Service"
            ChatPy["docbot/chat.py"]:::ml
            Train["docbot/train.py"]:::ml
            Model1["docbot/model1.py"]:::ml
            NLPUtils["docbot/nltk_utils.py"]:::ml
            Intents["docbot/intents.json"]:::ml
            Models["docbot/models.py"]:::ml
            DataPth["docbot/data.pth"]:::ml
            docbotViews["docbot/views.py"]:::backend
            docbotURLs["docbot/urls.py"]:::backend
            docbotTemplates["Templates"]:::backend
            docbotStatic["Static Assets"]:::backend
        end

        subgraph "PDF Microservice"
            PuppIndex["index.js"]:::micro
            PuppPkg["package.json"]:::micro
            PuppLock["package-lock.json"]:::micro
        end

        DB["SQLite3 Database"]:::database

        Setup["scripts/setup.sh"]:::backend
        Req["requirements.txt"]:::backend
    end

    ExternalGoogle["Google OAuth2"]:::external

    B -->|"HTTP/HTTPS (GET/POST, Ajax)"| CoreASGI
    CoreASGI --> CoreSettings
    CoreASGI --> CoreURLs
    CoreASGI --> AuthViews
    CoreASGI --> docAIViews
    CoreASGI --> docbotViews
    CoreASGI --> PuppIndex

    AuthViews --> AuthURLs
    AuthViews --> ExternalGoogle
    AuthViews --> DB
    AuthViews --> AuthTemplates
    AuthViews --> AuthStatic
    AuthViews --> AuthMgmt

    docAIViews --> docAIModels
    docAIViews --> docAIData
    docAIViews --> Plotter
    docAIViews --> LayoutPlot
    docAIViews --> SimpleExample
    docAIViews --> docAIAssets
    docAIViews --> docAIStatic
    docAIViews --> docAITemplates
    docAIViews --> DB
    docAIViews -->|"Ajax/HTTP"| B

    docbotViews --> ChatPy
    docbotViews --> Train
    docbotViews --> Model1
    docbotViews --> NLPUtils
    docbotViews --> Intents
    docbotViews --> Models
    docbotViews --> DataPth
    docbotViews --> docbotTemplates
    docbotViews --> docbotStatic
    docbotViews --> DB
    docbotViews -->|"Ajax/HTTP"| B

    PuppIndex --> PuppPkg
    PuppIndex --> PuppLock
    PuppIndex --> DB
    PuppIndex -->|"PDF Generation"| CoreASGI
    PuppIndex -->|"PDF"| B

    Setup --> CoreSettings
    Setup --> Req

    class CoreASGI,CoreSettings,CoreURLs,AuthViews,AuthURLs,docAIViews,docAIURLs,docbotViews,docbotURLs backend
    class B frontend
    class ExternalGoogle external
    class DB database
    class ChatPy,Train,Model1,NLPUtils,Intents,Models,DataPth,docAIModels,docAIData,Plotter,LayoutPlot,SimpleExample ml
    class PuppIndex,PuppPkg,PuppLock micro

    click CoreASGI "https://github.com/tushar-81/doc-connect/blob/master/backend/asgi.py"
    click CoreSettings "https://github.com/tushar-81/doc-connect/blob/master/backend/settings.py"
    click CoreURLs "https://github.com/tushar-81/doc-connect/blob/master/backend/urls.py"
    click AuthViews "https://github.com/tushar-81/doc-connect/blob/master/authentication/views.py"
    click AuthURLs "https://github.com/tushar-81/doc-connect/blob/master/authentication/urls.py"
    click AuthTemplates "https://github.com/tushar-81/doc-connect/tree/master/authentication/templates/authentication/"
    click AuthStatic "https://github.com/tushar-81/doc-connect/tree/master/authentication/static/authentication/css/"
    click AuthMgmt "https://github.com/tushar-81/doc-connect/tree/master/authentication/management/commands/"
    click docAIModels "https://github.com/tushar-81/doc-connect/blob/master/docAI/models.py"
    click docAIData "https://github.com/tushar-81/doc-connect/blob/master/docAI/data.py"
    click docAIViews "https://github.com/tushar-81/doc-connect/blob/master/docAI/views.py"
    click docAIURLs "https://github.com/tushar-81/doc-connect/blob/master/docAI/urls.py"
    click Plotter "https://github.com/tushar-81/doc-connect/blob/master/docAI/plotter.py"
    click LayoutPlot "https://github.com/tushar-81/doc-connect/blob/master/docAI/layout_plotter.py"
    click SimpleExample "https://github.com/tushar-81/doc-connect/blob/master/docAI/simpleexample.py"
    click docAIAssets "https://github.com/tushar-81/doc-connect/tree/master/docAI/assets/"
    click docAIStatic "https://github.com/tushar-81/doc-connect/tree/master/docAI/static/docAI/"
    click docAITemplates "https://github.com/tushar-81/doc-connect/tree/master/docAI/templates/docAI/"
    click ChatPy "https://github.com/tushar-81/doc-connect/blob/master/docbot/chat.py"
    click Train "https://github.com/tushar-81/doc-connect/blob/master/docbot/train.py"
    click Model1 "https://github.com/tushar-81/doc-connect/blob/master/docbot/model1.py"
    click NLPUtils "https://github.com/tushar-81/doc-connect/blob/master/docbot/nltk_utils.py"
    click Intents "https://github.com/tushar-81/doc-connect/blob/master/docbot/intents.json"
    click Models "https://github.com/tushar-81/doc-connect/blob/master/docbot/models.py"
    click DataPth "https://github.com/tushar-81/doc-connect/blob/master/docbot/data.pth"
    click docbotViews "https://github.com/tushar-81/doc-connect/blob/master/docbot/views.py"
    click docbotURLs "https://github.com/tushar-81/doc-connect/blob/master/docbot/urls.py"
    click docbotTemplates "https://github.com/tushar-81/doc-connect/tree/master/docbot/templates/docbot/"
    click docbotStatic "https://github.com/tushar-81/doc-connect/tree/master/docbot/static/docbot/"
    click PuppIndex "https://github.com/tushar-81/doc-connect/blob/master/puppeteer/index.js"
    click PuppPkg "https://github.com/tushar-81/doc-connect/blob/master/puppeteer/package.json"
    click PuppLock "https://github.com/tushar-81/doc-connect/blob/master/puppeteer/package-lock.json"
    click Setup "https://github.com/tushar-81/doc-connect/blob/master/scripts/setup.sh"
    click Req "https://github.com/tushar-81/doc-connect/blob/master/requirements.txt"
```
