# ashoksuthar14/web_scr architecture

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

- Interactive diagram: https://gitdiagram.com/ashoksuthar14/web_scr
- Repository: https://github.com/ashoksuthar14/web_scr

## Overview

##### Project type and purpose
- It reads prompt configurations, validates inputs, calls an external API (Perplexity), and writes results to disk.

##### File structure
- Top-level files:
- .env ─ environment variables (API keys, secrets)
- app.py ─ the main application entry point
- requirements.txt ─ Python dependencies
- prompts/ ─ JSON files containing prompt definitions
- utils/ ─ helper modules:
- data_writer.py ─ handles writing scraped or API data to files
- perplexity_api.py ─ client wrapper for talking to the Perplexity API
- validator.py ─ input validation, schema checks
- No front-end; this is a single service/script.

##### README for additional insights
- The README only contains the title “web_scr.” We infer from file names and modules that the core flow is: load prompts → validate → hit API → write output.

## Diagram (Mermaid)

```mermaid
flowchart TD
    Env[".env"]:::config
    Prompts["prompts/*.json"]:::config
    App["app.py"]:::internal
    Val["Validator\n(utils/validator.py)"]:::internal
    APIClient["API Client\n(utils/perplexity_api.py)"]:::internal
    Writer["Data Writer\n(utils/data_writer.py)"]:::internal
    External(("Perplexity API")):::external
    FileSystem["Local File System"]:::datastore

    Env -->|"provides credentials"| App
    Prompts -->|"loads JSON prompts"| App
    App -->|"validates prompt"| Val
    Val -->|"valid prompt data"| APIClient
    APIClient -->|"HTTPS request"| External
    External -->|"API JSON response"| APIClient
    APIClient -->|"response data"| Writer
    Writer -->|"writes output"| FileSystem

    click App "https://github.com/ashoksuthar14/web_scr/blob/main/app.py"
    click Prompts "https://github.com/ashoksuthar14/web_scr/tree/main/prompts/"
    click Val "https://github.com/ashoksuthar14/web_scr/blob/main/utils/validator.py"
    click APIClient "https://github.com/ashoksuthar14/web_scr/blob/main/utils/perplexity_api.py"
    click Writer "https://github.com/ashoksuthar14/web_scr/blob/main/utils/data_writer.py"
    click Env "https://github.com/ashoksuthar14/web_scr/blob/main/.env"

    classDef config fill:#bbf,stroke:#333,stroke-width:1px
    classDef internal fill:#bfb,stroke:#333,stroke-width:1px
    classDef external fill:#f88,stroke:#333,stroke-width:1px
    classDef datastore fill:#ffeb99,stroke:#333,stroke-width:1px
```
