From c1f6099fb2f0ea16d2814e76eef3f378d217bc81 Mon Sep 17 00:00:00 2001 From: thomashamburg Date: Wed, 12 Nov 2025 11:58:50 +0100 Subject: [PATCH] workflow slide added --- slides/datastar/slides.md | 73 +++++++++++++++++++++++---------------- 1 file changed, 43 insertions(+), 30 deletions(-) diff --git a/slides/datastar/slides.md b/slides/datastar/slides.md index c98b31b..b497de2 100644 --- a/slides/datastar/slides.md +++ b/slides/datastar/slides.md @@ -123,13 +123,13 @@ transition: fade-out ### Finding my combination of web technologies for a minimal viable web application. -
+
- Part 1: The Database: SQLite - Part 2: The No-ORM ORM - A very simple Data Abstraction Layer. - Part 3: Developing a Web Server Application in Go. - Part 4: Datastar - a lightweight framework for real-time collaborative web apps. -- Part 5: Modern CSS. +- Part 5: Modern HTML and modern CSS. - Part 6: Web components. - Part 7: Simple Deployments with a VPS, Nginx, Certbot and a single binary file. @@ -226,7 +226,7 @@ Declarative vs. Imperative, DS conforms strictly to the web's specs. class: default --- -# Reducing the Network to a Remote Procedure Call +# Reducing the Network to a Function Call ```js { @@ -355,37 +355,50 @@ sequenceDiagram Note over Browser,Backend: Real-time updates without new requests ``` --- -class: default +layout: two-cols +layoutClass: gap-2 --- -# Reducing the Network to a Remote Procedure Call +```mermaid { scale: 0.4} +graph TD + Start([Client Starts]) --> GetProducts[GET /products] + + GetProducts --> ProductResp["Response: Product List
links:
add-to-cart: /cart/items
self: /products"] + + ProductResp --> AddCart[POST /cart/items] + + AddCart --> CartResp["Response: Cart Updated
links:
self: /cart
update-item: /cart/items/id
remove-item: /cart/items/id
checkout: /checkout"] + + CartResp --> Decision1{Client Action} + Decision1 -->|Continue Shopping| GetProducts + Decision1 -->|Proceed| Checkout[POST /checkout] + + Checkout --> CheckoutResp["Response: Checkout Session
links:
payment: /payment
cancel: /cart"] -```js -{ - const { data, error } = await to(fetch("https://api.example.com/api/board")); - if (error) { - // handle error - return; - } - // handle data -} -{ - const { data, error } = await to(fetch("https://api.example.com/api/users/12")); - if (error) { - // handle error - return; - } - // handle data -} - -// the function that "unwraps" the promise: -export function to(promise: Promise) { - return promise - .then((response) => response.json()) - .then((data) => ({ data, error: null })) - .catch((error) => ({ data: null, error })); -} + +``` +::right:: +```mermaid { scale: 0.4} +graph TD + CheckoutResp["Response: Checkout Session
links:
payment: /payment
cancel: /cart"] --> Payment[POST /payment] + + Payment --> PaymentResp["Response: Payment Success
links:
order: /orders/id
track: /orders/id/tracking
invoice: /orders/id/invoice"] + + PaymentResp --> GetOrder[GET /orders/id] + + GetOrder --> OrderState{Order State} + + OrderState -->|Pending| PendingResp["Response: Order Pending
links:
self: /orders/id
cancel: /orders/id/cancel
track: /orders/id/tracking"] + + OrderState -->|Shipped| ShippedResp["Response: Order Shipped
links:
self: /orders/id
track: /orders/id/tracking
return: /orders/id/return"] + + OrderState -->|Delivered| DeliveredResp["Response: Order Delivered
links:
self: /orders/id
return: /orders/id/return
review: /orders/id/review"] + + PendingResp --> End([Workflow Complete]) + ShippedResp --> End + DeliveredResp --> End + ``` ---