README

Welcome to our comprehensive documentation. Get started with installation guides and explore our architecture.

πŸš€ Mercury CRM - Developer Documentation

Welcome to Mercury CRM, a powerful and scalable Customer Relationship Management system built with modern web technologies. This documentation will guide you through every aspect of our application, from initial setup to advanced customization.

🎯 What is Mercury CRM?

Mercury CRM is a comprehensive business solution featuring:

  • πŸ—οΈ HMVC Architecture - Modular, scalable, and maintainable codebase
  • πŸ“± WhatsApp Integration - Advanced Waha module for business communication
  • ☁️ Cloud Storage - Seamless AWS S3 integration
  • πŸ“Š Advanced Analytics - Real-time insights and reporting
  • πŸ”’ Enterprise Security - Multi-layer authentication and authorization
  • 🌐 Multi-tenant Support - Scalable for businesses of all sizes

⚑ Quick Start

Get up and running in 5 minutes:

# 1. Clone the repository
git clone <repository-url>
cd mercury-crm

# 2. Install dependencies
composer install
npm install

# 3. Setup environment
cp .env.example .env
php artisan key:generate

# 4. Run migrations
php artisan migrate --seed

# 5. Start development server
php artisan serve

πŸ’‘ Tip: For detailed installation instructions, see our Installation Guide

πŸ“– Documentation Sections

🏁 Getting Started

πŸ“‹ Core Modules

  • Lead Module - CRM lead management with clean architecture ⭐

πŸ›οΈ Architecture & Design

βš™οΈ Configuration & Services

πŸ—οΈ System Architecture

Our system follows an API-first architecture with clear separation between frontend and backend:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Frontend      β”‚    β”‚   API Gateway   β”‚    β”‚   Backend       β”‚
β”‚   (Next.js)     │◄──►│   (Laravel)     │◄──►│   (HMVC)        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                 β”‚
                        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                        β”‚   Services      β”‚
                        β”‚   β€’ Waha        β”‚
                        β”‚   β€’ S3 Storage  β”‚
                        β”‚   β€’ Analytics   β”‚
                        β”‚   β€’ Notificationsβ”‚
                        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

API-First Design

  • Backend: Laravel provides RESTful APIs with JWT authentication
  • Frontend: Next.js consumes APIs independently
  • Documentation: Interactive Swagger docs at /docs/admin and /docs/instructor
  • Modularity: Each service can be developed and deployed independently

πŸ› οΈ Technology Stack

Backend

  • PHP 8.4+ - Modern PHP with type declarations
  • Laravel 11 - Robust framework with advanced features
  • MySQL 8.0 - High-performance database
  • Redis - Caching and session management

Frontend

  • Next.js - React-based full-stack framework
  • React - Component-based UI library
  • TypeScript - Type-safe JavaScript development

Infrastructure

  • Docker - Containerized development environment
  • AWS S3 - Scalable file storage
  • WhatsApp API - Business communication platform

πŸ“ Module Overview

Our HMVC architecture consists of several specialized modules:

Module Purpose Key Features
Lead ⭐ CRM lead management Clean architecture, third-party integrations, edit API
Actions System actions and commands Error handling, logging
Admin Administrative interface User management, system config
Waha WhatsApp integration Message handling, webhooks
Attachment File management S3 integration, media processing
Company Business management Multi-tenant support
Instructor Training management Course and certification handling

πŸš€ Development Workflow

1. Feature Development

# Create feature branch
git checkout -b feature/new-feature

# Development workflow
composer install
npm run dev
php artisan serve

# Run tests
php artisan test
npm run test

2. Code Standards

  • PSR-12 coding standards
  • Type declarations for all methods
  • PHPDoc documentation
  • Unit & Feature tests for all new code

3. Module Creation

# Generate new module
php artisan module:make ModuleName

# Generate module components
php artisan module:make-controller ModuleName ControllerName
php artisan module:make-model ModuleName ModelName
php artisan module:make-migration ModuleName create_table_name

πŸ” Security Features

  • πŸ›‘οΈ Authentication - Multi-factor authentication support
  • πŸ”‘ Authorization - Role-based access control (RBAC)
  • πŸ”’ Data Encryption - End-to-end encryption for sensitive data
  • 🌐 API Security - JWT tokens and rate limiting
  • πŸ“‹ Audit Logging - Comprehensive activity tracking

πŸ“Š Performance & Monitoring

  • ⚑ Caching - Redis-based caching strategy
  • πŸ“ˆ Monitoring - Application performance metrics
  • πŸ” Logging - Structured logging with context
  • πŸ“± Real-time - WebSocket support for live updates

πŸ§ͺ Testing Strategy

# Run all tests
php artisan test

# Run specific test suite
php artisan test --testsuite=Unit
php artisan test --testsuite=Feature

# Generate coverage report
php artisan test --coverage

Testing Levels

  • Unit Tests - Individual component testing
  • Feature Tests - End-to-end workflow testing
  • Integration Tests - Module interaction testing

πŸš€ Deployment

Production Deployment

# Production optimization
composer install --no-dev --optimize-autoloader
php artisan config:cache
php artisan route:cache
php artisan view:cache

# Database migrations
php artisan migrate --force

# Queue processing
php artisan queue:work --daemon

Environment Requirements

  • PHP 8.4+ with required extensions
  • MySQL 8.0+ or PostgreSQL 13+
  • Redis 6.0+ for caching
  • Node.js 16+ for asset compilation

🀝 Contributing

We welcome contributions! Please follow these guidelines:

  1. Fork the repository
  2. Create a feature branch
  3. Follow our coding standards
  4. Write comprehensive tests
  5. Submit a pull request

Development Setup

# Clone your fork
git clone <your-fork-url>
cd mercury-crm

# Install dependencies
composer install
npm install

# Setup development environment
./setup-dev.sh

πŸ“ž Support & Resources

Getting Help

  • πŸ“– Documentation - Comprehensive guides and examples
  • πŸ› Issues - Report bugs and request features
  • πŸ’¬ Discussions - Community Q&A and ideas
  • πŸ“§ Contact - Direct support for enterprise users

Useful Links

πŸ—ΊοΈ Roadmap

Current Version (v2.0)

  • βœ… HMVC Architecture
  • βœ… Waha WhatsApp Integration
  • βœ… S3 File Management
  • βœ… Advanced Authentication

Upcoming Features

  • πŸ”„ GraphQL API - Modern API architecture
  • πŸ“± Mobile App - Native mobile applications
  • πŸ€– AI Integration - Intelligent automation
  • πŸ“Š Advanced Analytics - Business intelligence tools

πŸŽ‰ Ready to Build?

Choose your path:

**πŸš€ New Developer** - Start with [Installation Guide](./installation.md) - Review [HMVC Architecture](./hmvc.md) - Explore [Project Structure](./structure.md) **πŸ—οΈ Module Developer** - Study [Waha Integration](./waha.md) - Learn [S3 Storage Patterns](./S3-Storage.md) - Build custom modules **πŸ”§ System Administrator** - Configure deployment environment - Set up monitoring and logging - Manage user access and security

πŸ’‘ Pro Tip: Our documentation is interactive! Use the search feature to quickly find what you need, and don't forget to check out our Swagger API documentation for hands-on API testing.


Built with ❀️ by the Mercury CRM Team