# Solution Architecture

## Bounded domains
- **Content:** pages, page sections/blocks, menus, media, SEO and settings.
- **Portfolio:** services, sectors, projects, galleries, facts, case-study narrative and confidentiality controls.
- **People:** leadership/team profiles and discipline metadata.
- **Publishing:** posts/news, careers, tenders and downloads.
- **Engagement:** general enquiries, consultation bookings, project briefs/RFPs, newsletter subscriptions.
- **Identity:** administrators, roles, permissions and approval workflow.
- **Governance:** audit history, soft deletion, publication states and consent records.

## Public rendering
Laravel resolves slugs and fetches published CMS data on the server. Inertia SSR emits indexable HTML including title, description, canonical URL, social meta and structured data. React then hydrates the same props. Client-side navigation uses Inertia visits without full reloads.

## CMS rendering
Admin uses the same Laravel/Inertia transport but is optimized for CSR-like navigation after authentication. Every destructive/publishing action is authorized through policies/permissions, CSRF-protected, server-validated and logged.

## Content model
Most corporate pages are assembled from structured `content_blocks` JSON. A block has a stable type, version and payload. This provides flexibility while preventing raw HTML from becoming the primary content model. Rich text is sanitized before rendering.

Recommended block types:
- hero
- rich_text
- stats
- service_grid
- project_grid
- sector_grid
- process_steps
- leadership_grid
- testimonial_slider
- logo_cloud
- call_to_action
- download_list
- contact_panel

## Publishing workflow
`draft -> department_review -> ggmp_approval -> chairman_approval (when required) -> published`.

A publishable content record stores `status`, `published_at`, `submitted_by`, `approved_by`, and optional `approval_notes`. Permissions control who can move an item between states.

## Security
- Password hashing through Laravel defaults (Argon2id/Bcrypt depending deployment config).
- MFA-ready admin design; recommended enforcement for privileged roles.
- CSRF and same-site cookies for web actions.
- Server-side validation on every input.
- Fine-grained authorization through roles + policies.
- Rate limits for authentication, contact, booking, CV and RFP endpoints.
- MIME/extension/size validation for uploads; private storage for CVs and sensitive documents.
- Signed expiring download URLs for private files.
- Security headers middleware (HSTS in production, X-Content-Type-Options, Referrer-Policy, Permissions-Policy, CSP baseline).
- Audit logging for login, content changes, publishing, downloads and admin actions.
- Secrets only in environment/secret manager.
- Backup encryption and offsite copy recommended.

## Performance
- SSR and edge/browser caching for public pages.
- Database indexes on slugs/status/published timestamps and project filters.
- Responsive images, AVIF/WebP where supported, explicit width/height to prevent CLS.
- Lazy load non-LCP media; preload only true hero/LCP image.
- Font subset/preload and `font-display: swap`.
- Queue email notifications and image processing.
- Redis cache tags for menus/settings/pages and cache invalidation on publish.
- Route-level code splitting through Vite dynamic imports where appropriate.

## Integrations
Launch-ready adapters/placeholders are included for analytics, maps/social links and email. ERP/CRM synchronization should be implemented as an outbound event/queue integration so the website remains available when ERP is unavailable.
