# aws-samples/amazon-ivs-real-time-basic-web-demo architecture

> Architecture diagram of the GitHub repository aws-samples/amazon-ivs-real-time-basic-web-demo, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aws-samples/amazon-ivs-real-time-basic-web-demo
- Repository: https://github.com/aws-samples/amazon-ivs-real-time-basic-web-demo

## Overview

##### Project Context and Components
- This React demo is part of the Amazon IVS Basic Real-time Web Demo. Its purpose is to let users start sessions (create) and join live sessions.
- The entry point is defined in src/main.jsx (rendering the App component from src/App.jsx). The routing is configured in src/router.ts, and pages are defined under src/pages (for example: src/pages/index.jsx for the home screen and src/pages/session/[id].jsx for individual sessions).
- Key UI screens include:
- Home Screen: Likely rendered by src/pages/index.jsx, acting as a landing page.
- Create Session Screen: Using UI components like CreateSession.jsx to set up a new session.
- Join Session Screen: Components such as JoinSession.jsx and JoinSessionDialog.jsx let users enter an existing session.
- Additional screens such as StageSession.jsx potentially manage session interactions once the user is in.

## Diagram (Mermaid)

```mermaid
graph LR
    WB["Web Browser Entry<br/>(index.html)"]:::client
    Main["React App<br/>(src/main.jsx)"]:::app
    App["App Component<br/>(src/App.jsx)"]:::app
    Router["Routing Layer<br/>(src/router.ts)"]:::router
    Home["Home Screen<br/>(src/pages/index.jsx)"]:::screen
    Create["Create Session<br/>(src/components/CreateSession.jsx)"]:::screen
    JoinMain["Join Session<br/>(src/components/JoinSession.jsx)"]:::screen
    JoinDialog["Join Dialog<br/>(src/components/JoinSessionDialog.jsx)"]:::screen
    StagePage["Stage/Session Page<br/>(src/pages/session/[id].jsx)"]:::screen
    StageComponent["Stage Session Component<br/>(src/components/StageSession.jsx)"]:::screen
    API["API Calls<br/>(Fetch,Create,Join,Delete)"]:::api
    Cloud["Backend API<br/>(Serverless/Infra)"]:::cloud

    WB --> Main
    Main --> App
    App --> Router
    Router --> Home
    Home -->|"create"| Create
    Home -->|"join"| JoinMain
    JoinMain --> JoinDialog
    Create --> StagePage
    JoinDialog --> StagePage
    StagePage --> StageComponent
    StageComponent -->|"trigger"| API
    API -->|"routeTo"| Cloud

    click WB "https://github.com/aws-samples/amazon-ivs-real-time-basic-web-demo/blob/main/index.html"
    click Main "https://github.com/aws-samples/amazon-ivs-real-time-basic-web-demo/blob/main/src/main.jsx"
    click App "https://github.com/aws-samples/amazon-ivs-real-time-basic-web-demo/blob/main/src/App.jsx"
    click Router "https://github.com/aws-samples/amazon-ivs-real-time-basic-web-demo/blob/main/src/router.ts"
    click Home "https://github.com/aws-samples/amazon-ivs-real-time-basic-web-demo/blob/main/src/pages/index.jsx"
    click Create "https://github.com/aws-samples/amazon-ivs-real-time-basic-web-demo/blob/main/src/components/CreateSession.jsx"
    click JoinMain "https://github.com/aws-samples/amazon-ivs-real-time-basic-web-demo/blob/main/src/components/JoinSession.jsx"
    click JoinDialog "https://github.com/aws-samples/amazon-ivs-real-time-basic-web-demo/blob/main/src/components/JoinSessionDialog.jsx"
    click StagePage "https://github.com/aws-samples/amazon-ivs-real-time-basic-web-demo/blob/main/src/pages/session/[id].jsx"
    click StageComponent "https://github.com/aws-samples/amazon-ivs-real-time-basic-web-demo/blob/main/src/components/StageSession.jsx"
    click Cloud "https://github.com/aws-samples/amazon-ivs-real-time-basic-web-demo/tree/main/infra"

    classDef client fill:#BEE3F8,stroke:#3182CE,stroke-width:2px;
    classDef app fill:#C6F6D5,stroke:#38A169,stroke-width:2px;
    classDef router fill:#FEFCBF,stroke:#ECC94B,stroke-width:2px;
    classDef screen fill:#FFF5F7,stroke:#D53F8C,stroke-width:2px;
    classDef api fill:#E9D8FD,stroke:#9F7AEA,stroke-width:2px;
    classDef cloud fill:#EDF2F7,stroke:#A0AEC0,stroke-width:2px,stroke-dasharray: 5,5;
```
