From fdfec49869b3d0504338eb4dec345f6494098894 Mon Sep 17 00:00:00 2001 From: Jan Halfar Date: Fri, 21 Apr 2023 23:00:26 +0200 Subject: [PATCH] feat: add more gotsrpc docs --- foomo/docs/projects/cms/index.md | 10 +++++----- .../projects/gotsrpc/01_getting-started.md | 5 ----- .../docs/projects/gotsrpc/cli/_category_.json | 3 +++ .../gotsrpc/{ => cli}/gotsrpc.yaml.md | 0 .../gotsrpc/{06_cli.md => cli/index.md} | 0 ...lient-transport.md => client-transport.md} | 0 .../docs/projects/gotsrpc/getting-started.md | 20 +++++++++++++++++++ .../01_hello-world.md | 0 .../02_wheel-of-fortune.md | 0 .../{99_playground => playground}/03_todos.md | 0 .../{99_playground => playground}/index.md | 0 .../service-interfaces/_category_.json | 3 +++ .../errors.md} | 0 .../index.md} | 0 .../value-objects.md} | 3 +++ .../gotsrpc/{02_workflow.md => workflow.md} | 7 +++++-- foomo/docusaurus.config.js | 2 +- 17 files changed, 40 insertions(+), 13 deletions(-) delete mode 100644 foomo/docs/projects/gotsrpc/01_getting-started.md create mode 100644 foomo/docs/projects/gotsrpc/cli/_category_.json rename foomo/docs/projects/gotsrpc/{ => cli}/gotsrpc.yaml.md (100%) rename foomo/docs/projects/gotsrpc/{06_cli.md => cli/index.md} (100%) rename foomo/docs/projects/gotsrpc/{07_client-transport.md => client-transport.md} (100%) create mode 100644 foomo/docs/projects/gotsrpc/getting-started.md rename foomo/docs/projects/gotsrpc/{99_playground => playground}/01_hello-world.md (100%) rename foomo/docs/projects/gotsrpc/{99_playground => playground}/02_wheel-of-fortune.md (100%) rename foomo/docs/projects/gotsrpc/{99_playground => playground}/03_todos.md (100%) rename foomo/docs/projects/gotsrpc/{99_playground => playground}/index.md (100%) create mode 100644 foomo/docs/projects/gotsrpc/service-interfaces/_category_.json rename foomo/docs/projects/gotsrpc/{05_errors.md => service-interfaces/errors.md} (100%) rename foomo/docs/projects/gotsrpc/{03_service-interfaces.md => service-interfaces/index.md} (100%) rename foomo/docs/projects/gotsrpc/{04_value-objects.md => service-interfaces/value-objects.md} (97%) rename foomo/docs/projects/gotsrpc/{02_workflow.md => workflow.md} (73%) diff --git a/foomo/docs/projects/cms/index.md b/foomo/docs/projects/cms/index.md index 11bde4c..606da5f 100644 --- a/foomo/docs/projects/cms/index.md +++ b/foomo/docs/projects/cms/index.md @@ -1,6 +1,6 @@ # CMS -The foomo team has extensive experience with a wide range of CMS systems. Our long journey in the field has brought us very close to the https://jamstack.org . We almost exclusively work with https://app.contentful.com/ but we are watching others like https://www.stripe.com/ very closely. +The foomo team has extensive experience with a wide range of CMS systems. Our long journey in the field has brought us very close to the https://jamstack.org . We almost exclusively work with https://app.contentful.com/ but we are watching others like https://strapi.io/ and https://directus.io/ very closely. ## Expectations and challenges @@ -28,12 +28,12 @@ Let us take a look at a real world example: | application route / ingress | app developers view | SEO URL requirement | |:----------------------------|:---------------------|:-----------------------------------| -| /content:id | /content/1 | / | +| /content/:id | /content/1 | / | | | /content/2 | /mens | -| /category:id | /category/1 | /mens/shirts | +| /category/:id | /category/1 | /mens/shirts | | | /category/2 | /mens/shirts/business | -| /product:id | /product/1 | /mens-shirt-awesome-blue-medium | -| /store:id | /store/1 | /mens/stores/london-perfect-shirts | +| /product/:id | /product/1 | /mens-shirt-awesome-blue-medium | +| /store/:id | /store/1 | /mens/stores/london-perfect-shirts | | | /store/2 | /kids/stores/lego-paradise | ## our approach diff --git a/foomo/docs/projects/gotsrpc/01_getting-started.md b/foomo/docs/projects/gotsrpc/01_getting-started.md deleted file mode 100644 index 04a90a6..0000000 --- a/foomo/docs/projects/gotsrpc/01_getting-started.md +++ /dev/null @@ -1,5 +0,0 @@ -# Getting started - -- install `gotsrpc` [cli](cli) -- clone and play with the [playground](playground) -- follow [workflow](workflow) instructions diff --git a/foomo/docs/projects/gotsrpc/cli/_category_.json b/foomo/docs/projects/gotsrpc/cli/_category_.json new file mode 100644 index 0000000..25bee18 --- /dev/null +++ b/foomo/docs/projects/gotsrpc/cli/_category_.json @@ -0,0 +1,3 @@ +{ + "position" : 2 +} \ No newline at end of file diff --git a/foomo/docs/projects/gotsrpc/gotsrpc.yaml.md b/foomo/docs/projects/gotsrpc/cli/gotsrpc.yaml.md similarity index 100% rename from foomo/docs/projects/gotsrpc/gotsrpc.yaml.md rename to foomo/docs/projects/gotsrpc/cli/gotsrpc.yaml.md diff --git a/foomo/docs/projects/gotsrpc/06_cli.md b/foomo/docs/projects/gotsrpc/cli/index.md similarity index 100% rename from foomo/docs/projects/gotsrpc/06_cli.md rename to foomo/docs/projects/gotsrpc/cli/index.md diff --git a/foomo/docs/projects/gotsrpc/07_client-transport.md b/foomo/docs/projects/gotsrpc/client-transport.md similarity index 100% rename from foomo/docs/projects/gotsrpc/07_client-transport.md rename to foomo/docs/projects/gotsrpc/client-transport.md diff --git a/foomo/docs/projects/gotsrpc/getting-started.md b/foomo/docs/projects/gotsrpc/getting-started.md new file mode 100644 index 0000000..a649828 --- /dev/null +++ b/foomo/docs/projects/gotsrpc/getting-started.md @@ -0,0 +1,20 @@ +--- +sidebar_position: 1 +--- +# Getting started + + +- clone and play with the [playground](playground) +- follow [workflow](workflow) instructions +- understanding the very simple [RPC protocol](protocol) will not hurt + + +## When using TypeScript clients + +- implement a [TypeScript client transport](client-transport) + +## When writing Go services + +- install `gotsrpc` [cli](cli) +- define and implement [services interfaces](service-interfaces) +- configure your code generation [gotsrpc.yaml](cli/gotsrpc.yaml) diff --git a/foomo/docs/projects/gotsrpc/99_playground/01_hello-world.md b/foomo/docs/projects/gotsrpc/playground/01_hello-world.md similarity index 100% rename from foomo/docs/projects/gotsrpc/99_playground/01_hello-world.md rename to foomo/docs/projects/gotsrpc/playground/01_hello-world.md diff --git a/foomo/docs/projects/gotsrpc/99_playground/02_wheel-of-fortune.md b/foomo/docs/projects/gotsrpc/playground/02_wheel-of-fortune.md similarity index 100% rename from foomo/docs/projects/gotsrpc/99_playground/02_wheel-of-fortune.md rename to foomo/docs/projects/gotsrpc/playground/02_wheel-of-fortune.md diff --git a/foomo/docs/projects/gotsrpc/99_playground/03_todos.md b/foomo/docs/projects/gotsrpc/playground/03_todos.md similarity index 100% rename from foomo/docs/projects/gotsrpc/99_playground/03_todos.md rename to foomo/docs/projects/gotsrpc/playground/03_todos.md diff --git a/foomo/docs/projects/gotsrpc/99_playground/index.md b/foomo/docs/projects/gotsrpc/playground/index.md similarity index 100% rename from foomo/docs/projects/gotsrpc/99_playground/index.md rename to foomo/docs/projects/gotsrpc/playground/index.md diff --git a/foomo/docs/projects/gotsrpc/service-interfaces/_category_.json b/foomo/docs/projects/gotsrpc/service-interfaces/_category_.json new file mode 100644 index 0000000..c4e6d81 --- /dev/null +++ b/foomo/docs/projects/gotsrpc/service-interfaces/_category_.json @@ -0,0 +1,3 @@ +{ + "position" : 4 +} \ No newline at end of file diff --git a/foomo/docs/projects/gotsrpc/05_errors.md b/foomo/docs/projects/gotsrpc/service-interfaces/errors.md similarity index 100% rename from foomo/docs/projects/gotsrpc/05_errors.md rename to foomo/docs/projects/gotsrpc/service-interfaces/errors.md diff --git a/foomo/docs/projects/gotsrpc/03_service-interfaces.md b/foomo/docs/projects/gotsrpc/service-interfaces/index.md similarity index 100% rename from foomo/docs/projects/gotsrpc/03_service-interfaces.md rename to foomo/docs/projects/gotsrpc/service-interfaces/index.md diff --git a/foomo/docs/projects/gotsrpc/04_value-objects.md b/foomo/docs/projects/gotsrpc/service-interfaces/value-objects.md similarity index 97% rename from foomo/docs/projects/gotsrpc/04_value-objects.md rename to foomo/docs/projects/gotsrpc/service-interfaces/value-objects.md index f4841fc..fd38e32 100644 --- a/foomo/docs/projects/gotsrpc/04_value-objects.md +++ b/foomo/docs/projects/gotsrpc/service-interfaces/value-objects.md @@ -1,3 +1,6 @@ +--- +sidebar_position: 1 +--- # Value Objects Typically value objects will be serialized / marshalled as JSON. Please refer to this documentation: diff --git a/foomo/docs/projects/gotsrpc/02_workflow.md b/foomo/docs/projects/gotsrpc/workflow.md similarity index 73% rename from foomo/docs/projects/gotsrpc/02_workflow.md rename to foomo/docs/projects/gotsrpc/workflow.md index 0642e40..66ba646 100644 --- a/foomo/docs/projects/gotsrpc/02_workflow.md +++ b/foomo/docs/projects/gotsrpc/workflow.md @@ -1,15 +1,18 @@ +--- +sidebar_position: 3 +--- # Workflow ## Initial setup in a project - define a central place for your Go service interface definitions - define a central place where your TypeScript client code will be generated to -- create one central [`gotsrpc.yaml`](gotsrpc.yaml) +- create one central [`gotsrpc.yaml`](cli/gotsrpc.yaml) - implement a TypeScript [`transport`](client-transport) for your project ## Per service 1. define [service interfaces](service-interfaces) in Go -2. configure code generation in [`gotsrpc.yaml`](gotsrpc.yaml) +2. configure code generation in [`gotsrpc.yaml`](cli/gotsrpc.yaml) 3. generate service proxies and client with [`gotsrpc` cli](cli) 4. go to 1. diff --git a/foomo/docusaurus.config.js b/foomo/docusaurus.config.js index 01b33f1..75f3b51 100644 --- a/foomo/docusaurus.config.js +++ b/foomo/docusaurus.config.js @@ -25,7 +25,7 @@ const config = { ({ docs: { sidebarPath: require.resolve('./sidebars.js'), - sidebarCollapsed: false, + sidebarCollapsed: true, editUrl: 'https://github.com/foomo/foomo-docs/tree/main/foomo', }, blog: {