Open Mercato Documentation

repository·main·Indexed 23 days ago

https://github.com/open-mercato/open-mercato

An AI-Engineering Foundation Framework providing a modular, architecture-aware environment for building professional business applications such as CRM, ERP, and Commerce systems with AI assistance. Version 0.6.6.

Tokens
628.7K
Snippets
1.1K
Records
2.5K
Agent score
80%

What's inside Open Mercato

  1. Overview of Open Mercato

    main

    Open Mercato is an AI-Engineering Foundation Framework designed to provide a structured, architecture-aware environment for AI agents and developers to build professional business applications. Unlike standard code assistants, Open Mercato provides an 'AI harness' that understands project structure, allowing agents to place code correctly, implement features with tests, and maintain consistency across large teams.

    Key capabilities include:

    • Spec-first development: Reproducible AI output via repository-shipped specs.
    • Ready-made domain modules: Pre-built CRM, ERP, and Sales modules to jumpstart development.
    • Modular architecture: Auto-discovery of frontend/backend pages, APIs, and entities.
    • Multi-tenancy: Built-in SaaS-ready tenancy and hierarchical organization scoping.
  2. Overview of @open-mercato/search capabilities

    main

    The @open-mercato/search module provides a unified hybrid search solution for Open Mercato. It combines semantic (vector) and keyword (fulltext/token-based) search strategies.

    Key features include:

    • Hybrid Search Strategies: Orchestrates semantic and keyword search.
    • Strategy Fusion: Combines results with configurable fallbacks.
    • Configuration: Supports module-level search configuration via search.ts.
    • Operational Tooling: Includes reindex commands, diagnostics, and operational APIs for maintaining search indexes.
  3. Overview of the Customers CRM module

    main

    The Customers module provides a unified CRM workspace for managing companies, people, and deals. Once features are assigned using the customers.* pattern, the navigation automatically appears under the Customers section of the admin sidebar.

    Key workspaces include:

    • Companies workspace: Manage account records, activities, deals, addresses, and linked contacts.
    • People workspace: Manage contact lists, interaction timelines, and linked deals or tasks.
    • Deals workspace: Track pipeline health using lists and kanban boards, edit opportunity details, and collaborate via notes and activities.
  4. Overview of Catalog REST endpoints

    main

    The catalog module provides REST endpoints under /api/catalog/* for managing products, variants, prices, categories, and more. These endpoints are located in packages/core/src/modules/catalog/api and share several core guarantees:

    • Authentication & RBAC: Enforced via each route's metadata export.
    • Tenant Isolation: Organization/tenant scope is automatically derived from the caller; payloads never cross tenants.
    • Schema Consistency: CRUD handlers reuse the same Zod schemas as the command bus, ensuring synchronization between HTTP routes and the command bus.
    • Pagination & Filtering: Listing endpoints return a standard { items, total, page, pageSize, totalPages } format and support custom-field filters using cf_<key> or cf:<key> syntax.
  5. Overview of @open-mercato/ui components and patterns

    main

    The @open-mercato/ui package provides a composable UI toolkit designed for building Open Mercato backoffice and business applications. It offers a mix of reusable primitives and high-level backend UI patterns to ensure consistent user experience and speed up development.

    Key components and patterns include:

    • CrudForm: Patterns for creating, reading, updating, and deleting data.
    • DataTable: Components for displaying structured data.
    • Dialogs: UI elements for modal interactions.
    • Detail Sections: Layout components for displaying entity details.
    • Injections: Integration with the Open Mercato injection architecture.
    • Notifications: UI elements for system feedback and alerts.
  6. Overview of Open Mercato Enterprise Security

    main

    Open Mercato Enterprise Security provides personal account protection and operational security controls. It is designed for teams requiring enhanced sign-in protection, user guidance for account safety, and additional confirmation for high-risk business actions.

    The module focuses on three primary functional areas:

    1. Hardened self-service password changes: Enhanced user-facing password management.
    2. Multi-Factor Authentication (MFA): Support for both end users and administrators.
    3. Sudo re-authentication: Requiring re-authentication for sensitive or high-risk actions.
  7. Overview of the Customers Module (CRM)

    main

    The Customers Module provides CRM capabilities for managing people, companies, deals, and related activities. It is designed with the following characteristics:

    • Multi-tenancy: All data is scoped by organization_id and tenant_id.
    • Namespace Safety: Customer-centric entities use the customer_ prefix for database tables to prevent collisions.
    • Extensibility: Supports custom fields, tagging, and integrations with other modules like ecommerce.

    Core Data Entities:

    • customer_entities: The polymorphic root for people or companies.
    • customer_people / customer_companies: Profile tables for specific attributes.
    • customer_deals: Sales opportunities linking to people or companies.
    • customer_activities & customer_comments: Timeline history and notes.
    • customer_addresses: Labeled addresses per customer.
    • customer_tags & customer_tag_assignments: A reusable tagging system.
    • customer_todo_links: References to tasks (e.g., from the example/todos module) attached to customer records.
  8. What is @open-mercato/onboarding?

    main

    The @open-mercato/onboarding package is designed to manage the tenant onboarding and first-run experience in Open Mercato. It provides orchestration for:

    • Guided tenant bootstrap experience: Orchestrating the initial setup flows.
    • Setup defaults and example data: Providing hooks to inject initial configurations and sample data.
    • Communication flows: Supporting welcome messages and invitation-style flows for new users.
    • Time-to-value reduction: Streamlining the process from installation to active usage.
  9. Overview of Open Mercato architecture and philosophy

    main

    Open Mercato is an extensible commerce framework designed for modularity and type safety. It consists of a modular backend, a customizable admin UI, and a typed data engine.

    Key architectural principles include:

    • Composable architecture: Capabilities (authentication, dashboards, etc.) are delivered as isolated, installable modules with explicit interfaces.
    • Customizable admin & APIs: Allows overriding pages, scaffolding CRUD APIs, and tailoring dashboards.
    • Data extensibility: Supports adding tenant-specific fields and linking entities across modules via a unified engine.
    • Multi-tenancy: Built-in guards and conventions ensure data is scoped to specific organizations or tenants.
    • Type-safe workflows: Uses Zod-powered validation, Dependency Injection (DI)-driven services, and generated registries to align runtime and design-time.
  10. What is @open-mercato/core?

    main

    The @open-mercato/core package serves as the business engine for the Open Mercato platform. It provides the foundational domain modules required to build production-grade business applications, including:

    • Catalog: Product and inventory management.
    • Customers: Customer data and relationship management.
    • Sales: Transactional and sales logic.
    • Auth: Authentication and authorization services.
    • Workflows: Business process automation.
    • Settings: Application and module configuration.
    • Module Infrastructure: The underlying framework for building custom business modules.

    Key architectural features include:

    • Command-based architecture: Ensures robust writes and provides support for undo operations.
    • Security: Built-in Access Control Lists (ACL) and multi-tenancy support with secure-by-default conventions.
    • Extensibility: An extensible module system that supports automatic discovery of APIs and pages.