# hanlaims/rd999-sw-arvrbwtweb architecture

> Architecture diagram of the GitHub repository hanlaims/rd999-sw-arvrbwtweb, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hanlaims/rd999-sw-arvrbwtweb
- Repository: https://github.com/hanlaims/rd999-sw-arvrbwtweb

## Overview

##### Main Components

A. Frontend Layer (Vue.js):
- Sub-components:
- Views (Home, ShipData, ShipList, SignIn)
- Components (DataView, TrendLine, SpreadSheet)
- Vuex Store (User Store, TrendDataset Store)
- Vue Router
- Vuetify UI Framework

B. Backend Layer (Node.js):
- API modules:
- Authentication Services (auth.js, pg-auth.js)
- Data Services (board.js, card.js, list.js)
- Ship Data Services (pg-shipdata.js, pg-shiplist.js)
- Dashboard Services (dashboard.js)

C. Database Layer:
- Main data entities (can be derived from models.js and pgpmodels.js)

##### Connection and Data Flow

A. Client-Server Communication:
- HTTP/HTTPS protocol

B. Database Interactions:

C. Authentication Flow:
- Interaction between SignIn component, auth services, and database

##### Infrastructure Components

A. Docker Containers:
- Docker Compose orchestration
- Both primary and secondary configurations

##### Specific Design Elements

- Blue: Frontend components
- Green: Backend services
- Yellow: Database components
- Red: Authentication/Security components
- Gray: Infrastructure/Docker components

Symbols:
- Use rectangles for services/components
- Use hexagons for API endpoints

##### Additional Details

A. Environment Configuration:
- .env files location and purpose
- Configuration flow

B. Security Layer:
- SECURITY.md specifications
- Authentication/authorization flow

##### Notes for Implementation
- MVC pattern implementation
- Clear boundaries between different services
- Scaling considerations
- Document API endpoints grouping

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Frontend
        VueApp["Vue.js Application"]
        
        subgraph Views
            HomeView["Home View"]:::frontend
            ShipDataView["Ship Data View"]:::frontend
            ShipListView["Ship List View"]:::frontend
            SignInView["Sign In View"]:::frontend
        end
        
        subgraph Components
            DataViewComp["Data View"]:::frontend
            TrendLineComp["Trend Line"]:::frontend
            SpreadSheetComp["Spread Sheet"]:::frontend
            VuetifyFW["Vuetify Framework"]:::frontend
        end
        
        subgraph Store
            UserStore["User Store"]:::frontend
            TrendStore["TrendDataset Store"]:::frontend
            VueRouter["Vue Router"]:::frontend
        end
    end
    
    subgraph Backend
        subgraph AuthServices
            Auth["Authentication Service"]:::backend
            PGAuth["PG Auth Service"]:::backend
        end
        
        subgraph DataServices
            Board["Board Service"]:::backend
            Card["Card Service"]:::backend
            List["List Service"]:::backend
            Dashboard["Dashboard Service"]:::backend
            ShipData["Ship Data Service"]:::backend
            ShipList["Ship List Service"]:::backend
        end
        
        subgraph Models
            MainModels["Main Models"]:::backend
            PGPModels["PGP Models"]:::backend
        end
    end
    
    subgraph Database
        PostgreSQL[(PostgreSQL 13)]:::database
    end
    
    %% Connections
    VueApp --> Views
    VueApp --> Components
    VueApp --> Store
    
    AuthServices <--> PostgreSQL
    DataServices <--> PostgreSQL
    Models <--> PostgreSQL
    
    Frontend <--> |REST API| Backend
    
    %% Click Events
    click HomeView "https://github.com/HANLAIMS/RD999-SW-arvrbwtWEB/blob/main/front-end/src/views/Home.vue"
    click ShipDataView "https://github.com/HANLAIMS/RD999-SW-arvrbwtWEB/blob/main/front-end/src/views/ShipData.vue"
    click ShipListView "https://github.com/HANLAIMS/RD999-SW-arvrbwtWEB/blob/main/front-end/src/views/ShipList.vue"
    click SignInView "https://github.com/HANLAIMS/RD999-SW-arvrbwtWEB/blob/main/front-end/src/views/SignIn.vue"
    click DataViewComp "https://github.com/HANLAIMS/RD999-SW-arvrbwtWEB/blob/main/front-end/src/components/DataView.vue"
    click TrendLineComp "https://github.com/HANLAIMS/RD999-SW-arvrbwtWEB/blob/main/front-end/src/components/TrendLine.vue"
    click SpreadSheetComp "https://github.com/HANLAIMS/RD999-SW-arvrbwtWEB/blob/main/front-end/src/components/SpreadSheet.vue"
    click VuetifyFW "https://github.com/HANLAIMS/RD999-SW-arvrbwtWEB/blob/main/front-end/src/plugins/vuetify.js"
    click UserStore "https://github.com/HANLAIMS/RD999-SW-arvrbwtWEB/blob/main/front-end/src/store/userStore.js"
    click TrendStore "https://github.com/HANLAIMS/RD999-SW-arvrbwtWEB/blob/main/front-end/src/store/trendDatasetStore.js"
    click VueRouter "https://github.com/HANLAIMS/RD999-SW-arvrbwtWEB/blob/main/front-end/src/router/index.js"
    click Auth "https://github.com/HANLAIMS/RD999-SW-arvrbwtWEB/blob/main/back-end/api/auth.js"
    click PGAuth "https://github.com/HANLAIMS/RD999-SW-arvrbwtWEB/blob/main/back-end/api/pg-auth.js"
    click Board "https://github.com/HANLAIMS/RD999-SW-arvrbwtWEB/blob/main/back-end/api/board.js"
    click Card "https://github.com/HANLAIMS/RD999-SW-arvrbwtWEB/blob/main/back-end/api/card.js"
    click List "https://github.com/HANLAIMS/RD999-SW-arvrbwtWEB/blob/main/back-end/api/list.js"
    click Dashboard "https://github.com/HANLAIMS/RD999-SW-arvrbwtWEB/blob/main/back-end/api/dashBoard.js"
    click ShipData "https://github.com/HANLAIMS/RD999-SW-arvrbwtWEB/blob/main/back-end/api/pg-shipdata.js"
    click ShipList "https://github.com/HANLAIMS/RD999-SW-arvrbwtWEB/blob/main/back-end/api/pg-shiplist.js"
    click MainModels "https://github.com/HANLAIMS/RD999-SW-arvrbwtWEB/blob/main/back-end/models.js"
    click PGPModels "https://github.com/HANLAIMS/RD999-SW-arvrbwtWEB/blob/main/back-end/pgpmodels.js"
    
    %% Styling
    classDef frontend fill:#2196F3,stroke:#1565C0,color:white
    classDef backend fill:#4CAF50,stroke:#2E7D32,color:white
    classDef database fill:#FFC107,stroke:#FFA000,color:black
    
    %% Legend
    subgraph Legend
        Frontend_L["Frontend Component"]:::frontend
        Backend_L["Backend Service"]:::backend
        Database_L[(Database)]:::database
    end
```
