# kaylaoneal/novel-plus-view architecture

> Architecture diagram of the GitHub repository kaylaoneal/novel-plus-view, 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/kaylaoneal/novel-plus-view
- Repository: https://github.com/kaylaoneal/novel-plus-view

## Overview

##### Project type and purpose
- This is a full-stack, multi-module Java Spring Boot “monorepo” containing several coordinated subsystems:
- novel-front: public portal + writer console
- novel-admin: platform backend management
- novel-crawl: crawler + crawl‐management UI
- novel-common: shared DTOs, mappers, caches, utilities
- templates: multiple front-end theme templates
- It implements a CMS for original novels (search, browse, read, comment, pay), plus a pluggable crawler, multi-theme templating, sharding, caching, and optional external storage (OSS).

##### File structure
- Top-level: parent pom.xml, modules directories, docker-compose.yaml.
- Each module (novel-front/admin/crawl) is a Spring Boot microservice structured in MVC layers:
- src/main/java/com/java2nb/.../controller
- service & impl
- dao/mapper (MyBatis XML)
- domain/entity
- novel-common contains shared entities, mappers (MyBatis Dynamic SQL), caching (Redis), and utilities.
- Dockerfiles & build scripts under each module’s build/docker and a root docker-compose.yaml orchestrate MySQL, Redis, and the three Spring Boot services.
- templates folder holds static Thymeleaf templates for various themes.

