# projectdasw/poor-assistance architecture

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

- Interactive diagram: https://gitdiagram.com/projectdasw/poor-assistance
- Repository: https://github.com/projectdasw/poor-assistance

## Overview

##### Main Components Organization

a) Experiment Flow Layer
- Sequential flow of the experiment modules:
- Welcome & Instructions
- Before Experiment
- Investment Games (1-4 with practice sessions)
- Survey
- Payment System

b) Technical Architecture Layer
- Frontend Components (HTML Templates)
- Static Resources
- Backend Logic (Python)
- Data Flow Management

##### Component Breakdown

- Welcome & Instructions Module (Green)
- Instruction1
- Instruction2
- Confirmation
- Investment Games Module (Blue)
- Practice Sessions
- Main Games (1-4)
- Results Display
- Survey Module (Yellow)
- Demographics
- Survey Questions
- Payment Module (Purple)
- Random Payment Selection
- Payment Processing

b) Shared Components (Gray):
- Static Resources
- FontAwesome
- Global Styles
- Templates
- Global Page Template

##### Flow and Relationships

- Sequential flow between modules
- Data flow between components
- User interaction paths
- Payment calculation flows

##### Technical Details

- Python Backend Components
- HTML Template Structure
- Static Asset Management
- Data Storage/Session Management

##### Validation and confirmation steps

- The modular nature of the experiment design
- Clear separation between practice and real sessions
- The progression through different game types
- Integration of survey and payment systems
- Resource sharing between components

Keep the abstraction level focused on the experimental flow while showing technical implementation details where they impact the user experience or data collection.

This will create a comprehensive visualization that helps understand both the experimental design and technical implementation of the poverty assistance study platform.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Legend
        L1[Module]
        L2[(Database)]
        L3[/"API Endpoint"\]
        L4{{User Flow}}
        style L1 fill:#f5f5f5
        style L2 fill:#f5f5f5
        style L3 fill:#f5f5f5
        style L4 fill:#f5f5f5
    end

    subgraph "Shared Resources"
        SR1["Static Assets"]:::static
        SR2["Global Templates"]:::templates
        SR3["FontAwesome"]:::static
    end

    subgraph "Welcome & Instructions"
        WI1["Instruction1"]:::welcome
        WI2["Instruction2"]:::welcome
        WI3["Confirmation"]:::welcome
    end

    subgraph "Before Experiment"
        BE["Before Experiment"]:::before
    end

    subgraph "Investment Games"
        subgraph "Practice Sessions"
            PS1["Game 1 Practice"]:::practice
            PS2["Game 2 Practice"]:::practice
        end

        subgraph "Main Games"
            MG1["Game 1"]:::game
            MG2["Game 2"]:::game
            MG3["Game 3"]:::game
            MG4["Game 4"]:::game
        end

        GC1["Welcome"]:::game
        GC2["Instructions"]:::game
        GC3["Game Interface"]:::game
        GC4["Results"]:::game
        GC5["Confirmation"]:::game
        GC6["All Results"]:::game
    end

    subgraph "Survey Module"
        SM1["Demographics"]:::survey
        SM2["Survey Questions"]:::survey
    end

    subgraph "Payment System"
        PM1["Payment Selection"]:::payment
        PM2["Payment Processing"]:::payment
        PM3["End"]:::payment
    end

    DB[(Session Storage)]

    WI1 --> WI2
    WI2 --> WI3
    WI3 --> BE
    BE --> PS1
    PS1 --> PS2
    PS2 --> MG1
    MG1 --> MG2
    MG2 --> MG3
    MG3 --> MG4
    MG4 --> SM1
    SM1 --> SM2
    SM2 --> PM1
    PM1 --> PM2
    PM2 --> PM3

    SR1 -.-> GC3
    SR2 -.-> GC3
    SR3 -.-> GC3

    classDef static fill:#d3d3d3
    classDef templates fill:#e6e6e6
    classDef welcome fill:#90EE90
    classDef before fill:#ADD8E6
    classDef practice fill:#87CEEB
    classDef game fill:#4682B4
    classDef survey fill:#FFD700
    classDef payment fill:#DDA0DD

    click WI1 "https://github.com/projectdasw/poor-assistance/blob/main/welcome_instructions/Instruction1.html"
    click WI2 "https://github.com/projectdasw/poor-assistance/blob/main/welcome_instructions/Instruction2.html"
    click WI3 "https://github.com/projectdasw/poor-assistance/blob/main/welcome_instructions/Confirmation.html"
    click BE "https://github.com/projectdasw/poor-assistance/blob/main/before_experiment/Before_Experiment.html"
    click MG1 "https://github.com/projectdasw/poor-assistance/tree/main/investment_game1"
    click MG2 "https://github.com/projectdasw/poor-assistance/tree/main/investment_game2"
    click MG3 "https://github.com/projectdasw/poor-assistance/tree/main/investment_game3"
    click MG4 "https://github.com/projectdasw/poor-assistance/tree/main/investment_game4"
    click PS1 "https://github.com/projectdasw/poor-assistance/tree/main/investment_game1_practice"
    click PS2 "https://github.com/projectdasw/poor-assistance/tree/main/investment_game2_practice"
    click SM1 "https://github.com/projectdasw/poor-assistance/blob/main/survey/Demographic.html"
    click SM2 "https://github.com/projectdasw/poor-assistance/blob/main/survey/Survey.html"
    click PM1 "https://github.com/projectdasw/poor-assistance/blob/main/pay_random/Payment.html"
    click PM2 "https://github.com/projectdasw/poor-assistance/blob/main/pay_random/Pay_info.html"
    click PM3 "https://github.com/projectdasw/poor-assistance/blob/main/pay_random/End.html"
    click SR1 "https://github.com/projectdasw/poor-assistance/tree/main/_static/global"
    click SR3 "https://github.com/projectdasw/poor-assistance/tree/main/_static/fontawesome"
    click SR2 "https://github.com/projectdasw/poor-assistance/blob/main/_templates/global/Page.html"
```
