Skip to content

ingitdb/demo-commerce-ingitdb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🛒 CRM Orders

inGitDB

Note: This schema describes and relies on features of inGitDB that may not be fully implemented yet. Its primary purpose is to drive development of inGitDB by serving as a comprehensive real-world use case and to demonstrate its capabilities for business-critical applications.

CRM Orders is an open-source inGitDB schema template for a complete company CRM, ordering, and shipping system. It models everything from ISO currency definitions and customer accounts through product catalogues, supplier management, shipping carriers, and multi-line orders — including tax rates and promotional discounts.

Because every record is a plain YAML/JSON file committed to Git, the full transaction history is an immutable audit log with zero extra infrastructure. Any developer, auditor, or AI agent can inspect, query, and amend data with a text editor or git blame.

This demo showcases inGitDB's support for foreign-key relationships, subcollections, enum constraints, regex patterns, cross-collection referential integrity, and human-readable records.

⚙️ GitHub Actions Workflow

A GitHub Actions workflow runs automatically on every push and pull request to main. It uses the ingitdb-action to:

  1. Validate — checks all collection schema definitions and verifies every record conforms to its collection's constraints (types, required fields, foreign keys, enums, regex patterns).
  2. Materialize — builds any defined views, resolving cross-collection references and producing materialized output.

📋 Collections Overview

Collection Description
currencies ISO 4217 currency definitions
exchange_rates Point-in-time currency exchange rates
countries ISO 3166-1 country codes and metadata
customers Customer accounts — the CRM core
addresses Reusable billing and shipping addresses per customer
product_categories Hierarchical product taxonomy
product_images Shareable product images
products Product catalogue with pricing and inventory
suppliers Product suppliers and vendor contacts
shippers Shipping carrier definitions
shipping_options Service levels offered by each carrier
tax_rates Tax rates by country and optional region
promotions Discount codes and coupon campaigns
orders Customer order records
order_details Line items — subcollection of orders

🗺️ Data Model

graph LR
    exchange_rates -->|from/to_currency_id| currencies
    countries -->|currency_id| currencies
    customers -->|country_id| countries
    customers -->|preferred_currency_id| currencies
    addresses -->|customer_id| customers
    addresses -->|country_id| countries
    product_categories -->|parent_category_id| product_categories
    products -->|category_id| product_categories
    products -->|supplier_id| suppliers
    products -->|image_id| product_images
    products -->|currency_id| currencies
    suppliers -->|country_id| countries
    shipping_options -->|shipper_id| shippers
    shipping_options -->|currency_id| currencies
    tax_rates -->|country_id| countries
    promotions -->|currency_id| currencies
    orders -->|customer_id| customers
    orders -->|billing_address_id| addresses
    orders -->|shipping_address_id| addresses
    orders -->|shipping_option_id| shipping_options
    orders -->|currency_id| currencies
    orders -->|promotion_id| promotions
    order_details -.->|subcollection of| orders
    order_details -->|product_id| products
    order_details -->|currency_id| currencies
Loading

For full details on each collection — columns, constraints, examples, and relationships — see collections/.

About

Demo commerce database for inGitDB

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors