# eleven-trading/tradenote architecture

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

- Interactive diagram: https://gitdiagram.com/eleven-trading/tradenote
- Repository: https://github.com/eleven-trading/tradenote

## Overview

##### Main Components Identification

a. Frontend Layer (Vue.js Application):
- User Interface Components (/src/components)
- Views (/src/views)
- Stores (Vuex) (/src/stores)
- Utils (/src/utils)

b. Backend Services:
- MongoDB Database
- Parse Server (implied from environment variables)
- Docker Container System

**[Client Layer]**

- Web Browser
- Vue.js Frontend Components
- Authentication (Login/Register)
- Trading Components
- Dashboard
- Calendar
- Trade Management
- Analytics
- Asset Management
- Screenshots
- Diary

**[Application Layer]**

- Docker Container
- Parse Server
- Trade Processing
- User Management
- Data Validation

- API Endpoints
- Authentication
- Trade Operations
- Asset Management

**[Data Layer]**

- MongoDB
- User Data
- Trade Records
- Screenshots
- Trading Diary

##### Key Relationships to Highlight

- User authentication flow
- Trade data import/export paths
- Data persistence flows
- API communication paths
- Docker container interactions

##### Implementation Details

- Use standardized UML or C4 model notation
- Version information
- Document environment variables
- Scaling capabilities

##### Additional Elements

- Deployment configuration
- Backup processes (reference to backup-mongodb.sh)
- Broker integration points
- Monitoring and logging paths

- Component interaction
- Data flow
- Security boundaries
- Scalability points
- Integration interfaces

Remember to include notes about:
- Docker compose deployment options
- MongoDB configuration requirements
- Environment variable dependencies
- Broker integration requirements

This system design should help developers understand both the overall architecture and the specific implementation details of TradeNote while maintaining clarity and usefulness for future development and maintenance.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        Browser["Web Browser"]
        subgraph VueFrontend["Vue.js Frontend"]
            direction TB
            Auth["Authentication"]:::frontend
            Nav["Navigation"]:::frontend
            
            subgraph Trading["Trading Components"]
                direction TB
                Dashboard["Dashboard"]:::frontend
                Calendar["Calendar View"]:::frontend
                AddTrades["Trade Management"]:::frontend
                Daily["Daily View"]:::frontend
            end
            
            subgraph Assets["Asset Management"]
                direction TB
                Screenshots["Screenshots"]:::frontend
                Diary["Trading Diary"]:::frontend
            end
            
            Store["Global Store"]:::frontend
            Router["Router"]:::frontend
            
            subgraph Utils["Utility Functions"]
                direction TB
                TradeUtils["Trade Processing"]:::frontend
                CalendarUtils["Calendar Functions"]:::frontend
                ScreenshotUtils["Screenshot Utils"]:::frontend
                DiaryUtils["Diary Utils"]:::frontend
            end
        end
    end
    
    subgraph Application["Application Layer"]
        direction TB
        Docker["Docker Container"]:::service
        ParseServer["Parse Server"]:::service
        
        subgraph API["API Endpoints"]
            direction TB
            AuthAPI["Authentication API"]:::api
            TradeAPI["Trade Operations API"]:::api
            AssetAPI["Asset Management API"]:::api
        end
    end
    
    subgraph Data["Data Layer"]
        direction TB
        MongoDB[(MongoDB Database)]:::database
        subgraph Collections["Collections"]
            direction TB
            Users[(User Data)]:::database
            Trades[(Trade Records)]:::database
            Assets[(Screenshots)]:::database
            DiaryEntries[(Trading Diary)]:::database
        end
        Backup["Backup Process"]:::service
    end
    
    %% Relationships
    Browser --> VueFrontend
    Auth --> AuthAPI
    Trading --> TradeAPI
    Assets --> AssetAPI
    API --> ParseServer
    ParseServer --> MongoDB
    MongoDB --> Backup
    
    %% Click Events
    click Auth "https://github.com/Eleven-Trading/TradeNote/blob/main//src/components/LoginRegister.vue"
    click Nav "https://github.com/Eleven-Trading/TradeNote/blob/main//src/components/Nav.vue"
    click Calendar "https://github.com/Eleven-Trading/TradeNote/blob/main//src/components/Calendar.vue"
    click Dashboard "https://github.com/Eleven-Trading/TradeNote/blob/main//src/views/Dashboard.vue"
    click AddTrades "https://github.com/Eleven-Trading/TradeNote/blob/main//src/views/AddTrades.vue"
    click Daily "https://github.com/Eleven-Trading/TradeNote/blob/main//src/views/Daily.vue"
    click Screenshots "https://github.com/Eleven-Trading/TradeNote/blob/main//src/views/Screenshots.vue"
    click Diary "https://github.com/Eleven-Trading/TradeNote/blob/main//src/views/Diary.vue"
    click Store "https://github.com/Eleven-Trading/TradeNote/blob/main//src/stores/globals.js"
    click TradeUtils "https://github.com/Eleven-Trading/TradeNote/blob/main//src/utils/trades.js"
    click CalendarUtils "https://github.com/Eleven-Trading/TradeNote/blob/main//src/utils/calendar.js"
    click ScreenshotUtils "https://github.com/Eleven-Trading/TradeNote/blob/main//src/utils/screenshots.js"
    click DiaryUtils "https://github.com/Eleven-Trading/TradeNote/blob/main//src/utils/diary.js"
    click Docker "https://github.com/Eleven-Trading/TradeNote/tree/main//docker/Dockerfile"
    click Backup "https://github.com/Eleven-Trading/TradeNote/blob/main//backup-mongodb.sh"
    click Router "https://github.com/Eleven-Trading/TradeNote/blob/main//src/router/index.js"
    
    %% Styles
    classDef frontend fill:#2196F3,color:white
    classDef service fill:#4CAF50,color:white
    classDef api fill:#FF9800,color:white
    classDef database fill:#FFC107,color:black
    
    %% Legend
    subgraph Legend
        Frontend["Frontend Component"]:::frontend
        Service["Service Component"]:::service
        APIComponent["API Endpoint"]:::api
        DB["Database"]:::database
    end
```
