Digital - Documentation Index

Project: Digital - Enterprise Business Management Platform Generated: 2025-10-16 Total Documentation: 7 files (~127 KB) Framework: Laravel 10.x REST API


Welcome

This documentation provides comprehensive technical and functional information about the Digital platform - an enterprise-level Laravel REST API backend serving VueJS frontend and mobile applications.

The platform provides comprehensive business management capabilities including HR, CRM, Project Management, Asset Management, Procedures, OKR tracking, Vacation management, and AI-powered features.


Quick Facts

Metric Value
Eloquent Models 131 models
API Controllers 99 controllers
Database Tables ~370 tables (368 migrations)
API Endpoints ~400+ RESTful endpoints
Business Modules 8 core modules
Supported Languages 5 (de, en, es, it, ro)
Architecture Multi-tenant SaaS with row-level tenancy
Authentication Laravel Sanctum (token-based)

Documentation Structure

📋 1. Project Overview (13 KB)

Purpose: Executive summary and high-level understanding of the platform

Best For: - New team members onboarding - Management and stakeholders - Quick project introduction - Understanding business modules

Key Sections: - Executive Summary & Quick Stats - Project Purpose & Business Modules - Technology Stack & Integrations - Authentication & Permission System - Database Architecture Overview - API Design & Real-Time Features - Internationalization (5 languages)

What You’ll Learn: - What the platform does - Which business problems it solves - Key technologies used - Module breakdown (HR, CRM, Projects, Procedures, OKR, Vacation, Assets, AI)


🏗️ 2. System Architecture (18 KB)

Purpose: Comprehensive architectural documentation

Best For: - System architects - Senior developers - DevOps engineers - Security auditors - Technical decision-makers

Key Sections: - High-Level Architecture Diagram - Architecture Principles (Separation of Concerns, DRY, Security) - System Components (Laravel MVC, 8 modules) - Data Architecture (Multi-tenancy, Database Patterns) - API Architecture (RESTful Design, Middleware Stack) - Authentication & Authorization (Sanctum, Rights System) - Real-Time Architecture (WebSockets, Push Notifications) - Integration Architecture (AWS S3, Meilisearch, OpenAI, Stripe) - Deployment Architecture & Scaling - Security Architecture & Performance Optimization

What You’ll Learn: - How the system is structured - Multi-tenancy implementation - Permission system design - Real-time notification flow - Third-party integrations - Scaling strategies


📁 3. Source Tree Analysis (12 KB)

Purpose: Annotated directory structure and file organization

Best For: - New developers - Code navigation - Understanding project structure - Finding specific functionality

Key Sections: - Directory Overview (complete tree) - Application Code (/app) breakdown - Critical Directories (Controllers, Models, Migrations, Enums, Managers) - Configuration Files (/config) - Frontend Assets (/resources) - BMAD System (/bmad) - Entry Points & Critical Files - Key File Counts

What You’ll Learn: - Where to find specific files - Project organization logic - Critical entry points - File naming conventions - Module-specific directories


🔌 4. API Contracts (16 KB)

Purpose: Complete API endpoint reference

Best For: - Frontend developers - Mobile app developers - API consumers - Integration developers - QA engineers

Key Sections: - API Overview & Authentication - Controllers by Module: - HR & User Management (UserController, DepartmentController, RoleController) - CRM (DealController, OrganizationController, PersonController) - Projects & Tasks (ProjectController, TaskController, MeetingController) - Procedures (ProcedureController, ProcedureLogController) - OKR (ObjectiveController, KeyResultController) - Vacation (VacationDayController) - Asset Management (AssetManagementController) - AI (AIController) - Shared Controllers (CommentController, TagController, FileController) - Standard Response Formats - Common Query Parameters (filtering, pagination, sorting, search) - Error Status Codes - Rate Limiting

What You’ll Learn: - All available API endpoints - Request/response formats - Authentication requirements - Query parameters - Error handling

API Format: GET /api/users # List users POST /api/users # Create user GET /api/users/{id} # Get user PUT /api/users/{id} # Update user DELETE /api/users/{id} # Delete user


