# Fiberportal – AI Context File

## Project Name
Fiberportal

## System Type
Modular SaaS platform for fiber infrastructure project management.

## Main Business Goal
Build a clean, scalable SaaS platform for:
- fiber project management
- densification case handling
- customer insight
- contractor collaboration
- document and task follow-up

## Technology
Backend: PHP
Frontend: JavaScript
Database: MySQL

## Core Architecture
- Multi-tenant
- Modular
- Role-based permissions
- API-first backend
- One database, many tables
- Prefix-based database naming

## Prefix Strategy
Core:
fp_*

Modules:
fp_mod_<module>_*

## 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

## Important Rules
- Never create tables without the correct prefix
- All tenant data must contain tenant_id
- Status values should use status tables
- Modules must remain isolated from the core where possible
- The platform should be extensible without redesigning the core

## Important Docs
- docs/architecture.md
- docs/modules.md
- docs/module_blueprint.md
- docs/coding_guidelines.md
- docs/database.md
- docs/ai_rules.md
