# zaradarz/onlyfans-notification-robot architecture

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

- Interactive diagram: https://gitdiagram.com/zaradarz/onlyfans-notification-robot
- Repository: https://github.com/zaradarz/onlyfans-notification-robot

## Overview

##### External Services Layer
- Gmail IMAP Server
- OnlyFans Email Notification Service

##### Hardware Components
- Raspberry Pi (central controller)
- Stepper Motor
- Stepper Motor Driver
- 3D Printed Penguin
- Speaker
- GPIO Pins (17, 18, 27, 22)

##### Software Components
- Email Monitoring Module (using imaplib)
- GPIO Control Module (using RPi.GPIO)
- Audio Playback Module (using pygame)
- Main Control Loop

##### Use a layered approach with three main sections

- External Layer |

- Software Layer |

- Hardware Layer |

##### Component Relationships
- Control flow from the Raspberry Pi to both the stepper motor and speaker
- GPIO pin connections between the Pi and motor driver

##### Specific technical details
- 20-second polling interval
- 512-step motor rotation sequence

##### A process flow section showing the sequence
1. Email Reception
2. Email Detection
3. Motor Activation
4. Sound Playback

**[OnlyFans] → [Gmail IMAP] → [Email Monitor Module]**
- ↓
- [Main Control Loop]
- ↙         ↘
- [GPIO Module]    [Audio Module]
- ↓                  ↓
- [Motor Driver]         [Speaker]
- ↓
- [Stepper Motor] → [3D Printed Penguin]

##### Notes about key configuration requirements (email settings, sound file)

Keep the following aspects in mind:

##### Physical Architecture
- Physical connections between components
- Breadboard layout reference
- Power supply connections

##### Software Flow
- Continuous monitoring loop
- Error handling paths
- Configuration points

##### Integration Points
- Email server authentication
- GPIO pin initialization
- Audio system setup

## Diagram (Mermaid)

```mermaid
graph TB
    %% External Layer
    subgraph External
        OF[OnlyFans Notification]
        GMAIL[Gmail IMAP Server]
    end

    %% Software Layer
    subgraph Software
        EM[Email Monitor]:::software
        MCL[Main Control Loop]:::software
        GPIO[GPIO Control Module]:::software
        APM[Audio Playback Module]:::software
    end

    %% Hardware Layer
    subgraph Hardware
        RPI[Raspberry Pi]:::hardware
        MD[Motor Driver]:::hardware
        SM[Stepper Motor]:::hardware
        SPK[Speaker]:::hardware
        PENG[3D Printed Penguin]:::hardware
        
        subgraph GPIO_PINS[GPIO Pin Configuration]
            PIN17[GPIO 17]:::pin
            PIN18[GPIO 18]:::pin
            PIN27[GPIO 27]:::pin
            PIN22[GPIO 22]:::pin
        end
    end

    %% Connections
    OF -->|Sends notification| GMAIL
    GMAIL -->|IMAP Protocol| EM
    EM -->|20s polling| MCL
    MCL -->|Control signals| GPIO
    MCL -->|Audio commands| APM
    GPIO -->|Digital signals| MD
    MD -->|512-step sequence| SM
    SM -->|Mechanical motion| PENG
    APM -->|Audio output| SPK
    
    %% GPIO Pin Connections
    GPIO --- PIN17
    GPIO --- PIN18
    GPIO --- PIN27
    GPIO --- PIN22
    PIN17 & PIN18 & PIN27 & PIN22 ---|Motor control| MD

    %% Styles
    classDef software fill:#90EE90,stroke:#333,stroke-width:2px
    classDef hardware fill:#FFA500,stroke:#333,stroke-width:2px
    classDef pin fill:#FFE4B5,stroke:#333,stroke-width:1px
    
    %% Legend
    subgraph Legend
        L1[Software Component]:::software
        L2[Hardware Component]:::hardware
        L3[GPIO Pin]:::pin
    end
```
