feat: Add comprehensive Airframe walkthrough documentation#3940
Conversation
Co-authored-by: xerial <[email protected]>
| import wvlet.log.{LogSupport, Logger, LogLevel} | ||
|
|
||
| object ConfigApp extends App with LogSupport { | ||
| Logger.init |
There was a problem hiding this comment.
Logger.init is unnecessary across the examples
There was a problem hiding this comment.
Removed all Logger.init calls across the examples. Fixed in commit 0eaf268.
| 2023-12-15 10:30:15.125-0800 info [TaskApp] Application initialized successfully - (TaskApp.scala:14) | ||
| ``` | ||
|
|
||
| ## Step 2: Configuration with airframe-config |
There was a problem hiding this comment.
We no longer recommend using airframe-config. Write examples without using .yml files and airframe-config module
There was a problem hiding this comment.
Removed the entire airframe-config section (Step 2) and renumbered subsequent steps. Also removed airframe-config dependency from build.sbt and references from documentation. Fixed in commit 0eaf268.
| created.title shouldBe "Test Task" | ||
| created.description shouldBe "Test Description" | ||
| created.completed shouldBe false | ||
| created.id should not be empty |
There was a problem hiding this comment.
| created.id should not be empty | |
| created.id shouldNotBe empty |
There was a problem hiding this comment.
Fixed AirSpec syntax to use created.id shouldNotBe empty. Fixed in commit 0eaf268.
| // Should have 2 tasks | ||
| val list = service.listTasks() | ||
| list.total shouldBe 2 | ||
| list.tasks should have size 2 |
There was a problem hiding this comment.
| list.tasks should have size 2 | |
| list.tasks.size == 2 shouldBe true |
There was a problem hiding this comment.
Fixed AirSpec syntax to use list.tasks.size shouldBe 2. Fixed in commit 0eaf268.
|
|
||
| // Update title | ||
| val updated1 = service.updateTask(task.id, UpdateTaskRequest(title = Some("Updated"))) | ||
| updated1 should be defined |
There was a problem hiding this comment.
| updated1 should be defined | |
| updated1 shouldBe defined |
AIrSpec has no syntax for should be use shouldBe instead
There was a problem hiding this comment.
Fixed AirSpec syntax to use updated1 shouldBe defined and all other similar assertions to use shouldBe instead of should be. Fixed in commit 0eaf268.
…ntax Co-authored-by: xerial <[email protected]>
| 3. **Singleton Scoping**: Services can be singletons to share state | ||
| 4. **Provider Binding**: Complex object creation through provider functions | ||
|
|
||
| ## Step 3: Building REST APIs with airframe-http |
There was a problem hiding this comment.
Let's focus on building an RPC service example by removing REST API definitions. Fix the example accordingly.
There was a problem hiding this comment.
Focused the documentation on RPC service examples by removing the entire REST API section (Step 3) and making RPC Communication the primary approach. Updated all examples to use RPC consistently, removed duplicate CLI section, and renumbered steps accordingly. Fixed in commit e5e7cb4.
Co-authored-by: xerial <[email protected]>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. |
|
build.sbt doesn't have sbt-airframe setting for generating RPC client: and server and client modules will need the above sbt settings. See also https://wvlet.org/airframe/docs/airframe-rpc#sbt-airframe-plugin for the usage of RPC client generator |
Co-authored-by: xerial <[email protected]>
... Added the missing sbt-airframe plugin configuration to server, client, and cli modules:
This enables the plugin to generate the |
Summary
This PR addresses the need for comprehensive walkthrough documentation that shows how Airframe modules work together to build complete applications. Previously, the documentation consisted of isolated module guides that didn't demonstrate the integrated ecosystem.
What's New
📚 New Comprehensive Walkthrough:
docs/airframe-walkthrough.mdA step-by-step tutorial that builds a complete Task Management Application demonstrating:
Key Features
Navigation Updates
Example Structure
The walkthrough progressively builds features:
Impact
This transforms the learning experience from studying isolated modules to understanding how Airframe enables rapid development of type-safe, cross-platform applications. Users can now see the "big picture" of how modules complement each other.
Fixes #2169.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.