# adamtang5/journium_render architecture

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

- Interactive diagram: https://gitdiagram.com/adamtang5/journium_render
- Repository: https://github.com/adamtang5/journium_render

## Overview

##### Main Components Identification
The system consists of these primary components:

a) Frontend (React/Redux Application):
- User Interface Components
- State Management (Redux Store)
- API Integration Layer

b) Backend (Express.js Application):
- API Routes
- Authentication System
- Database Models
- AWS S3 Integration

c) Database (PostgreSQL):
- User Management
- Content Storage
- Relationship Management

##### Connection Flows

- Frontend → Backend (REST API calls)
- Backend → Database (Sequelize ORM)
- Backend → AWS S3 (Media storage)

##### Component Details

For each major component, include:
- Technology used (React, Express, PostgreSQL)
- Key responsibilities
- Internal structure
- External dependencies

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Client
        UI["UI Components"]
        Redux["Redux Store"]
        APIClient["API Integration Layer"]
        
        subgraph UIComponents
            Story["Story Components"]:::frontend
            Comment["Comment Components"]:::frontend
            Auth["Authentication Forms"]:::frontend
            AWS_UI["File Upload Component"]:::frontend
        end
        
        subgraph ReduxStore
            SessionStore["Session Store"]:::frontend
            StoryStore["Story Store"]:::frontend
            CommentStore["Comment Store"]:::frontend
            AWSStore["AWS Store"]:::frontend
        end
    end

    subgraph Server
        subgraph APIRoutes
            SessionAPI["/api/session"]:::api
            StoriesAPI["/api/stories"]:::api
            CommentsAPI["/api/comments"]:::api
            UsersAPI["/api/users"]:::api
            StorageAPI["/api/storage"]:::api
        end
        
        subgraph Auth
            AuthUtils["Authentication Utils"]:::backend
            Validation["Validation Utils"]:::backend
        end
        
        AWSS3["AWS S3 Integration"]:::external
    end

    subgraph Database
        subgraph Models
            Users[(Users)]:::db
            Stories[(Stories)]:::db
            Comments[(Comments)]:::db
            Likes[(Likes)]:::db
            Roles[(Roles)]:::db
        end
    end

    UI --> Redux
    Redux --> APIClient
    APIClient --> APIRoutes
    APIRoutes --> Auth
    APIRoutes --> AWSS3
    APIRoutes --> Models
    
    %% Component Mappings
    click Story "https://github.com/adamtang5/journium_render/tree/main/frontend/src/components/Story/"
    click Comment "https://github.com/adamtang5/journium_render/tree/main/frontend/src/components/Comment/"
    click Auth "https://github.com/adamtang5/journium_render/tree/main/frontend/src/components/LoginFormPage/"
    click SessionStore "https://github.com/adamtang5/journium_render/blob/main/frontend/src/store/session.js"
    click StoryStore "https://github.com/adamtang5/journium_render/blob/main/frontend/src/store/story.js"
    click CommentStore "https://github.com/adamtang5/journium_render/blob/main/frontend/src/store/comment.js"
    click AWSStore "https://github.com/adamtang5/journium_render/blob/main/frontend/src/store/aws.js"
    click SessionAPI "https://github.com/adamtang5/journium_render/blob/main/backend/routes/api/session.js"
    click StoriesAPI "https://github.com/adamtang5/journium_render/blob/main/backend/routes/api/stories.js"
    click CommentsAPI "https://github.com/adamtang5/journium_render/blob/main/backend/routes/api/comments.js"
    click UsersAPI "https://github.com/adamtang5/journium_render/blob/main/backend/routes/api/users.js"
    click AuthUtils "https://github.com/adamtang5/journium_render/blob/main/backend/utils/auth.js"
    click Validation "https://github.com/adamtang5/journium_render/blob/main/backend/utils/validation.js"
    click Users "https://github.com/adamtang5/journium_render/blob/main/backend/db/models/user.js"
    click Stories "https://github.com/adamtang5/journium_render/blob/main/backend/db/models/story.js"
    click Comments "https://github.com/adamtang5/journium_render/blob/main/backend/db/models/comment.js"
    click Likes "https://github.com/adamtang5/journium_render/blob/main/backend/db/models/like.js"
    click Roles "https://github.com/adamtang5/journium_render/blob/main/backend/db/models/role.js"
    click AWSS3 "https://github.com/adamtang5/journium_render/blob/main/backend/awsS3.js"
    click AWS_UI "https://github.com/adamtang5/journium_render/blob/main/frontend/src/components/aws/FileUpload.js"

    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef backend fill:#2ecc71,stroke:#27ae60,color:white
    classDef api fill:#e74c3c,stroke:#c0392b,color:white
    classDef db fill:#f1c40f,stroke:#f39c12,color:black
    classDef external fill:#95a5a6,stroke:#7f8c8d,color:white

    %% Legend
    subgraph Legend
        Frontend["Frontend Component"]:::frontend
        Backend["Backend Component"]:::backend
        API["API Route"]:::api
        DB["Database Model"]:::db
        External["External Service"]:::external
    end
```
