# snwatson/ketamine-nightmares architecture

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

- Interactive diagram: https://gitdiagram.com/snwatson/ketamine-nightmares
- Repository: https://github.com/snwatson/ketamine-nightmares

## Overview

##### Main Components
- Repository (Version Control):
– Represent the Git repository as the central source. This contains all the content directories (“admin”, “fex”, “pex”, “pocus”) and supporting files (like index.md, README.md, CNAME).
– Show the organized file tree with separate modules for different types of content: “fex” (core clinical information, classics, summaries, investigations, etc.), “pex” (exam preparation materials, memorisation content, SAQs, videos) and “pocus” (point-of-care ultrasound resources).

- Content Conversion & Processing Pipeline:
– Include a component for the conversion process. The README shows that HTML content produced initially in Microsoft Word is filtered and converted (using grep, GNU parallel, and tidy-html5).
– Represent the processing tools (grep, parallel, tidy) as sub-components or a service that “transforms” files.

- Static Site Hosting / Delivery:
– Show the deployment of the static website (hinted by the CNAME file) – likely hosted on a static hosting service (e.g., GitHub Pages or similar).
– Indicate that the cleaned content is ultimately deployed onto a web server or CDN that serves pages to end users via web browsers.

##### Relationships & Data Flow
- From the Conversion Pipeline, direct output (converted HTML/ASCII content) into a “Build/Deployment” component.
- Also, you might indicate feedback from user experience (if improvements are made) back to the Repository for updates.

##### Architectural Patterns & Technologies
- Static website paradigm, where all pages are generated in advance (using a “preprocessing” pipeline) rather than dynamically rendered on each request. This is crucial both in “content maintenance” and “deployment.”

##### Final Structure
- Next, indicate a “Static Build & Deployment” stage, potentially integrating tools like a static site generator (even if implicitly) or placing files on the hosting platform (hinted at by CNAME).

This detailed approach will help capture all essential architectural elements of the Ketamine Nightmares project while clarifying its static content management, transformation, and delivery workflow.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Source Repository and Content Modules
    subgraph "Source Repository"
        REPO["Source Repository\n(.gitignore, CNAME, README.md)"]:::repo
        subgraph "Content Modules"
            FEX["fex"]:::content
            PEX["pex"]:::content
            POCC["pocus"]:::content
        end
    end

    %% Conversion Pipeline
    CP["Content Conversion Pipeline\n(grep, GNU parallel, tidy-html5)"]:::pipeline

    %% Build and Deployment Stage
    DEP["Static Build & Deployment"]:::deployment

    %% Static Hosting / Web Server
    HOST["Web Server / Static Hosting\n(GitHub Pages or similar)"]:::hosting

    %% End User Browser
    USER["End User (Browser)"]:::user

    %% Data Flow
    REPO -->|"raw HTML"| CP
    CP -->|"cleaned US-ASCII content"| DEP
    DEP -->|"deployed static files"| HOST
    HOST -->|"serves pages to"| USER
    USER -->|"feedback"| REPO

    %% Click Events
    click REPO "https://github.com/snwatson/ketamine-nightmares/blob/master/."
    click FEX "https://github.com/snwatson/ketamine-nightmares/tree/master/fex/"
    click PEX "https://github.com/snwatson/ketamine-nightmares/tree/master/pex/"
    click POCC "https://github.com/snwatson/ketamine-nightmares/tree/master/pocus/"
    click DEP "https://github.com/snwatson/ketamine-nightmares/blob/master/index.md"

    %% Styles
    classDef repo fill:#AED6F1,stroke:#1B4F72,stroke-width:2px;
    classDef content fill:#FAD7A0,stroke:#D35400,stroke-width:2px;
    classDef pipeline fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
    classDef deployment fill:#A9DFBF,stroke:#229954,stroke-width:2px;
    classDef hosting fill:#D2B4DE,stroke:#8E44AD,stroke-width:2px;
    classDef user fill:#F5B7B1,stroke:#C0392B,stroke-width:2px;
```
