# medpro26/batiplusmaroc architecture

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

- Interactive diagram: https://gitdiagram.com/medpro26/batiplusmaroc
- Repository: https://github.com/medpro26/batiplusmaroc

## Overview

BatiPlusMaroc is a construction-services site and client–company marketplace. The main journey is a client creating a project, companies discovering it and submitting quotes, then participants coordinating site visits and final quotes through conversation. Separate surfaces support company profiles and portfolios, public service and project discovery, administration, and SEO content management. The tree and excerpts establish these product areas, but most page-to-Convex bindings are unsampled; those connections are therefore not asserted here.

Main entry points: [`convex/siteVisits/index.ts`](https://github.com/medpro26/batiplusmaroc/blob/main/convex/siteVisits/index.ts) (Visit services), [`convex/schema.ts`](https://github.com/medpro26/batiplusmaroc/blob/main/convex/schema.ts) (Convex data), [`convex/finalQuotes/index.ts`](https://github.com/medpro26/batiplusmaroc/blob/main/convex/finalQuotes/index.ts) (Final quote services), [`app/[locale]/(public)/contactez-nous/page.tsx`](https://github.com/medpro26/batiplusmaroc/blob/main/app/%5Blocale%5D/(public)/contactez-nous/page.tsx) (Contact form)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public discovery"]
  node_public_site["Public site<br/>[page.tsx]"]
  node_public_projects["Project discovery<br/>[page.tsx]"]
  node_public_companies["Company directory<br/>[page.tsx]"]
  node_contact["Contact form<br/>[page.tsx]"]
  node_contact_api["Contact email API<br/>[route.ts]"]
end

subgraph group_marketplace["Marketplace workflow"]
  node_client_workspace["Client workspace<br/>[page.tsx]"]
  node_project_creation["Project creation<br/>[page.tsx]"]
  node_company_workspace["Company workspace<br/>[page.tsx]"]
  node_company_portfolio["Portfolio manager"]
  node_quote_workspaces["Quote workspaces"]
  node_site_assessments["Site assessments"]
  node_final_quote["Final quotes"]
end

subgraph group_accounts["Accounts and messaging"]
  node_messages_ui["Messages<br/>[messages-inbox.tsx]"]
  node_auth["Authentication<br/>[auth.ts]"]
end

subgraph group_operations["Operations"]
  node_admin["Admin console<br/>[page.tsx]"]
  node_seo_console["SEO workspace<br/>[page.tsx]"]
  node_seo_backend["SEO content<br/>[content.ts]"]
end

subgraph group_backend["Convex backend"]
  node_projects_backend["Project services<br/>[index.ts]"]
  node_companies_backend["Company services<br/>[index.ts]"]
  node_site_visits_backend["Visit services<br/>[index.ts]"]
  node_final_quotes_backend["Final quote services<br/>[index.ts]"]
  node_activity["Marketplace activity<br/>[model.ts]"]
  node_data_store[("Convex data<br/>[schema.ts]")]
end

node_visitor(("Visitor"))
node_client(("Client"))
node_company_user(("Company user"))
node_admin_user(("Administrator"))
node_resend["Resend email"]

node_visitor -->|"browses"| node_public_site
node_visitor -->|"browses"| node_public_projects
node_visitor -->|"browses"| node_public_companies
node_visitor -->|"submits"| node_contact
node_contact -->|"posts form"| node_contact_api
node_contact_api -->|"sends email"| node_resend
node_client -->|"uses"| node_client_workspace
node_client -->|"creates project"| node_project_creation
node_company_user -->|"uses"| node_company_workspace
node_company_user -->|"manages portfolio"| node_company_portfolio
node_client -->|"reviews quotes"| node_quote_workspaces
node_company_user -->|"submits quote"| node_quote_workspaces
node_client -->|"coordinates visit"| node_site_assessments
node_company_user -->|"coordinates visit"| node_site_assessments
node_client -->|"reviews quote"| node_final_quote
node_company_user -->|"submits quote"| node_final_quote
node_client -->|"messages"| node_messages_ui
node_company_user -->|"messages"| node_messages_ui
node_client_workspace -->|"requires identity"| node_auth
node_company_workspace -->|"requires identity"| node_auth
node_admin_user -->|"manages platform"| node_admin
node_seo_console -->|"manages content"| node_seo_backend
node_site_visits_backend -->|"checks project access"| node_projects_backend
node_site_visits_backend -->|"records activity"| node_activity
node_final_quotes_backend -->|"checks visit state"| node_site_visits_backend
node_final_quotes_backend -->|"records activity"| node_activity
node_companies_backend -->|"reads and writes"| node_data_store
node_projects_backend -->|"reads and writes"| node_data_store
node_site_visits_backend -->|"reads and writes"| node_data_store
node_final_quotes_backend -->|"reads and writes"| node_data_store

click node_public_site "https://github.com/medpro26/batiplusmaroc/blob/main/app/%5Blocale%5D/(public)/page.tsx"
click node_public_projects "https://github.com/medpro26/batiplusmaroc/blob/main/app/%5Blocale%5D/(public)/projets/page.tsx"
click node_public_companies "https://github.com/medpro26/batiplusmaroc/blob/main/app/%5Blocale%5D/(public)/entreprises/page.tsx"
click node_contact "https://github.com/medpro26/batiplusmaroc/blob/main/app/%5Blocale%5D/(public)/contactez-nous/page.tsx"
click node_contact_api "https://github.com/medpro26/batiplusmaroc/blob/main/app/api/contact/route.ts"
click node_client_workspace "https://github.com/medpro26/batiplusmaroc/blob/main/app/%5Blocale%5D/(account)/espace-client/page.tsx"
click node_project_creation "https://github.com/medpro26/batiplusmaroc/blob/main/app/%5Blocale%5D/(account)/espace-client/projets/nouveau/page.tsx"
click node_company_workspace "https://github.com/medpro26/batiplusmaroc/blob/main/app/%5Blocale%5D/(account)/espace-entreprise/page.tsx"
click node_company_portfolio "https://github.com/medpro26/batiplusmaroc/blob/main/features/portfolio/components/portfolio-manager.tsx"
click node_quote_workspaces "https://github.com/medpro26/batiplusmaroc/blob/main/features/quotes/components/company-initial-quote-workspace.tsx"
click node_site_assessments "https://github.com/medpro26/batiplusmaroc/blob/main/features/site-assessments/components/site-assessment-panel.tsx"
click node_final_quote "https://github.com/medpro26/batiplusmaroc/blob/main/features/final-quotes/components/conversation-final-quote-panel.tsx"
click node_messages_ui "https://github.com/medpro26/batiplusmaroc/blob/main/features/messages/components/messages-inbox.tsx"
click node_auth "https://github.com/medpro26/batiplusmaroc/blob/main/convex/auth.ts"
click node_admin "https://github.com/medpro26/batiplusmaroc/blob/main/app/%5Blocale%5D/(admin)/admin/page.tsx"
click node_seo_console "https://github.com/medpro26/batiplusmaroc/blob/main/app/%5Blocale%5D/(seo)/seo/page.tsx"
click node_seo_backend "https://github.com/medpro26/batiplusmaroc/blob/main/convex/seo/content.ts"
click node_projects_backend "https://github.com/medpro26/batiplusmaroc/blob/main/convex/projects/index.ts"
click node_companies_backend "https://github.com/medpro26/batiplusmaroc/blob/main/convex/companies/index.ts"
click node_site_visits_backend "https://github.com/medpro26/batiplusmaroc/blob/main/convex/siteVisits/index.ts"
click node_final_quotes_backend "https://github.com/medpro26/batiplusmaroc/blob/main/convex/finalQuotes/index.ts"
click node_activity "https://github.com/medpro26/batiplusmaroc/blob/main/convex/marketplaceActivity/model.ts"
click node_data_store "https://github.com/medpro26/batiplusmaroc/blob/main/convex/schema.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_public_site,node_public_projects,node_public_companies,node_contact,node_contact_api,node_client,node_company_user toneBlue
class node_client_workspace,node_project_creation,node_company_workspace,node_company_portfolio,node_quote_workspaces,node_site_assessments,node_final_quote toneAmber
class node_messages_ui,node_auth toneMint
class node_admin,node_seo_console,node_seo_backend toneRose
class node_projects_backend,node_companies_backend,node_site_visits_backend,node_final_quotes_backend,node_activity,node_data_store,node_visitor,node_admin_user,node_resend toneIndigo
```

## Components

### Public discovery

- [Public site](https://github.com/medpro26/batiplusmaroc/blob/main/app/%5Blocale%5D/(public)/page.tsx): `app/[locale]/(public)/page.tsx`
- [Project discovery](https://github.com/medpro26/batiplusmaroc/blob/main/app/%5Blocale%5D/(public)/projets/page.tsx): `app/[locale]/(public)/projets/page.tsx`
- [Company directory](https://github.com/medpro26/batiplusmaroc/blob/main/app/%5Blocale%5D/(public)/entreprises/page.tsx): `app/[locale]/(public)/entreprises/page.tsx`
- [Contact form](https://github.com/medpro26/batiplusmaroc/blob/main/app/%5Blocale%5D/(public)/contactez-nous/page.tsx): `app/[locale]/(public)/contactez-nous/page.tsx`
- [Contact email API](https://github.com/medpro26/batiplusmaroc/blob/main/app/api/contact/route.ts): `app/api/contact/route.ts`

### Marketplace workflow

- [Client workspace](https://github.com/medpro26/batiplusmaroc/blob/main/app/%5Blocale%5D/(account)/espace-client/page.tsx): `app/[locale]/(account)/espace-client/page.tsx`
- [Project creation](https://github.com/medpro26/batiplusmaroc/blob/main/app/%5Blocale%5D/(account)/espace-client/projets/nouveau/page.tsx): `app/[locale]/(account)/espace-client/projets/nouveau/page.tsx`
- [Company workspace](https://github.com/medpro26/batiplusmaroc/blob/main/app/%5Blocale%5D/(account)/espace-entreprise/page.tsx): `app/[locale]/(account)/espace-entreprise/page.tsx`
- [Portfolio manager](https://github.com/medpro26/batiplusmaroc/blob/main/features/portfolio/components/portfolio-manager.tsx): `features/portfolio/components/portfolio-manager.tsx`
- [Quote workspaces](https://github.com/medpro26/batiplusmaroc/blob/main/features/quotes/components/company-initial-quote-workspace.tsx): `features/quotes/components/company-initial-quote-workspace.tsx`
- [Site assessments](https://github.com/medpro26/batiplusmaroc/blob/main/features/site-assessments/components/site-assessment-panel.tsx): `features/site-assessments/components/site-assessment-panel.tsx`
- [Final quotes](https://github.com/medpro26/batiplusmaroc/blob/main/features/final-quotes/components/conversation-final-quote-panel.tsx): `features/final-quotes/components/conversation-final-quote-panel.tsx`

### Accounts and messaging

- [Messages](https://github.com/medpro26/batiplusmaroc/blob/main/features/messages/components/messages-inbox.tsx): `features/messages/components/messages-inbox.tsx`
- [Authentication](https://github.com/medpro26/batiplusmaroc/blob/main/convex/auth.ts): `convex/auth.ts`

### Operations

- [Admin console](https://github.com/medpro26/batiplusmaroc/blob/main/app/%5Blocale%5D/(admin)/admin/page.tsx): `app/[locale]/(admin)/admin/page.tsx`
- [SEO workspace](https://github.com/medpro26/batiplusmaroc/blob/main/app/%5Blocale%5D/(seo)/seo/page.tsx): `app/[locale]/(seo)/seo/page.tsx`
- [SEO content](https://github.com/medpro26/batiplusmaroc/blob/main/convex/seo/content.ts): `convex/seo/content.ts`

### Convex backend

- [Project services](https://github.com/medpro26/batiplusmaroc/blob/main/convex/projects/index.ts): `convex/projects/index.ts`
- [Company services](https://github.com/medpro26/batiplusmaroc/blob/main/convex/companies/index.ts): `convex/companies/index.ts`
- [Visit services](https://github.com/medpro26/batiplusmaroc/blob/main/convex/siteVisits/index.ts): `convex/siteVisits/index.ts`
- [Final quote services](https://github.com/medpro26/batiplusmaroc/blob/main/convex/finalQuotes/index.ts): `convex/finalQuotes/index.ts`
- [Marketplace activity](https://github.com/medpro26/batiplusmaroc/blob/main/convex/marketplaceActivity/model.ts): `convex/marketplaceActivity/model.ts`
- [Convex data](https://github.com/medpro26/batiplusmaroc/blob/main/convex/schema.ts): `convex/schema.ts`

### Other components

- **Visitor**
- **Client**
- **Company user**
- **Administrator**
- **Resend email**

## Connections

- Visitor → Public site: browses
- Visitor → Project discovery: browses
- Visitor → Company directory: browses
- Visitor → Contact form: submits
- Contact form → Contact email API: posts form
- Contact email API → Resend email: sends email
- Client → Client workspace: uses
- Client → Project creation: creates project
- Company user → Company workspace: uses
- Company user → Portfolio manager: manages portfolio
- Client → Quote workspaces: reviews quotes
- Company user → Quote workspaces: submits quote
- Client → Site assessments: coordinates visit
- Company user → Site assessments: coordinates visit
- Client → Final quotes: reviews quote
- Company user → Final quotes: submits quote
- Client → Messages: messages
- Company user → Messages: messages
- Client workspace → Authentication: requires identity
- Company workspace → Authentication: requires identity
- Administrator → Admin console: manages platform
- SEO workspace → SEO content: manages content
- Visit services → Project services: checks project access
- Visit services → Marketplace activity: records activity
- Final quote services → Visit services: checks visit state
- Final quote services → Marketplace activity: records activity
- Company services → Convex data: reads and writes
- Project services → Convex data: reads and writes
- Visit services → Convex data: reads and writes
- Final quote services → Convex data: reads and writes
