# intro-camejo/ricky-fort-merch architecture

> Architecture diagram of the GitHub repository intro-camejo/ricky-fort-merch, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/intro-camejo/ricky-fort-merch
- Repository: https://github.com/intro-camejo/ricky-fort-merch

## Overview

Ricky Fort Merch is an unofficial merch storefront backed by a product API and PostgreSQL. A visitor uses the frontend; its script fetches the product list and can submit a new product, while the API also provides product lookup, update, and delete routes. The API owns database queries through a configured connection pool. The README documents initializing PostgreSQL with the schema and seed SQL. HTML pages and SQL contents were not sampled, so their finer behavior is not inferred.

Main entry points: [`backend/app.js`](https://github.com/intro-camejo/ricky-fort-merch/blob/main/backend/app.js) (Product routes), [`frontend/scripts.js`](https://github.com/intro-camejo/ricky-fort-merch/blob/main/frontend/scripts.js) (Catalog script), [`backend/db/pool.js`](https://github.com/intro-camejo/ricky-fort-merch/blob/main/backend/db/pool.js) (Postgres pool), [`backend/db/schemas.sql`](https://github.com/intro-camejo/ricky-fort-merch/blob/main/backend/db/schemas.sql) (Product schema)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_site["Storefront pages"]
  node_browser_script["Catalog script<br/>[scripts.js]"]
end

subgraph group_api["Product API"]
  node_product_api["Product routes<br/>[app.js]"]
end

subgraph group_data["Product data"]
  node_db_pool["Postgres pool<br/>[pool.js]"]
  node_product_schema["Product schema<br/>[schemas.sql]"]
  node_product_seeds["Seed products<br/>[seeds.sql]"]
  node_postgres[("PostgreSQL")]
end

node_visitor(("Visitor"))

node_visitor -.->|"visits"| node_site
node_browser_script -->|"fetches products"| node_product_api
node_browser_script -->|"submits product"| node_product_api
node_product_api -->|"queries through"| node_db_pool
node_db_pool -->|"connects to"| node_postgres
node_product_schema -->|"initializes schema"| node_postgres
node_product_seeds -->|"loads seed data"| node_postgres

click node_site "https://github.com/intro-camejo/ricky-fort-merch/tree/main/frontend"
click node_browser_script "https://github.com/intro-camejo/ricky-fort-merch/blob/main/frontend/scripts.js"
click node_product_api "https://github.com/intro-camejo/ricky-fort-merch/blob/main/backend/app.js"
click node_db_pool "https://github.com/intro-camejo/ricky-fort-merch/blob/main/backend/db/pool.js"
click node_product_schema "https://github.com/intro-camejo/ricky-fort-merch/blob/main/backend/db/schemas.sql"
click node_product_seeds "https://github.com/intro-camejo/ricky-fort-merch/blob/main/backend/db/seeds.sql"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_site,node_browser_script toneBlue
class node_product_api toneAmber
class node_db_pool,node_product_schema,node_product_seeds,node_postgres toneMint
class node_visitor toneIndigo
```

## Components

### Storefront

- [Storefront pages](https://github.com/intro-camejo/ricky-fort-merch/tree/main/frontend): `frontend`
- [Catalog script](https://github.com/intro-camejo/ricky-fort-merch/blob/main/frontend/scripts.js): `frontend/scripts.js`

### Product API

- [Product routes](https://github.com/intro-camejo/ricky-fort-merch/blob/main/backend/app.js): `backend/app.js`

### Product data

- [Postgres pool](https://github.com/intro-camejo/ricky-fort-merch/blob/main/backend/db/pool.js): `backend/db/pool.js`
- [Product schema](https://github.com/intro-camejo/ricky-fort-merch/blob/main/backend/db/schemas.sql): `backend/db/schemas.sql`
- [Seed products](https://github.com/intro-camejo/ricky-fort-merch/blob/main/backend/db/seeds.sql): `backend/db/seeds.sql`
- **PostgreSQL**

### Other components

- **Visitor**

## Connections

- Visitor → Storefront pages: visits
- Catalog script → Product routes: fetches products (evidence: `frontend/scripts.js`)
- Catalog script → Product routes: submits product (evidence: `frontend/scripts.js`)
- Product routes → Postgres pool: queries through (evidence: `backend/app.js`)
- Postgres pool → PostgreSQL: connects to (evidence: `backend/db/pool.js`)
- Product schema → PostgreSQL: initializes schema (evidence: `README.md`)
- Seed products → PostgreSQL: loads seed data (evidence: `README.md`)