##### README for technical stack
- Spring Boot, Thymeleaf, MyBatis (+ Dynamic SQL + Generator), PageHelper, Sharding-JDBC
- Caching: Redis
- Auth: JWT / Spring Security / Shiro
- Storage: MySQL (sharded) + optional Aliyun OSS for media
- Packaging/Deployment: Docker & Docker Compose
- UI: Layui / Bootstrap / custom static assets in each module

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Clients
    subgraph "Clients"
        direction TB
        Browser["Web Browser (PC/WAP)"]:::client
    end

    %% Docker Compose Orchestration Boundary
    subgraph "Docker Compose Orchestration"
        direction TB
        %% novel-front Service
        subgraph "novel-front Service" 
            direction TB
            FN_APP["FrontNovelApplication"]:::service
            FN_CTRL["Controllers"]:::presentation
            FN_SVC["Services"]:::business
            FN_DAO["DAOs / Mappers"]:::data
            FN_TPL["Static Assets & Templates"]:::infra
            FN_APP --> FN_CTRL --> FN_SVC --> FN_DAO
            FN_APP --> FN_TPL
        end

        %% novel-admin Service
        subgraph "novel-admin Service"
            direction TB
            AD_APP["AdminApplication"]:::service
            AD_CROSS["Common Layer"]:::infra
            AD_CTRL["Controllers"]:::presentation
            AD_SVC["Services"]:::business
            AD_DAO["DAOs / Mappers"]:::data
            AD_TPL["Static Assets & Templates"]:::infra
            AD_APP --> AD_CROSS
            AD_APP --> AD_CTRL --> AD_SVC --> AD_DAO
            AD_APP --> AD_TPL
        end

        %% novel-crawl Service
        subgraph "novel-crawl Service"
            direction TB
            CR_APP["CrawlNovelApplication"]:::service
            CR_CORE["Crawl Core & Scheduler"]:::business
            CR_CTRL["Controllers"]:::presentation
            CR_DAO["DAOs / Mappers"]:::data
            CR_TPL["Static Assets & Templates"]:::infra
            CR_APP --> CR_CORE --> CR_CTRL --> CR_DAO
            CR_APP --> CR_TPL
        end

        %% Shared Library
        novel_common["novel-common"]:::library

        %% Data Stores
        mysql["MySQL Cluster (Sharded)"]:::database
        redis["Redis Cache"]:::cache
        oss["Aliyun OSS / FDFS"]:::external

        %% Theme Templates
        themes["Theme Templates"]:::infra
    end

    %% Data Flows
    Browser -->|"HTTP"| FN_CTRL
    Browser -->|"HTTP"| AD_CTRL
    Browser -->|"HTTP"| CR_CTRL

    FN_DAO -->|"JDBC / MyBatis"| mysql
    AD_DAO -->|"JDBC / MyBatis"| mysql
    CR_DAO -->|"JDBC / MyBatis"| mysql

    FN_SVC -->|"Cache read/write"| redis
    AD_SVC -->|"Cache read/write"| redis
    CR_CORE -->|"Cache read/write"| redis

    FN_SVC -->|"Uploads & Assets"| oss
    AD_SVC -->|"Uploads & Assets"| oss
    CR_CORE -->|"Fetch external"| oss

    FN_APP --> novel_common
    AD_APP --> novel_common
    CR_APP --> novel_common

    FN_APP --> themes

    %% Click Events
    click pom.xml "https://github.com/kaylaoneal/novel-plus-view/blob/develop_xxy/pom.xml"
    click docker-compose.yaml "https://github.com/kaylaoneal/novel-plus-view/blob/develop_xxy/docker-compose.yaml"
    click novel_common "https://github.com/kaylaoneal/novel-plus-view/tree/develop_xxy/novel-common/"
    click FN_APP "https://github.com/kaylaoneal/novel-plus-view/blob/develop_xxy/novel-front/src/main/java/com/java2nb/novel/FrontNovelApplication.java"
    click FN_CTRL "https://github.com/kaylaoneal/novel-plus-view/tree/develop_xxy/novel-front/src/main/java/com/java2nb/novel/controller/"
    click FN_SVC "https://github.com/kaylaoneal/novel-plus-view/tree/develop_xxy/novel-front/src/main/java/com/java2nb/novel/service/"
    click FN_DAO "https://github.com/kaylaoneal/novel-plus-view/tree/develop_xxy/novel-front/src/main/java/com/java2nb/novel/mapper/"
    click FN_TPL "https://github.com/kaylaoneal/novel-plus-view/tree/develop_xxy/novel-front/src/main/resources/static/"
    click novel-front "https://github.com/kaylaoneal/novel-plus-view/tree/develop_xxy/novel-front/"
    click novel-front-Dockerfile "https://github.com/kaylaoneal/novel-plus-view/tree/develop_xxy/novel-front/src/main/build/docker/Dockerfile"

    click AD_APP "https://github.com/kaylaoneal/novel-plus-view/blob/develop_xxy/novel-admin/src/main/java/com/java2nb/AdminApplication.java"
    click AD_CROSS "https://github.com/kaylaoneal/novel-plus-view/tree/develop_xxy/novel-admin/src/main/java/com/java2nb/common/"
    click AD_CTRL "https://github.com/kaylaoneal/novel-plus-view/tree/develop_xxy/novel-admin/src/main/java/com/java2nb/novel/"
    click AD_DAO "https://github.com/kaylaoneal/novel-plus-view/tree/develop_xxy/novel-admin/src/main/resources/mybatis/"
    click novel-admin "https://github.com/kaylaoneal/novel-plus-view/tree/develop_xxy/novel-admin/"
    click novel-admin-Dockerfile "https://github.com/kaylaoneal/novel-plus-view/tree/develop_xxy/novel-admin/src/main/build/docker/Dockerfile"

    click CR_APP "https://github.com/kaylaoneal/novel-plus-view/blob/develop_xxy/novel-crawl/src/main/java/com/java2nb/novel/CrawlNovelApplication.java"
    click CR_CORE "https://github.com/kaylaoneal/novel-plus-view/tree/develop_xxy/novel-crawl/src/main/java/com/java2nb/novel/core/crawl/"
    click CR_CTRL "https://github.com/kaylaoneal/novel-plus-view/tree/develop_xxy/novel-crawl/src/main/java/com/java2nb/novel/controller/"
    click CR_DAO "https://github.com/kaylaoneal/novel-plus-view/tree/develop_xxy/novel-crawl/src/main/java/com/java2nb/novel/mapper/"
    click novel-crawl "https://github.com/kaylaoneal/novel-plus-view/tree/develop_xxy/novel-crawl/"
    click novel-crawl-Dockerfile "https://github.com/kaylaoneal/novel-plus-view/tree/develop_xxy/novel-crawl/src/main/build/docker/Dockerfile"

    click themes "https://github.com/kaylaoneal/novel-plus-view/tree/develop_xxy/templates/"

    %% Styles
    classDef client fill:#f9f,stroke:#333,stroke-width:1px
    classDef presentation fill:#ccf,stroke:#333,stroke-width:1px
    classDef service fill:#cfc,stroke:#333,stroke-width:1px
    classDef business fill:#c8e6c9,stroke:#333,stroke-width:1px
    classDef data fill:#ffe0b2,stroke:#333,stroke-width:1px
    classDef database fill:#ffd54f,stroke:#333,stroke-width:1px
    classDef cache fill:#80deea,stroke:#333,stroke-width:1px
    classDef external fill:#e1bee7,stroke:#333,stroke-width:1px
    classDef infra fill:#d7ccc8,stroke:#333,stroke-width:1px
    classDef library fill:#b0bec5,stroke:#333,stroke-width:1px
```