🗄️ 5. Data Models (46 KB)

Purpose: Database schema and model relationships

Best For: - Backend developers - Database administrators - Data analysts - System architects - Understanding data flow

Key Sections: - Database Architecture (Multi-tenancy, Scale) - Model Patterns (Traits, Soft Deletes, Audit Trail, Search) - Models by Module: - HR Module: User (100+ relationships), Department, Role, Right, Skill, UserFile, UserEvaluation - CRM Module: Deal, Organization, Person, Pipeline, Stage - Projects Module: Task, Project, Meeting, TaskTimer - Procedures Module: Procedure, Process, ProcessVersion, ProcedureLog - OKR Module: Objective, KeyResult, MasterGoal, Indicator - Vacation Module: VacationDay, VacationType, VacationPlanner - Asset Module: AssetManagementItem, AssetManagement - AI Module: AiAgent, AiModel, AiThread, AiPrompt - Shared Models: Comment, Tag, NotificationLog, CustomField, ModelHistory - Relationship Diagrams - Database Indexes

What You’ll Learn: - All 131 Eloquent models - Model relationships - Multi-tenancy pattern - Polymorphic models - Custom field system - Audit trail implementation


💻 6. Development Guide (22 KB)

Purpose: Local development setup, workflow, and coding standards

Best For: - New developers - DevOps engineers - Setting up local environment - Daily development tasks - Understanding coding standards

Key Sections: - System Requirements (PHP 8.2+, MySQL, Redis, Node.js) - Initial Setup (step-by-step guide) - Environment Configuration: - Core Application Settings - Database Configuration - Redis Configuration - AWS S3 Configuration - Email Configuration - Meilisearch Configuration - OpenAI Configuration - WebSocket Configuration - Firebase Configuration - Stripe Configuration - Database Setup (migrations, seeders) - Common Commands (Artisan, Queue, Cache, Assets) - Development Workflow - Development Standards & Best Practices ⭐ NEW - Controllers (Model Binding, Instance Binding, Resources) - Requests & Validation (FormRequest, validated()) - Models (SoftDeletes, instance_id, Relationships) - Resources & API Responses - Authorization & Middleware - Translations & Texts - Creating New API Endpoints (complete example) - Testing - Debugging (Telescope, Debug Bar, Query Logging) - Common Development Tasks - Troubleshooting

What You’ll Learn: - How to set up local environment - How to configure services - Daily development commands - Mandatory coding standards and best practices - How to create new features - How to debug issues - Common problems and solutions


🔧 7. Feature Guides (New)

Purpose: Developer guides for major features and systems

Best For: - Developers using specific features - Understanding feature implementation - Code examples and best practices

Current Guides: - Polymorphic Tags - Using the unified tagging system across all entities

What You’ll Learn: - How to use specific features in code - API/interface documentation - Code examples and patterns - Performance considerations - Troubleshooting


🔄 8. Migration Guides (New)

Purpose: Documentation for major database and system migrations

Best For: - Understanding past migrations - Reference for future migrations - Rollback procedures

Current Guides: - Polymorphic Tags Migration - Migration from 8 pivot tables to unified polymorphic table

What You’ll Learn: - Step-by-step migration process - Validation and testing procedures - Rollback strategies - Performance impact analysis


📝 9. Project Retrospectives (New)

Purpose: Lessons learned from major projects

Best For: - Understanding past decisions - Learning from team experience - Planning similar projects

Current Retrospectives: - Polymorphic Tags Migration (Oct 2025) - Tag system migration retrospective

What You’ll Learn: - What went well and what didn’t - Key metrics and results - Technical decisions and rationale - Recommendations for future projects


Quick Navigation

By Role

🆕 New Team Member: 1. Start with Project Overview - understand what we’re building 2. Read Development Guide - set up your environment 3. Browse Source Tree Analysis - learn where things are 4. Reference API Contracts - understand endpoints 5. Check Feature Guides - learn how to use specific features

👨‍💻 Backend Developer: 1. Data Models - understand database structure 2. Architecture - learn system design 3. Development Guide - daily workflow 4. API Contracts - endpoint reference 5. Feature Guides - implementation references 6. Migration Guides - past migrations reference

