Skip to main content

Database Schema

The Flux CRM system uses a relational database architecture built on MySQL, containing over 100 tables to support its extensive functionality. The schema is designed to handle everything from customer and sales data to product management, employee tracking, and financial reporting.

Key Concepts

The database schema is structured around several core modules:

  • Companies: Links customers, products, services, contracts, and other business entities to a company and its users.
  • Customers: Manages customer details, including contact information and sales history.
  • Products and Services: Tracks available products and services separately, including pricing and stock levels.
  • Contracts: Serves as the core of the system, linking customers, products, services, and other relevant data. Contracts represent agreements and interactions between customers and the business.
  • Employees and Timesheets: Manages employee data, work schedules, and tracks attendance and working hours.
  • Financial Data: Stores key financial metrics and transactions for accounting and reporting purposes, including payments.
  • Notifications: Manages user notifications for updates, reminders, and system events.
  • Suppliers: Tracks supplier information related to products and services.
  • Tickets: Handles support tickets and service requests from users.
  • Users: Manages system users.

Core Tables

Instead of listing every table, here are some of the most important tables that form the backbone of the system:

  • Companies: Links all relevant data such as customers, products, services, contracts, and employees to a specific company.
  • Customers: Stores customer profiles, contact information, and account details.
  • Products: Manages the inventory of products offered by the business.
  • Services: Tracks the services offered by the business.
  • Contracts: The heart of the platform, linking customers, products, services, and other relevant data. It acts as the primary table for storing agreements between companies and customers.
  • Employees: Stores employee information, including their roles, working hours, and vacation days.
  • Timesheets: Tracks employee working hours and attendance.
  • Payments: Stores payment information related to contracts and transactions.
  • Notifications: Manages notifications for users about relevant updates, system events, and reminders.
  • Suppliers: Stores information about suppliers.
  • Tickets: Handles internal service requests.
  • Users: Stores system user data, including login credentials and roles.

Relationships

  • One-to-Many: The system often uses one-to-many relationships, such as a company having multiple customers, or a contract having multiple products or services.
  • Many-to-Many: For more complex relationships, such as multiple services linked to multiple contracts, the system uses pivot tables to manage these connections.