# crazyjson/taskmanager architecture

> Architecture diagram of the GitHub repository crazyjson/taskmanager, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/crazyjson/taskmanager
- Repository: https://github.com/crazyjson/taskmanager

## Overview

##### Project type and purpose
- From the README and file tree, this is a .NET-based Task Management Platform built on Quartz.NET.
- It provides a scheduler engine (Windows Service or Console Host), a web-based UI (ASP.NET MVC “TaskManagerWeb”), a set of reusable libraries (data access, utilities, messaging), and a collection of Quartz jobs (in Mysoft.Task).
- The system’s purpose is to let teams define, schedule, execute and monitor recurring jobs; send notifications on job outcomes; and view/edit configuration via a UI.

##### File structure
Top-level projects (logical modules):
- Dapper.SimpleCRUD – lightweight ORM helper.
- TaskManagerWeb – ASP.NET MVC front-end (Views, Scripts, CSS, Modules folder with Nancy modules).
- YwdSoft.ConsoleHosting – standalone console host for tasks (uses a local SQLite DB).
- YwdSoft.WindowService – Windows Service wrapper around the scheduler engine (batch scripts & installer).
- Ywdsoft.Task – core Quartz.NET integration: reads TaskConfig.xml, loads IJob implementations (TaskSet folder).
- Ywdsoft.Service & Ywdsoft.MessageTransmit – specialized service libraries (e.g. HTTP, messaging, RabbitMQ, email) that jobs may call.
- Ywdsoft.Model – domain entities (DB tables, RabbitMQ message classes).
- Ywdsoft.Utility – cross-cutting services: configuration manager, data-access (DapperHelper, DB XML), logging, Excel import, RabbitMQ client, Quartz helper, etc.
- Ywdsoft.XmlCommand – XML-based command tool for DB generation/maintenance.

You also see config files (app.config, packages.config) in each project showing dependencies (e.g., Quartz.NET, log4net, RabbitMQ.Client).

##### Reading the README for additional insights
- The architecture calls out six “projects” (engine, UI, Windows Service installer, utilities, data/model, messaging).
- Tasks are added by dropping a class into Mysoft.Task.TaskSet and updating TaskConfig.xml.
- Installation uses WSWinForm.exe or batch scripts to install the Windows Service.
- Three built-in jobs: IP proxy crawler, Express-progress checker (with email notifications), and message notifier (poll messages table every 3 minutes).

##### Final advice
- Every logical boundary: UI vs. engine vs. utilities vs. external services.
- Shared libraries under a “Shared Utilities” boundary.
- Don’t forget the installation tooling: WSWinForm.exe and batch scripts as a Deployment artifact.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Deployment Hosts
    subgraph "IIS Host"
        UI["TaskManagerWeb (ASP.NET MVC)"]:::presentation
        Nancy["Nancy Modules"]:::presentation
        UI --> Nancy
        UI --> Utility
        UI --> Model
        UI --> Dapper
    end

    subgraph "Service Host - Windows Service"
        WS["Ywdsoft.WindowService"]:::application
        WS --> TE
        WS --> Utility
        WS --> Model
    end

    subgraph "Service Host - Console Host"
        CH["YwdSoft.ConsoleHosting"]:::application
        CH --> TE
        CH --> Utility
        CH --> Model
    end

    %% Core Engine
    subgraph "Task Engine"
        TE["Ywdsoft.Task\n(Quartz Scheduler)"]:::application
        TE --> JobSet
        TE --> Config
    end

    JobSet["Job Implementations\n(Mysoft.Task.TaskSet)"]:::application
    Config["TaskConfig.xml"]:::application

    %% Shared Libraries
    subgraph "Shared Utilities"
        Utility["Ywdsoft.Utility"]:::utility
        Dapper["Dapper.SimpleCRUD"]:::utility
    end

    %% Service Libraries
    subgraph "Service Libraries"
        SL1["YwdSoft.Service"]:::application
        SL2["Ywdsoft.MessageTransmit"]:::application
    end

    %% Tools
    XmlCmd["Ywdsoft.XmlCommand\n(XML Command Tool)"]:::utility

    %% Domain Model
    Model["Ywdsoft.Model"]:::data

    %% Data Stores and External Services
    DB["SQL Server\n(SQLite for Console)"]:::data
    SMTP["SMTP Server"]:::external
    MQ["RabbitMQ Broker"]:::external

    %% Data Flows
    UI -->|"CRUD via Dapper/Utility"| DB
    WS -->|"schedules jobs"| TE
    CH -->|"schedules jobs"| TE
    JobSet -->|"uses utilities"| Utility
    JobSet -->|"accesses domain entities"| Model
    JobSet -->|"calls service libs"| SL1
    JobSet -->|"uses messaging/email"| SL2
    JobSet -->|"publishes/consumes"| MQ
    JobSet -->|"logs/results"| DB
    SL2 -->|"sends emails"| SMTP
    Config -->|"defines cron jobs"| TE
    XmlCmd -->|"DB scripts"| DB

    %% Click Events
    click UI "https://github.com/crazyjson/taskmanager/tree/master/TaskManagerWeb/"
    click WS "https://github.com/crazyjson/taskmanager/tree/master/Ywdsoft.WindowService/"
    click CH "https://github.com/crazyjson/taskmanager/tree/master/YwdSoft.ConsoleHosting/"
    click TE "https://github.com/crazyjson/taskmanager/tree/master/Ywdsoft.Task/"
    click Utility "https://github.com/crazyjson/taskmanager/tree/master/Ywdsoft.Utility/"
    click Dapper "https://github.com/crazyjson/taskmanager/tree/master/Dapper.SimpleCRUD/"
    click SL1 "https://github.com/crazyjson/taskmanager/tree/master/YwdSoft.Service/"
    click SL2 "https://github.com/crazyjson/taskmanager/tree/master/Ywdsoft.MessageTransmit/"
    click Model "https://github.com/crazyjson/taskmanager/tree/master/Ywdsoft.Model/"
    click XmlCmd "https://github.com/crazyjson/taskmanager/tree/master/Ywdsoft.XmlCommand/"

    %% Styles
    classDef presentation fill:#cfe2f3,stroke:#6fa8dc,stroke-width:1px
    classDef application fill:#d9ead3,stroke:#6aa84f,stroke-width:1px
    classDef utility fill:#fff2cc,stroke:#bf9000,stroke-width:1px
    classDef data fill:#f9cb9c,stroke:#e69138,stroke-width:1px
    classDef external fill:#d0d0d0,stroke:#828282,stroke-width:1px
```
