# Fiberportal – System Architecture

## Purpose
Fiberportal is a modular SaaS platform designed to manage fiber network projects, densification requests, construction follow-up and collaboration between network providers, contractors and project managers.

The system must support multiple organizations (tenants) using the same platform while keeping all data isolated.

## Core Principles
- Multi-tenant SaaS architecture
- Modular feature system
- Role-based access control (RBAC)
- API-first backend
- Clean separation between core and modules
- Expandable database design
- Stable core, optional modules

## Technology Stack
Backend:
PHP

Frontend:
JavaScript

Database:
MySQL

## Multi-Tenant Model
Each company using the platform is a tenant.

All tenant data must include:
tenant_id

## Core Modules
- Authentication
- Tenants
- Roles & Permissions
- Module Management
- Projects
- Cases
- Comments
- Attachments
- Notifications
- Audit Logs

## Optional Modules
- Tasks
- Milestones
- Maps / GIS
- Reporting
- Cost Estimation
- Customer Portal
- Contractor Portal
- Time Tracking
- Internal Notes
- Integrations

## Table Prefix Strategy
Core tables:
fp_*

Module tables:
fp_mod_<module>_*

Examples:
fp_projects
fp_cases
fp_mod_tasks_tasks
fp_mod_maps_layers

## Important Rule
The core system must remain generic.
Customer-specific behavior should be implemented through:
- settings
- permissions
- module activation
- module configuration
