A complete example application demonstrating integration with lcc-sdk.
This demo shows:
- ✅ Feature-based license control
- ✅ Automatic quota management
- ✅ Graceful degradation
- ✅ Tier-based authorization
- ✅ Usage reporting
Visual, three-stage interactive demonstration of LCC SDK capabilities:
- Product Discovery - Compare Basic/Pro/Enterprise editions with feature matrices
- Configuration Designer - Set up simulations with real SDK code examples
- Runtime Dashboard - Monitor live metrics with real-time charts
make demo
# Navigate to http://localhost:9144/discoverSee Web Demo Documentation for details.
Actual screenshots captured from the running demo application:
Configure your LCC server connection and get started with the tutorial.
Compare feature availability across Basic, Professional, and Enterprise tiers.
Understand different limitation models: quota, TPS, capacity, and concurrency.
See real code examples of how to integrate LCC SDK into your applications.
Monitor live metrics and observe license enforcement in action.
Demo App
├── Analytics Module
│ ├── AdvancedAnalytics() [Professional]
│ └── BasicAnalytics() [Basic]
├── Export Module
│ ├── ExportToCloud() [Enterprise]
│ └── ExportToLocal() [Basic]
└── Reporting Module
├── PremiumReports() [Professional]
└── StandardReports() [Basic]
-
LCC Server running
# Start LCC server (from lcc repository) cd /path/to/lcc ./lcc_server
-
Valid license file
- Place license file in
~/.lcc/license.lic - Or configure path in environment variable
- Place license file in
-
Go 1.21+
cd /path/to/lcc-demo-app
go mod download# Run with default config
make run
# Run in development mode (all features unlocked)
make run-devWhen the demo starts, it also launches a small HTTP status server that exposes runtime metrics for the four limitation models (consumption / capacity / TPS / concurrency).
- Default address:
http://localhost:8080 - HTML status page:
http://localhost:8080/status - JSON API:
http://localhost:8080/status/json
You can change the listen address/port via environment variable:
# Example: run status server on :18080
LCC_DEMO_STATUS_ADDR=:18080 make runThe JSON response looks like:
{
"advanced_calls": 3,
"pdf_exports": 2,
"projects": 5,
"last_tps": 7.5,
"concurrent_jobs": 1
}export LCC_LICENSE_TIER=basic
go run cmd/demo/main.go
# Output:
# ✓ BasicAnalytics: Success
# ✗ AdvancedAnalytics: Fallback to BasicAnalytics (tier insufficient)
# ✓ ExportToLocal: Success
# ✗ ExportToCloud: Denied (requires enterprise tier)export LCC_LICENSE_TIER=professional
go run cmd/demo/main.go
# Output:
# ✓ AdvancedAnalytics: Success (ML models enabled)
# ✓ PremiumReports: Success
# ✗ ExportToCloud: Denied (requires enterprise tier)export LCC_LICENSE_TIER=enterprise
go run cmd/demo/main.go
# Output:
# ✓ All features enabled
# ✓ Cloud export available
# ✓ Advanced ML models# AdvancedAnalytics has 1000/day quota
for i in {1..1001}; do
curl http://localhost:8080/analytics/advanced
done
# After 1000 calls:
# ⚠ Quota exceeded, fallback to BasicAnalyticslcc-demo-app/
├── cmd/
│ └── demo/
│ └── main.go # Application entry point
├── internal/
│ ├── analytics/
│ │ ├── advanced.go # Professional tier feature
│ │ ├── basic.go # Basic tier feature
│ │ └── lcc_gen.go # Auto-generated (by lcc-sdk)
│ ├── export/
│ │ ├── cloud.go # Enterprise tier feature
│ │ └── local.go # Basic tier feature
│ └── reporting/
│ ├── premium.go # Professional tier feature
│ └── standard.go # Basic tier feature
├── lcc-features.yaml # Feature manifest
├── configs/
│ ├── lcc-features.yaml # Production config
│ ├── lcc-features.dev.yaml # Development config
│ └── lcc-features.test.yaml # Test config
└── docs/
├── TUTORIAL.md # Step-by-step tutorial
└── ARCHITECTURE.md # Technical details
sdk:
lcc_url: "http://localhost:7086"
product_id: "demo-analytics-app"
product_version: "1.0.0"
features:
- id: advanced_analytics
name: "Advanced Analytics with ML"
tier: professional
intercept:
package: "github.com/yourorg/lcc-demo-app/internal/analytics"
function: "AdvancedAnalytics"
fallback:
package: "github.com/yourorg/lcc-demo-app/internal/analytics"
function: "BasicAnalytics"
quota:
limit: 1000
period: daily
- id: cloud_export
name: "Cloud Export"
tier: enterprise
intercept:
package: "github.com/yourorg/lcc-demo-app/internal/export"
function: "ExportToCloud"
on_deny:
action: error
message: "Cloud export requires Enterprise license"
- id: premium_reports
name: "Premium Reports"
tier: professional
intercept:
package: "github.com/yourorg/lcc-demo-app/internal/reporting"
function: "PremiumReports"
fallback:
package: "github.com/yourorg/lcc-demo-app/internal/reporting"
function: "StandardReports"# Generate license wrappers (default: Pro profile)
make generate
# Build default demo binary (Pro product)
make build
# Run default demo
./bin/demo-app
# --- Multi-product builds ---
# Basic product (demo-analytics-basic)
make build-basic
./bin/demo-basic
# Pro product (demo-analytics-pro)
make build-pro
./bin/demo-pro
# Enterprise product (demo-analytics-ent)
make build-ent
./bin/demo-ent# Run all tests in the module
make test
# Or run only the demo/status tests
go test ./cmd/demoThe demo tests include an HTTP-based integration test that:
- Starts the status server on a test port (via
LCC_DEMO_STATUS_ADDR) - Seeds in-memory
DemoStatsvalues - Verifies both
/status/jsonand/statusreturn the expected metrics
- Write business logic (no license code needed)
- Update lcc-features.yaml to protect functions
- Run
make generateto create wrappers - Build and test
# Check if LCC is running
curl http://localhost:7086/health
# Check configuration
cat lcc-features.yaml# Check license tier
lcc-sdk check --feature advanced_analytics
# Verify function mapping
lcc-sdk scan# Check Go module
go mod tidy
# Verify package paths
lcc-sdk validate lcc-features.yamlMIT License - This is a demo application for educational purposes.