A comprehensive demonstration of the Codion Application Framework, showcasing how a single codebase can seamlessly deploy as desktop, client-server, web service, and serverless applications.
The Chinook demo is a full-featured enterprise application based on the Chinook music store database. It demonstrates the complete capabilities of the Codion framework through a real-world business application managing artists, albums, tracks, customers, and invoices.
The simplest way to experience Chinook—no server required:
./gradlew chinook-client-local:runThis launches the full desktop application with an embedded in-memory H2 database.
The domain model defines entities with type-safe attributes and relationships:
interface Album extends EntityDefinition {
EntityType TYPE = DOMAIN.entityType("chinook.album");
Column<Long> ID = TYPE.longColumn("albumid");
Column<String> TITLE = TYPE.stringColumn("title");
Column<byte[]> COVER = TYPE.byteArrayColumn("cover");
ForeignKey ARTIST_FK = TYPE.foreignKey("artist_fk", ARTIST_ID, Artist.ID);
// Derived attribute calculated from track ratings
Attribute<Double> RATING = TYPE.doubleAttribute("rating");
}┌─────────────────┐ ┌─────────────────┐
│ Desktop Client │ │ Desktop Client │
│ (Swing UI) │ │ (Swing UI) │
└────────┬────────┘ └────────┬────────┘
│ │
▼ ▼
┌─────────────────┐ ┌─────────────────┐
│ Local JDBC │ │ Entity Server │
│ (Embedded H2) │ │ (RMI/HTTP) │
└─────────────────┘ └─────────────────┘
│ │
▼ ▼
┌──────────┐ ┌──────────┐
│ H2 │ │ H2 │
│ In-Memory│ │PostgreSQL│
└──────────┘ └──────────┘-
Entity Definitions: Type-safe column definitions with validation
-
Foreign Key Relationships: Automatic referential integrity
-
Derived Attributes: Calculated fields with dependency tracking
-
Custom Types: Array columns for tags, byte arrays for images
-
Database Functions: Stored procedures and functions integration
-
Migration System: Version-controlled schema evolution
-
Master-Detail Views: Synchronized selection and editing
-
Advanced Components: Custom editors, renderers, and input controls
-
Keyboard Navigation: Comprehensive shortcuts for power users
-
Search and Filtering: Powerful condition-based queries
-
Internationalization: Full i18n support
-
Preferences: User settings persistence
-
Connection Modes: Local JDBC, RMI, HTTP
-
Authentication: Pluggable authentication with user management
-
Connection Pooling: HikariCP integration
-
Load Testing: Comprehensive scenarios with real-world patterns
-
Monitoring: Server monitoring UI and metrics
-
Native Packaging: Platform-specific installers via jpackage
The modular architecture demonstrates clean separation of concerns:
-
chinook-domain-api: Domain model interfaces and contracts
-
chinook-domain: Domain implementation with business logic
-
chinook-client: Swing UI implementation
-
chinook-client-local: Desktop with embedded database
-
chinook-client-remote: RMI client configuration
-
chinook-client-http: HTTP client configuration
-
chinook-server: Multi-protocol server (RMI + HTTP)
-
chinook-service: REST API with Javalin
Create platform-specific installers with custom runtime:
# Windows: MSI installer
# Linux: DEB package
# macOS: DMG installer
./gradlew chinook-client-local:jpackageThe load tests simulate realistic usage patterns:
-
User authentication cycles
-
Concurrent data modifications
-
Report generation
-
Complex searches
-
Bulk operations
Run load tests:
# Test RMI server
./gradlew chinook-load-test-remote:run
# Test HTTP server
./gradlew chinook-load-test-http:run
# Test REST service
./gradlew chinook-service-load-test:runKey configuration properties in gradle.properties:
# Server configuration
serverHost=localhost
serverPort=2223
serverHttpPort=8088
serverRegistryPort=1098
serverAdminPort=4445
# REST service configuration
servicePort=8089
# Database configuration (via system properties)
codion.db.url=jdbc:h2:mem:chinook
codion.db.initScripts=classpath:create_schema.sqlThis demo is licensed under the GNU General Public License v3.0. See the COPYING file for details.
-
Chinook Tutorial (after building)
