# dennislwm/archiveso architecture

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

- Interactive diagram: https://gitdiagram.com/dennislwm/archiveso
- Repository: https://github.com/dennislwm/archiveso

## Overview

##### Main Components

a) Frontend Layer:
- Lowdefy-based static frontend (hosted on Netlify)
- Auth0 authentication integration
- Components structure (requests, user avatar)
- Pages structure (home, login, profile, etc.)

b) Backend Layer:
- Python Flask server
- ArchiveBox integration
- HTTP Basic Authentication
- Docker containerization

c) External Services:
- Auth0 (OpenID Connect provider)
- MongoDB cluster
- Docker Hub (for image storage)
- Cloudflare Tunnel
- CircleCI (CI pipeline)

**[Client Tier]**
- ↓ ↑
**[Application Tier]**
- ↓ ↑
**[External Services Tier]**

##### Component Relationships

- User requests (→): Frontend to Backend
- Authentication flows (⇢): Frontend to Auth0
- Data persistence (↔): Backend to MongoDB
- CI/CD flows (⇢): Source to CircleCI to Docker Hub
- Deployment paths (→): Docker Hub to Production

##### Specific Implementation Details

- Frontend hosted on Netlify connecting to Auth0 for authentication
- Cloudflare Tunnel securing the connection to the Python Flask backend
- Docker container running the Flask application
- CircleCI pipeline flow for testing and deployment
- MongoDB integration for data persistence

##### Additional Elements

Important aspects:
- Load balancers where applicable
- Environment separation (development/production)
- Monitoring points

**[Netlify Static Host] → [Lowdefy Frontend] ⇢ [Auth0]**
- ↓
**[Cloudflare Tunnel]**
- ↓
**[Docker Container: Flask Server] → [ArchiveBox]**
- ↓
**[MongoDB Cluster]**

**CI/CD Pipeline:**
**[GitHub] → [CircleCI] → [Docker Hub]**

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        Frontend["Lowdefy Frontend"]:::frontend
        Auth0Client["Auth0 Integration"]:::auth
        Components["Frontend Components"]:::frontend
        Pages["Frontend Pages"]:::frontend
    end

    subgraph Server
        Flask["Python Flask Server"]:::backend
        ArchiveBox["ArchiveBox Integration"]:::backend
        BasicAuth["HTTP Basic Auth"]:::auth
        Docker["Docker Container"]:::infra
    end

    subgraph External
        Auth0["Auth0 Service"]:::auth
        MongoDB["MongoDB Cluster"]:::database
        DockerHub["Docker Hub"]:::infra
        CloudflareTunnel["Cloudflare Tunnel"]:::infra
        CircleCI["CircleCI Pipeline"]:::cicd
    end

    Frontend --> |"User Requests"| CloudflareTunnel
    Frontend --> |"Auth"| Auth0Client
    Auth0Client --> Auth0
    CloudflareTunnel --> BasicAuth
    BasicAuth --> Flask
    Flask --> ArchiveBox
    Flask --> MongoDB
    
    CircleCI --> DockerHub
    DockerHub --> Docker
    Docker --> Flask

    %% Component Mappings
    click Frontend "https://github.com/dennislwm/archiveso/blob/main/front/lowdefy.yaml"
    click Auth0Client "https://github.com/dennislwm/archiveso/blob/main/front/auth0/loginRule.js"
    click Components "https://github.com/dennislwm/archiveso/tree/main/front/components"
    click Pages "https://github.com/dennislwm/archiveso/tree/main/front/pages"
    click Flask "https://github.com/dennislwm/archiveso/blob/main/app/main.py"
    click ArchiveBox "https://github.com/dennislwm/archiveso/blob/main/app/src/archiveso/clsArchiveso.py"
    click Docker "https://github.com/dennislwm/archiveso/tree/main/app/Dockerfile"
    click CircleCI "https://github.com/dennislwm/archiveso/blob/main/.circleci/config.yml"

    %% Styling
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef backend fill:#2ecc71,stroke:#27ae60,color:white
    classDef auth fill:#f1c40f,stroke:#f39c12,color:black
    classDef database fill:#9b59b6,stroke:#8e44ad,color:white
    classDef infra fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef cicd fill:#e74c3c,stroke:#c0392b,color:white

    %% Legend
    subgraph Legend
        Frontend_L["Frontend"]:::frontend
        Backend_L["Backend"]:::backend
        Auth_L["Auth"]:::auth
        DB_L["Database"]:::database
        Infra_L["Infrastructure"]:::infra
        CICD_L["CI/CD"]:::cicd
    end
```
