# israelriverasxec/sdgestreaming architecture

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

- Interactive diagram: https://gitdiagram.com/israelriverasxec/sdgestreaming
- Repository: https://github.com/israelriverasxec/sdgestreaming

## Overview

##### Project Type and Purpose
- SDGEStreaming is a CLI‐based streaming management system built in Go.
- It is an academic, modular console application for managing users and content in memory.
- Focus is on demonstrating Go fundamentals: packages, functions, modularity, and interactive menus.

##### File Structure
- Top‐level entries:
- cmd/sdge/main.go – application entry point and interactive menu controller
- pkg/users/users.go – user registration and listing logic
- pkg/content/content.go – content creation, listing, and rating logic
- go.mod – module definition
- README.md – project overview and documentation
- No persistent storage layer: data is held in in‐memory slices.
- No external dependencies beyond Go standard library.
- Clearly separated “cmd” for executable code and “pkg” for reusable packages.

##### Extract Insights from the README
- Modules and responsibilities are explicitly described:
- Main CLI controller in cmd/sdge
- User management in pkg/users
- Content management in pkg/content
- No network or database components at this stage—pure in-memory operations.

a. Main Components
– CLI Interface (cmd/sdge/main.go)
– User Service (pkg/users)
– Content Service (pkg/content)
– In-Memory Data Stores (Users slice, Content slice)
b. Relationships and Interactions
– CLI passes user input to either User Service or Content Service.
– Services update or query their in-memory stores.
– Results flow back to CLI for display.
c. Architectural Patterns
– Package-based modularity (separation of concerns)
– Single executable binary model
– Inversion of control: CLI orchestrates service calls
d. Key Technologies
– Go standard library: fmt, bufio, os, strings, strconv
– Go modules for dependency management

##### Detailed Component Breakdown
- CLI Interface
- Submenus: User Management, Content Management
- Input parsing and menu dispatch
- User Service
- RegisterUser()
- GetAllUsers()
- In-memory slice of User structs
- Content Service
- AddContent()
- ListContentWithAverageRating()
- RateContent()
- In-memory slice of Content structs with ratings
- Data Flow
- User selects menu option → CLI parses → invokes service method → service modifies/queries slice → returns result → CLI displays

##### Final Recommendations
- Every module, even if simple, to demonstrate modularity.
- Provide a title (“SDGEStreaming vAA1 Architecture”) and date/version.

## Diagram (Mermaid)

```mermaid
flowchart TD
    title["SDGEStreaming vAA1 Architecture"]
    subgraph "CLI Module"
        CLI["CLI Menu Controller\n(cmd/sdge/main.go)"]:::cli
        Menu{"Menu Selection"}:::decision
    end
    subgraph "User Service Module"
        US["User Service\n(pkg/users/users.go)"]:::service
    end
    subgraph "Content Service Module"
        CS["Content Service\n(pkg/content/content.go)"]:::service
    end
    Stdin([stdin]):::io
    Stdout([stdout]):::io
    USStore[(Users Slice)]:::store
    CSStore[(Content Slice)]:::store
    ModuleDef["go.mod"]:::file
    Readme["README.md"]:::file

    Stdin --> CLI
    CLI --> Menu
    Menu -->|"User Management"| US
    Menu -->|"Content Management"| CS
    US -->|"GetAllUsers() / RegisterUser()"| USStore
    USStore -->|"[]User"| US
    CS -->|"AddContent() / ListContentWithAverageRating() / RateContent()"| CSStore
    CSStore -->|"[]Content"| CS
    US -->|"Return data"| CLI
    CS -->|"Return data"| CLI
    CLI --> Stdout

    click CLI "https://github.com/israelriverasxec/sdgestreaming/blob/main/cmd/sdge/main.go"
    click US "https://github.com/israelriverasxec/sdgestreaming/blob/main/pkg/users/users.go"
    click CS "https://github.com/israelriverasxec/sdgestreaming/blob/main/pkg/content/content.go"
    click ModuleDef "https://github.com/israelriverasxec/sdgestreaming/blob/main/go.mod"
    click Readme "https://github.com/israelriverasxec/sdgestreaming/blob/main/README.md"

    classDef cli fill:#f9f,stroke:#333,stroke-width:1px;
    classDef service fill:#ff9,stroke:#333,stroke-width:1px;
    classDef store fill:#ccf,stroke:#333,stroke-width:1px;
    classDef io fill:#cfc,stroke:#333,stroke-width:1px;
    classDef file fill:#ffc,stroke:#333,stroke-width:1px;
    classDef decision fill:#fcf,shape:diamond,stroke:#333,stroke-width:1px;
```
