# extim-org/saas-core architecture

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

- Interactive diagram: https://gitdiagram.com/extim-org/saas-core
- Repository: https://github.com/extim-org/saas-core

## Overview

SAAS-Core combines tenant/project management with its built-in hosted search product; the repository also contains a storefront and commerce workflow. Customers manage projects and search configuration in the dashboard, the platform API persists tenant data, and the search services crawl and index configured sites before serving queries through a public API or widget. Separate admin and marketing applications support platform operations and acquisition. The README documents the search capabilities and queue-based indexing; sampled source confirms several API ownership paths, while some search wiring is inferred only at service-boundary level.

Main entry points: [`apps/api/src/prisma/prisma.service.ts`](https://github.com/extim-org/saas-core/blob/main/apps/api/src/prisma/prisma.service.ts) (PostgreSQL), [`apps/dashboard/src/app/store/[projectId]/page.tsx`](https://github.com/extim-org/saas-core/blob/main/apps/dashboard/src/app/store/%5BprojectId%5D/page.tsx) (Hosted Storefront), [`apps/search-api/src/search.controller.ts`](https://github.com/extim-org/saas-core/blob/main/apps/search-api/src/search.controller.ts) (Search API), [`apps/dashboard/src/app/(dashboard)/dashboard/projects/[id]/page.tsx`](https://github.com/extim-org/saas-core/blob/main/apps/dashboard/src/app/(dashboard)/dashboard/projects/%5Bid%5D/page.tsx) (Project Management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customer["Customer Platform"]
  node_dashboard["Customer Dashboard<br/>[page.tsx]"]
  node_project_pages["Project Management<br/>[page.tsx]"]
  node_storefront["Hosted Storefront<br/>[page.tsx]"]
  node_website["Marketing Website<br/>[page.tsx]"]
end

subgraph group_core["SaaS Core API"]
  node_auth_api["Authentication API<br/>[auth.controller.ts]"]
  node_auth_service["Authentication Logic<br/>[auth.service.ts]"]
  node_users["User Management<br/>[users.service.ts]"]
  node_projects_api["Projects API"]
  node_projects_service["Project Logic"]
  node_members_api["Project Members"]
  node_domains_api["Domain Management"]
  node_products_api["Search Products"]
  node_public_api["Public API"]
  node_db[("PostgreSQL<br/>[prisma.service.ts]")]
  node_email["Email Service<br/>[email.service.ts]"]
end

subgraph group_search["Search Product"]
  node_search_api["Search API"]
  node_crawl_scheduler["Crawl Scheduler"]
  node_crawl_worker["Crawl Worker<br/>[crawl.processor.ts]"]
  node_search_index[("Typesense Index")]
  node_crawl_queue["BullMQ Queue"]
  node_search_widget["Search Widget<br/>[widget.js]"]
end

subgraph group_commerce["Storefront Commerce"]
  node_cart_api["Cart API<br/>[cart.controller.ts]"]
  node_checkout_api["Checkout API"]
  node_orders_api["Orders API"]
end

subgraph group_operations["Platform Operations"]
  node_admin_ui["Admin Console<br/>[page.tsx]"]
  node_admin_api["Admin Operations"]
end

node_customer(("Customer"))
node_typesense[("Typesense")]
node_redis[("Redis")]

node_customer -->|"manages account"| node_dashboard
node_customer -->|"browses store"| node_storefront
node_customer -->|"discovers platform"| node_website
node_dashboard -->|"authenticates via"| node_auth_api
node_dashboard -->|"manages projects"| node_projects_api
node_project_pages -->|"manages members"| node_members_api
node_project_pages -->|"configures domains"| node_domains_api
node_project_pages -->|"configures products"| node_products_api
node_auth_api -->|"dispatches"| node_auth_service
node_auth_service -->|"checks and updates"| node_users
node_auth_service -->|"sends welcome email"| node_email
node_projects_api -->|"dispatches"| node_projects_service
node_projects_api -->|"reads and writes"| node_db
node_members_api -->|"reads and writes"| node_db
node_domains_api -->|"reads and writes"| node_db
node_products_api -->|"reads and writes"| node_db
node_projects_service -->|"reads and writes"| node_db
node_domains_api -->|"configures crawling"| node_crawl_scheduler
node_crawl_scheduler -->|"enqueues crawls"| node_crawl_queue
node_crawl_worker -->|"consumes jobs"| node_crawl_queue
node_crawl_worker -->|"indexes content"| node_search_index
node_search_index -->|"stores documents"| node_typesense
node_search_api -->|"queries index"| node_typesense
node_search_widget -->|"requests search"| node_search_api
node_storefront -.->|"embeds search"| node_search_widget
node_public_api -->|"proxies search"| node_search_api
node_storefront -->|"manages cart"| node_cart_api
node_cart_api -->|"reads and writes"| node_db
node_storefront -->|"submits checkout"| node_checkout_api
node_checkout_api -->|"reads and writes"| node_db
node_storefront -->|"views orders"| node_orders_api
node_orders_api -->|"reads and writes"| node_db
node_admin_ui -->|"requests operations"| node_admin_api
node_admin_api -->|"reads and writes"| node_db
node_admin_api -->|"fetches search stats"| node_search_api
node_crawl_queue -->|"stores job state"| node_redis

click node_dashboard "https://github.com/extim-org/saas-core/blob/main/apps/dashboard/src/app/(dashboard)/dashboard/page.tsx"
click node_project_pages "https://github.com/extim-org/saas-core/blob/main/apps/dashboard/src/app/(dashboard)/dashboard/projects/%5Bid%5D/page.tsx"
click node_storefront "https://github.com/extim-org/saas-core/blob/main/apps/dashboard/src/app/store/%5BprojectId%5D/page.tsx"
click node_website "https://github.com/extim-org/saas-core/blob/main/apps/website/src/app/page.tsx"
click node_auth_api "https://github.com/extim-org/saas-core/blob/main/apps/api/src/auth/auth.controller.ts"
click node_auth_service "https://github.com/extim-org/saas-core/blob/main/apps/api/src/auth/auth.service.ts"
click node_users "https://github.com/extim-org/saas-core/blob/main/apps/api/src/users/users.service.ts"
click node_projects_api "https://github.com/extim-org/saas-core/blob/main/apps/api/src/projects/projects.controller.ts"
click node_projects_service "https://github.com/extim-org/saas-core/blob/main/apps/api/src/projects/projects.service.ts"
click node_members_api "https://github.com/extim-org/saas-core/blob/main/apps/api/src/project-members/project-members.controller.ts"
click node_domains_api "https://github.com/extim-org/saas-core/blob/main/apps/api/src/domains/domains.controller.ts"
click node_products_api "https://github.com/extim-org/saas-core/blob/main/apps/api/src/products/products.controller.ts"
click node_public_api "https://github.com/extim-org/saas-core/blob/main/apps/api/src/public-api/public-api.controller.ts"
click node_db "https://github.com/extim-org/saas-core/blob/main/apps/api/src/prisma/prisma.service.ts"
click node_search_api "https://github.com/extim-org/saas-core/blob/main/apps/search-api/src/search.controller.ts"
click node_crawl_scheduler "https://github.com/extim-org/saas-core/blob/main/apps/search-api/src/crawl-scheduler.service.ts"
click node_crawl_worker "https://github.com/extim-org/saas-core/blob/main/apps/search-worker/src/crawl.processor.ts"
click node_search_index "https://github.com/extim-org/saas-core/blob/main/apps/search-api/src/typesense-schema.service.ts"
click node_search_widget "https://github.com/extim-org/saas-core/blob/main/apps/dashboard/public/widget.js"
click node_cart_api "https://github.com/extim-org/saas-core/blob/main/apps/api/src/cart/cart.controller.ts"
click node_checkout_api "https://github.com/extim-org/saas-core/blob/main/apps/api/src/checkout/checkout.controller.ts"
click node_orders_api "https://github.com/extim-org/saas-core/blob/main/apps/api/src/orders/orders.controller.ts"
click node_admin_ui "https://github.com/extim-org/saas-core/blob/main/apps/admin/src/app/(admin)/page.tsx"
click node_admin_api "https://github.com/extim-org/saas-core/blob/main/apps/api/src/admin/admin.controller.ts"
click node_email "https://github.com/extim-org/saas-core/blob/main/apps/api/src/notifications/email/email.service.ts"

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_dashboard,node_project_pages,node_storefront,node_website toneBlue
class node_auth_api,node_auth_service,node_users,node_projects_api,node_projects_service,node_members_api,node_domains_api,node_products_api,node_public_api,node_db,node_email,node_typesense,node_redis toneAmber
class node_search_api,node_crawl_scheduler,node_crawl_worker,node_search_index,node_crawl_queue,node_search_widget toneMint
class node_cart_api,node_checkout_api,node_orders_api toneRose
class node_admin_ui,node_admin_api,node_customer toneIndigo
```

## Components

### Customer Platform

- [Customer Dashboard](https://github.com/extim-org/saas-core/blob/main/apps/dashboard/src/app/(dashboard)/dashboard/page.tsx): `apps/dashboard/src/app/(dashboard)/dashboard/page.tsx`
- [Project Management](https://github.com/extim-org/saas-core/blob/main/apps/dashboard/src/app/(dashboard)/dashboard/projects/%5Bid%5D/page.tsx): `apps/dashboard/src/app/(dashboard)/dashboard/projects/[id]/page.tsx`
- [Hosted Storefront](https://github.com/extim-org/saas-core/blob/main/apps/dashboard/src/app/store/%5BprojectId%5D/page.tsx): `apps/dashboard/src/app/store/[projectId]/page.tsx`
- [Marketing Website](https://github.com/extim-org/saas-core/blob/main/apps/website/src/app/page.tsx): `apps/website/src/app/page.tsx`

### SaaS Core API

- [Authentication API](https://github.com/extim-org/saas-core/blob/main/apps/api/src/auth/auth.controller.ts): `apps/api/src/auth/auth.controller.ts`
- [Authentication Logic](https://github.com/extim-org/saas-core/blob/main/apps/api/src/auth/auth.service.ts): `apps/api/src/auth/auth.service.ts`
- [User Management](https://github.com/extim-org/saas-core/blob/main/apps/api/src/users/users.service.ts): `apps/api/src/users/users.service.ts`
- [Projects API](https://github.com/extim-org/saas-core/blob/main/apps/api/src/projects/projects.controller.ts): `apps/api/src/projects/projects.controller.ts`
- [Project Logic](https://github.com/extim-org/saas-core/blob/main/apps/api/src/projects/projects.service.ts): `apps/api/src/projects/projects.service.ts`
- [Project Members](https://github.com/extim-org/saas-core/blob/main/apps/api/src/project-members/project-members.controller.ts): `apps/api/src/project-members/project-members.controller.ts`
- [Domain Management](https://github.com/extim-org/saas-core/blob/main/apps/api/src/domains/domains.controller.ts): `apps/api/src/domains/domains.controller.ts`
- [Search Products](https://github.com/extim-org/saas-core/blob/main/apps/api/src/products/products.controller.ts): `apps/api/src/products/products.controller.ts`
- [Public API](https://github.com/extim-org/saas-core/blob/main/apps/api/src/public-api/public-api.controller.ts): `apps/api/src/public-api/public-api.controller.ts`
- [PostgreSQL](https://github.com/extim-org/saas-core/blob/main/apps/api/src/prisma/prisma.service.ts): `apps/api/src/prisma/prisma.service.ts`
- [Email Service](https://github.com/extim-org/saas-core/blob/main/apps/api/src/notifications/email/email.service.ts): `apps/api/src/notifications/email/email.service.ts`

### Search Product

- [Search API](https://github.com/extim-org/saas-core/blob/main/apps/search-api/src/search.controller.ts): `apps/search-api/src/search.controller.ts`
- [Crawl Scheduler](https://github.com/extim-org/saas-core/blob/main/apps/search-api/src/crawl-scheduler.service.ts): `apps/search-api/src/crawl-scheduler.service.ts`
- [Crawl Worker](https://github.com/extim-org/saas-core/blob/main/apps/search-worker/src/crawl.processor.ts): `apps/search-worker/src/crawl.processor.ts`
- [Typesense Index](https://github.com/extim-org/saas-core/blob/main/apps/search-api/src/typesense-schema.service.ts): `apps/search-api/src/typesense-schema.service.ts`
- **BullMQ Queue**
- [Search Widget](https://github.com/extim-org/saas-core/blob/main/apps/dashboard/public/widget.js): `apps/dashboard/public/widget.js`

### Storefront Commerce

- [Cart API](https://github.com/extim-org/saas-core/blob/main/apps/api/src/cart/cart.controller.ts): `apps/api/src/cart/cart.controller.ts`
- [Checkout API](https://github.com/extim-org/saas-core/blob/main/apps/api/src/checkout/checkout.controller.ts): `apps/api/src/checkout/checkout.controller.ts`
- [Orders API](https://github.com/extim-org/saas-core/blob/main/apps/api/src/orders/orders.controller.ts): `apps/api/src/orders/orders.controller.ts`

### Platform Operations

- [Admin Console](https://github.com/extim-org/saas-core/blob/main/apps/admin/src/app/(admin)/page.tsx): `apps/admin/src/app/(admin)/page.tsx`
- [Admin Operations](https://github.com/extim-org/saas-core/blob/main/apps/api/src/admin/admin.controller.ts): `apps/api/src/admin/admin.controller.ts`

### Other components

- **Customer**
- **Typesense**
- **Redis**

## Connections

- Customer → Customer Dashboard: manages account
- Customer → Hosted Storefront: browses store
- Customer → Marketing Website: discovers platform
- Customer Dashboard → Authentication API: authenticates via
- Customer Dashboard → Projects API: manages projects
- Project Management → Project Members: manages members
- Project Management → Domain Management: configures domains
- Project Management → Search Products: configures products
- Authentication API → Authentication Logic: dispatches
- Authentication Logic → User Management: checks and updates
- Authentication Logic → Email Service: sends welcome email
- Projects API → Project Logic: dispatches
- Projects API → PostgreSQL: reads and writes
- Project Members → PostgreSQL: reads and writes
- Domain Management → PostgreSQL: reads and writes
- Search Products → PostgreSQL: reads and writes
- Project Logic → PostgreSQL: reads and writes
- Domain Management → Crawl Scheduler: configures crawling
- Crawl Scheduler → BullMQ Queue: enqueues crawls
- Crawl Worker → BullMQ Queue: consumes jobs
- Crawl Worker → Typesense Index: indexes content
- Typesense Index → Typesense: stores documents
- Search API → Typesense: queries index
- Search Widget → Search API: requests search
- Hosted Storefront → Search Widget: embeds search
- Public API → Search API: proxies search
- Hosted Storefront → Cart API: manages cart
- Cart API → PostgreSQL: reads and writes
- Hosted Storefront → Checkout API: submits checkout
- Checkout API → PostgreSQL: reads and writes
- Hosted Storefront → Orders API: views orders
- Orders API → PostgreSQL: reads and writes
- Admin Console → Admin Operations: requests operations
- Admin Operations → PostgreSQL: reads and writes
- Admin Operations → Search API: fetches search stats
- BullMQ Queue → Redis: stores job state
