# cosm1c10/kreo-competitor-intelligence architecture

> Architecture diagram of the GitHub repository cosm1c10/kreo-competitor-intelligence, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cosm1c10/kreo-competitor-intelligence
- Repository: https://github.com/cosm1c10/kreo-competitor-intelligence

## Overview

This repository appears to be an early product-catalog and scraper service: product records are configured for seeding into Supabase, while the sampled scraper currently exposes only a health check. The tree and excerpts do not establish a scraping-to-storage workflow, so none is shown; the Firecrawl test scripts are not treated as product runtime.

Main entry points: [`scripts/seed-products.js`](https://github.com/cosm1c10/kreo-competitor-intelligence/blob/main/scripts/seed-products.js) (Catalog seeder), [`supabase/migrations/001_initial_schema.sql`](https://github.com/cosm1c10/kreo-competitor-intelligence/blob/main/supabase/migrations/001_initial_schema.sql) (Supabase database), [`supabase/migrations/002_rls_policies.sql`](https://github.com/cosm1c10/kreo-competitor-intelligence/blob/main/supabase/migrations/002_rls_policies.sql) (Access policies), [`supabase/migrations/003_cleanup_functions.sql`](https://github.com/cosm1c10/kreo-competitor-intelligence/blob/main/supabase/migrations/003_cleanup_functions.sql) (Cleanup functions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_catalog["Product catalog"]
  node_registry["Product registry<br/>[products.json]"]
  node_schema["Registry schema"]
  node_seeder["Catalog seeder<br/>[seed-products.js]"]
end

subgraph group_data["Catalog persistence"]
  node_database[("Supabase database")]
  node_policies["Access policies"]
  node_cleanup["Cleanup functions"]
end

subgraph group_service["Scraper service"]
  node_scraper["Scraper HTTP service<br/>[index.js]"]
end

node_operator(("Operator"))
node_client(("Health-check client"))

node_operator -->|"runs"| node_seeder
node_seeder -->|"reads"| node_registry
node_seeder -->|"upserts products"| node_database
node_policies -->|"configures access"| node_database
node_cleanup -->|"defines cleanup"| node_database
node_client -->|"requests health"| node_scraper

click node_registry "https://github.com/cosm1c10/kreo-competitor-intelligence/blob/main/config/products.json"
click node_schema "https://github.com/cosm1c10/kreo-competitor-intelligence/blob/main/config/products.schema.json"
click node_seeder "https://github.com/cosm1c10/kreo-competitor-intelligence/blob/main/scripts/seed-products.js"
click node_database "https://github.com/cosm1c10/kreo-competitor-intelligence/blob/main/supabase/migrations/001_initial_schema.sql"
click node_policies "https://github.com/cosm1c10/kreo-competitor-intelligence/blob/main/supabase/migrations/002_rls_policies.sql"
click node_cleanup "https://github.com/cosm1c10/kreo-competitor-intelligence/blob/main/supabase/migrations/003_cleanup_functions.sql"
click node_scraper "https://github.com/cosm1c10/kreo-competitor-intelligence/blob/main/services/scraper/src/index.js"

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_registry,node_schema,node_seeder,node_client toneBlue
class node_database,node_policies,node_cleanup toneAmber
class node_scraper toneMint
class node_operator toneIndigo
```

## Components

### Product catalog

- [Product registry](https://github.com/cosm1c10/kreo-competitor-intelligence/blob/main/config/products.json): `config/products.json`
- [Registry schema](https://github.com/cosm1c10/kreo-competitor-intelligence/blob/main/config/products.schema.json): `config/products.schema.json`
- [Catalog seeder](https://github.com/cosm1c10/kreo-competitor-intelligence/blob/main/scripts/seed-products.js): `scripts/seed-products.js`

### Catalog persistence

- [Supabase database](https://github.com/cosm1c10/kreo-competitor-intelligence/blob/main/supabase/migrations/001_initial_schema.sql): `supabase/migrations/001_initial_schema.sql`
- [Access policies](https://github.com/cosm1c10/kreo-competitor-intelligence/blob/main/supabase/migrations/002_rls_policies.sql): `supabase/migrations/002_rls_policies.sql`
- [Cleanup functions](https://github.com/cosm1c10/kreo-competitor-intelligence/blob/main/supabase/migrations/003_cleanup_functions.sql): `supabase/migrations/003_cleanup_functions.sql`

### Scraper service

- [Scraper HTTP service](https://github.com/cosm1c10/kreo-competitor-intelligence/blob/main/services/scraper/src/index.js): `services/scraper/src/index.js`

### Other components

- **Operator**
- **Health-check client**

## Connections

- Operator → Catalog seeder: runs
- Catalog seeder → Product registry: reads
- Catalog seeder → Supabase database: upserts products
- Access policies → Supabase database: configures access
- Cleanup functions → Supabase database: defines cleanup
- Health-check client → Scraper HTTP service: requests health
