# fermansky/rusdocsdownloader architecture

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

- Interactive diagram: https://gitdiagram.com/fermansky/rusdocsdownloader
- Repository: https://github.com/fermansky/rusdocsdownloader

## Overview

##### Main Components
- Backend (Go):
- Key source files include main.go, app.go, downloader.go, pdf.go, scraper.go, update.go.
- The Go code contains business logic and integrations. The go.mod and go.sum files indicate module dependencies, while wails.json configures the overall project.
- Frontend (Vue):
- The frontend directory holds the Vue source code (e.g., App.vue, HelloWorld.vue, main.js).
- It includes assets, configuration (vite.config.js), and package management files (package.json, package-lock.json).
- Wails Bridge/Integration:
- The integration mechanism that allows the Vue frontend to call Go backend methods.
- This interoperation is crucial for live development (via wails dev) and production builds.

##### Component Relationships and Interactions
- Frontend → Backend:
- Configuration and Build Process:
- That wails.json configures the project settings.
- External Dependencies:

##### Architectural Patterns and Design Principles
- Separation of Concerns:
- Modularization:
- The file structure splits code into modules (Vue components in the frontend/src folder and multiple Go files for backend logic).
- Build and Deployment Separation:

##### Technologies, Frameworks, and Libraries
- Wails: Indicate this as the integration and runtime framework that bridges Vue and Go.
- Vue: Used for building the user interface.
- Vite: For fast development and hot reloading of the frontend.
- Go: The language for backend logic including scraping, updating, downloading, and PDF processing.
- Node/NPM: For managing JavaScript packages as seen in package.json and package-lock.json.

##### Final Recommendations
- Be detailed: Even if it means separating the project into fine-grained components, capture every essential file group and connection.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Frontend (Vue with Vite)"
        FE1["App.vue (Main UI)"]:::frontend
        FE2["HelloWorld.vue (Sample Component)"]:::frontend
        FE3["main.js (Entry Point)"]:::frontend
        FE4["index.html (HTML Entry)"]:::frontend
        FE5["vite.config.js (Vite Configuration)"]:::frontend
        FE6["package.json (Dependencies)"]:::frontend
        FE7["package-lock.json (Package Lock)"]:::frontend
    end

    subgraph "Backend (Go)"
        BE1["main.go (Entry Point)"]:::backend
        BE2["app.go (Business Logic)"]:::backend
        BE3["downloader.go (Downloader Module)"]:::backend
        BE4["pdf.go (PDF Processing)"]:::backend
        BE5["scraper.go (Web Scraping)"]:::backend
        BE6["update.go (Update Module)"]:::backend
        BE7["go.mod (Module Dependency)"]:::backend
        BE8["go.sum (Module Checksum)"]:::backend
    end

    Config["wails.json (Project Configuration)"]:::config

    Config -->|"configures"| FE1
    Config -->|"configures"| BE1
    FE1 -->|"WailsBridgeRPC"| BE1

    classDef frontend fill:#cce5ff,stroke:#004085,stroke-width:2px;
    classDef backend fill:#d4edda,stroke:#155724,stroke-width:2px;
    classDef config fill:#fff3cd,stroke:#856404,stroke-width:2px;

    click FE1 "https://github.com/fermansky/rusdocsdownloader/blob/master/frontend/src/App.vue"
    click FE2 "https://github.com/fermansky/rusdocsdownloader/blob/master/frontend/src/HelloWorld.vue"
    click FE3 "https://github.com/fermansky/rusdocsdownloader/blob/master/frontend/src/main.js"
    click FE4 "https://github.com/fermansky/rusdocsdownloader/blob/master/frontend/index.html"
    click FE5 "https://github.com/fermansky/rusdocsdownloader/blob/master/frontend/vite.config.js"
    click FE6 "https://github.com/fermansky/rusdocsdownloader/blob/master/frontend/package.json"
    click FE7 "https://github.com/fermansky/rusdocsdownloader/blob/master/frontend/package-lock.json"
    click BE1 "https://github.com/fermansky/rusdocsdownloader/blob/master/main.go"
    click BE2 "https://github.com/fermansky/rusdocsdownloader/blob/master/app.go"
    click BE3 "https://github.com/fermansky/rusdocsdownloader/blob/master/downloader.go"
    click BE4 "https://github.com/fermansky/rusdocsdownloader/blob/master/pdf.go"
    click BE5 "https://github.com/fermansky/rusdocsdownloader/blob/master/scraper.go"
    click BE6 "https://github.com/fermansky/rusdocsdownloader/blob/master/update.go"
    click BE7 "https://github.com/fermansky/rusdocsdownloader/blob/master/go.mod"
    click BE8 "https://github.com/fermansky/rusdocsdownloader/blob/master/go.sum"
    click Config "https://github.com/fermansky/rusdocsdownloader/blob/master/wails.json"
```
