# joemccann/dillinger architecture

> Architecture diagram of the GitHub repository joemccann/dillinger, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/joemccann/dillinger
- Repository: https://github.com/joemccann/dillinger

## Overview

##### Main Components

Frontend Layer:
- AngularJS application structure with key components:
- Editor Component (Ace Editor integration)
- Preview Component
- Document Management
- Plugin Integration UI
- Zen Mode
- Export/Import Interface

Backend Layer:
- Node.js/Express Server
- Plugin System Architecture
- File Processing Services
- Authentication/Authorization

External Services Integration:
- Cloud Storage Services:
- Dropbox
- GitHub
- Google Drive
- OneDrive
- Medium
- Analytics (Google Analytics)

##### Key Relationships to Highlight

- Bidirectional data flow between editor and preview components
- Plugin communication paths
- Demonstrate file import/export workflows
- Authentication flows with external services

##### Specific Implementation Details

Use these symbols and connections:
**┌─────────────┐**
- Frontend   │ ←→ User Interface Components
- ┘

**┌─────────────┐**
- Backend   │ ←→ API Endpoints
- ┘

**┌─────────────┐**
- External   │ ←→ Third-party Services
- ┘

##### Important Architectural Patterns

- Plugin Architecture: Show how the plugin system allows for extensibility
- MVC Pattern: Demonstrate the separation of concerns in the Angular frontend
- Service-Oriented Architecture: Illustrate how external services are integrated
- Build System: Include Gulp + Webpack workflow

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles
    classDef frontend fill:#a8d1ff,stroke:#3182ce
    classDef backend fill:#9ae6b4,stroke:#38a169
    classDef external fill:#feb2b2,stroke:#e53e3e
    classDef core fill:#d6bcfa,stroke:#805ad5
    classDef service fill:#fbd38d,stroke:#dd6b20

    subgraph Frontend
        UI["User Interface"]:::frontend
        Editor["Ace Editor"]:::frontend
        Preview["Preview Component"]:::frontend
        click Preview "https://github.com/joemccann/dillinger/blob/master/public/js/components/preview.directive.js"
        DocMgmt["Document Management"]:::frontend
        click DocMgmt "https://github.com/joemccann/dillinger/blob/master/public/js/documents/documents.controller.js"
        ZenMode["Zen Mode"]:::frontend
        click ZenMode "https://github.com/joemccann/dillinger/blob/master/public/js/zen-mode/zen-mode.controller.js"
        UserMgmt["User Management"]:::frontend
        click UserMgmt "https://github.com/joemccann/dillinger/blob/master/public/js/user/user.controller.js"
        FileImport["File Import System"]:::frontend
        click FileImport "https://github.com/joemccann/dillinger/blob/master/public/js/file-import/import-file.controller.js"
        DocService["Document Services"]:::frontend
        click DocService "https://github.com/joemccann/dillinger/blob/master/public/js/services/documents.service.js"
        Layout["Editor Layout"]:::frontend
        click Layout "https://github.com/joemccann/dillinger/blob/master/views/editor.ejs"
        Styles["Styles/Theme"]:::frontend
        click Styles "https://github.com/joemccann/dillinger/blob/master/public/scss/app.scss"
    end

    subgraph Backend
        Server["Express Server"]:::backend
        click Server "https://github.com/joemccann/dillinger/blob/master/app.js"
        MarkdownCore["Markdown-it Processing"]:::core
        click MarkdownCore "https://github.com/joemccann/dillinger/blob/master/plugins/core/markdown-it.js"
        PluginCore["Plugin System Core"]:::core
        click PluginCore "https://github.com/joemccann/dillinger/blob/master/plugins/core/server.js"
        Routes["Main Routes"]:::backend
        click Routes "https://github.com/joemccann/dillinger/blob/master/routes/index.js"
        BuildSystem["Build System"]:::backend
        click BuildSystem "https://github.com/joemccann/dillinger/tree/master/gulp/tasks/"
    end

    subgraph "External Services"
        Dropbox["Dropbox Integration"]:::external
        click Dropbox "https://github.com/joemccann/dillinger/blob/master/plugins/dropbox/dropbox.js"
        GitHub["GitHub Integration"]:::external
        click GitHub "https://github.com/joemccann/dillinger/blob/master/plugins/github/github.js"
        GDrive["Google Drive Integration"]:::external
        click GDrive "https://github.com/joemccann/dillinger/blob/master/plugins/googledrive/googledrive.js"
        OneDrive["OneDrive Integration"]:::external
        click OneDrive "https://github.com/joemccann/dillinger/blob/master/plugins/onedrive/onedrive.js"
        Medium["Medium Integration"]:::external
        click Medium "https://github.com/joemccann/dillinger/blob/master/plugins/medium/medium.js"
        Analytics["Google Analytics"]:::external
        click Analytics "https://github.com/joemccann/dillinger/blob/master/plugins/googleanalytics/googleanalytics.js"
    end

    %% Frontend Relationships
    UI --> Editor
    UI --> Preview
    UI --> DocMgmt
    UI --> ZenMode
    UI --> UserMgmt
    UI --> FileImport
    Editor --> DocService
    Preview --> DocService
    DocMgmt --> DocService
    DocService --> Layout
    UI --> Styles

    %% Backend Relationships
    Server --> MarkdownCore
    Server --> PluginCore
    Server --> Routes
    BuildSystem --> Server

    %% External Service Connections
    PluginCore --> Dropbox
    PluginCore --> GitHub
    PluginCore --> GDrive
    PluginCore --> OneDrive
    PluginCore --> Medium
    Server --> Analytics

    %% Cross-layer Relationships
    DocService --> Server
    FileImport --> Server

    %% Legend
    subgraph Legend
        Frontend_L["Frontend Component"]:::frontend
        Backend_L["Backend Component"]:::backend
        External_L["External Service"]:::external
        Core_L["Core Component"]:::core
    end
```