🎨 Frontend Developer: 1. API Contracts - all endpoints and formats 2. Project Overview - business modules 3. Data Models - understand data relationships

🏗️ System Architect: 1. Architecture - system design and patterns 2. Data Models - data architecture 3. Project Overview - technology stack 4. Retrospectives - past decisions and learnings 5. Migration Guides - understanding system evolution

🔧 DevOps Engineer: 1. Development Guide - environment setup 2. Architecture - deployment architecture 3. Project Overview - integrations and services


By Task

Setting up local development:Development Guide - Initial Setup

Understanding a specific module:Project Overview - Business Modules

Finding a model’s relationships:Data Models - Relationship Diagrams

Checking available API endpoints:API Contracts - By Module

Understanding permissions:Architecture - Authentication & Authorization

Locating a file:Source Tree Analysis - Critical Directories

Running migrations:Development Guide - Database Setup

Debugging issues:Development Guide - Debugging

Troubleshooting errors:Development Guide - Troubleshooting


Module Quick Reference

HR & User Management Module


CRM Module


Projects & Tasks Module


Procedures Module


OKR Module


Vacation Module


Asset Management Module


AI Module


Technology Stack Reference

Core Framework

Authentication & Security

Search & Caching

Real-Time Features

Cloud Services

Frontend Integration


Common Patterns

Multi-Tenancy Pattern

Every model automatically sets instance_id:

public static function boot(){
    parent::boot();
    self::creating(function($model){
        $authUser = Auth::user();
        if ($authUser && !$model->instance_id) {
            $model->instance_id = $authUser->instance_id;
        }
    });
}

Documentation: Architecture - Multi-Tenancy


Soft Delete Pattern

All primary models use soft deletes:

use Illuminate\Database\Eloquent\SoftDeletes;

class User extends Model
{
    use SoftDeletes;
}

Documentation: Data Models - Soft Delete Pattern


Permission Check Pattern

use App\Enums\RightEnum;

// In Controller
if (!auth()->user()->hasRight(RightEnum::ADMIN_CRM)) {
    return response()->json(['error' => 'Unauthorized'], 403);
}

Documentation: Architecture - Authorization


API Response Pattern

{
  "success": true,
  "data": {
    "id": 123,
    "name": "Example"
  },
  "message": "Operation successful"
}

Documentation: API Contracts - Response Formats


External Resources

Laravel Resources

Package Documentation

Third-Party Services


Documentation Maintenance

Last Updated

Generated By

BMAD document-project workflow v1.2.0

Contact

For documentation updates or questions, contact the development team.


Glossary

Term Definition
Instance A tenant organization in the multi-tenant system
Right A permission (NOT a job role)
Role A job position (NOT a permission)
Scope Permission level (0=NONE, 1=OWN, 2=DEPT, 3=ALL)
Sanctum Token API authentication token
Soft Delete Marking records as deleted without removing from database
Polymorphic Model that can relate to multiple other model types
Pivot Table Junction table for many-to-many relationships
Scout Laravel’s full-text search abstraction
Eloquent Laravel’s ORM (Object-Relational Mapping)
Artisan Laravel’s command-line interface
Migration Database schema version control
Seeder Database data population script
Factory Model instance generator for testing
Middleware HTTP request filter/modifier
Form Request Request validation class
Resource API response transformer

File Sizes Summary

File Size Lines
project-overview.md 13 KB ~507 lines
architecture.md 18 KB ~698 lines
source-tree-analysis.md 12 KB ~405 lines
api-contracts.md 16 KB ~620 lines
data-models.md 46 KB ~1,800 lines
development-guide.md 22 KB ~950 lines
index.md ~10 KB ~550 lines
Total ~127 KB ~5,530 lines

Version History

Version Date Changes
1.0.0 2025-10-16 Initial comprehensive documentation generated

🎉 Documentation Complete!

You now have comprehensive documentation covering all aspects of the Digital platform. Start with the Project Overview and navigate based on your role and needs.

Happy coding! 🚀