# caijinghong1468/containerd architecture

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

- Interactive diagram: https://gitdiagram.com/caijinghong1468/containerd
- Repository: https://github.com/caijinghong1468/containerd

## Overview

##### Project type and purpose
- SyncNote is a full-stack, real-time collaborative note-taking web application.
- The README describes three main features: user authentication, CRUD operations on notes, and live collaboration via Socket.IO.
- The file tree shows a two-container setup (Frontend + Backend) orchestrated by docker-compose, plus performance tests under k6.

##### File structure
- Top-level directories:
- Backend/ – Python FastAPI app with Socket.IO handlers, Redis caching, MongoDB persistence.
- Frontend/ – Next.js React application that calls REST endpoints and listens on a WebSocket channel.
- k6/ – Load and socket stress tests.
- docker-compose.yaml – defines service composition (frontend, backend, MongoDB, Redis).
- Key files:
- Backend/main.py – HTTP + WebSocket routes, caching logic.
- Frontend/src/services/api.ts – REST calls; socket.ts – real-time updates.

##### README for additional insights
- Architecture: FastAPI ↔ Redis ↔ MongoDB, plus Socket.IO broadcast.
- Tech stack: Python, FastAPI, Socket.IO, Redis, MongoDB, Next.js, Docker.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Actors
    Browser["Client Browser"]:::client
    k6["k6 Load Tester"]:::test

    %% Docker Composition Boundary
    subgraph "Docker-Compose" 
        direction TB
        Frontend["Next.js Frontend"]:::frontend
        Backend["FastAPI Backend\n+ Socket.IO"]:::backend
        Redis["Redis Cache"]:::cache
        Mongo["MongoDB Store"]:::db
    end

    %% Interactions
    Browser -->|"HTTP GET/POST"| Frontend
    Frontend -->|"REST /api/notes"| Backend
    Frontend <-->|"Socket.IO update_note"| Backend
    Backend -->|"GET/SET cache"| Redis
    Backend -->|"CRUD on cache-miss"| Mongo
    k6 -->|"REST or Socket.IO"| Backend

    %% Click Events
    click Browser "https://github.com/caijinghong1468/containerd/tree/main/Frontend/src/app/"
    click Frontend "https://github.com/caijinghong1468/containerd/tree/main/Frontend/"
    click Backend "https://github.com/caijinghong1468/containerd/tree/main/Backend/Dockerfile"
    click k6 "https://github.com/caijinghong1468/containerd/blob/main/k6/pressure_test.js"

    %% Styles
    classDef client fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef frontend fill:#87CEFA,stroke:#000,stroke-width:1px
    classDef backend fill:#98FB98,stroke:#000,stroke-width:1px
    classDef cache fill:#FFA500,stroke:#000,stroke-width:1px
    classDef db fill:#FF6347,stroke:#000,stroke-width:1px
    classDef test fill:#D3D3D3,stroke:#000,stroke-width:1px
```
