From 7fe822630455a30ccc95cddad7eb845d3bf8d8f8 Mon Sep 17 00:00:00 2001 From: yanu Date: Sat, 22 Jun 2024 08:57:00 +0700 Subject: [PATCH] chore: update docs --- bench/run.ts | 2 - docs/hello-context.md | 22 +++++ docs/hello.md | 17 ++++ docs/json.md | 17 ++++ docs/structure.md | 2 +- modules/web/docs.layout.tsx | 126 +++++++++++++++++++++++++---- modules/web/index.page.tsx | 4 +- modules/web/main.ts | 46 ++++++++--- post/collaboration.md | 23 +++--- post/oauth.md | 2 +- post/preact_and_encrypted_props.md | 2 +- post/react.md | 2 +- post/render_to_readable_stream.md | 2 +- post/tailwind.md | 2 +- 14 files changed, 223 insertions(+), 46 deletions(-) create mode 100644 docs/hello-context.md create mode 100644 docs/hello.md create mode 100644 docs/json.md diff --git a/bench/run.ts b/bench/run.ts index c57219b3b..962576f03 100644 --- a/bench/run.ts +++ b/bench/run.ts @@ -131,8 +131,6 @@ let markdown = `--- title: Benchmarks description: This is the final output of an internal benchmark run in github action image: https://fastro.dev/fastro.png -previous: structure -next: "" --- This is the final output of an internal benchmark run in [github action](https://github.com/fastrodev/fastro/actions) on \`${ diff --git a/docs/hello-context.md b/docs/hello-context.md new file mode 100644 index 000000000..81e53f3e9 --- /dev/null +++ b/docs/hello-context.md @@ -0,0 +1,22 @@ +--- +title: "Hello World Using Context" +description: The application for creating a simple route using application context +image: https://fastro.deno.dev/fastro.png +previous: hello +next: json +--- + +```ts +import fastro from "https://fastro.deno.dev/mod.ts"; + +const f = new fastro(); + +f.get( + "/", + (_req: HttpRequest, ctx: Context) => { + return ctx.send("Helo world", 200); + }, +); + +await f.serve(); +``` diff --git a/docs/hello.md b/docs/hello.md new file mode 100644 index 000000000..86da2d90c --- /dev/null +++ b/docs/hello.md @@ -0,0 +1,17 @@ +--- +title: "Hello World" +description: The application for creating a simple route +image: https://fastro.deno.dev/fastro.png +previous: structure +next: hello-context +--- + +```ts +import fastro from "https://fastro.deno.dev/mod.ts"; + +const f = new fastro(); + +f.get("/", () => "Hello, World!"); + +await f.serve(); +``` diff --git a/docs/json.md b/docs/json.md new file mode 100644 index 000000000..8990a3789 --- /dev/null +++ b/docs/json.md @@ -0,0 +1,17 @@ +--- +title: "Hello JSON" +description: The application that return simple JSON +image: https://fastro.deno.dev/fastro.png +previous: hello-context +next: hello-context +--- + +```ts +import fastro from "https://fastro.deno.dev/mod.ts"; + +const f = new fastro(); + +f.get("/", () => ({ text: "Hello json" })); + +await f.serve(); +``` diff --git a/docs/structure.md b/docs/structure.md index fe199bad3..4f3971b38 100644 --- a/docs/structure.md +++ b/docs/structure.md @@ -3,7 +3,7 @@ title: Application Structure description: flat modular architecture for improved readability. image: https://fastro.deno.dev/fastro.png previous: start -next: benchmarks +next: hello --- You can find more detailed instructions in diff --git a/modules/web/docs.layout.tsx b/modules/web/docs.layout.tsx index 5f8ba2635..b43354faa 100644 --- a/modules/web/docs.layout.tsx +++ b/modules/web/docs.layout.tsx @@ -1,6 +1,113 @@ import { Footer } from "$fastro/components/footer.tsx"; import { InlineNav } from "../../components/inline-nav.tsx"; +const toc = [ + { + title: "Get Started", + url: "/docs/start", + }, + { + title: "App Structure", + url: "/docs/structure", + }, + { + title: "Hello World", + url: "/docs/hello", + }, + { + title: "Hello World Context", + url: "/docs/hello-context", + }, + { + title: "Hello JSON", + url: "/docs/json", + }, + { + title: "Routing", + url: "/docs/route", + }, + { + title: "URL Params", + url: "/docs/url-params", + }, + { + title: "Query Params", + url: "/docs/query-params", + }, + { + title: "App Middleware", + url: "/docs/app-middleware", + }, + { + title: "Route Middleware", + url: "/docs/route-middleware", + }, + { + title: "Markdown Middleware", + url: "/docs/markdown", + }, + { + title: "Tailwind Middleware", + url: "/docs/tailwind", + }, + { + title: "Static File", + url: "/docs/static", + }, + { + title: "Hello TSX", + url: "/docs/tsx", + }, + { + title: "TSX Component", + url: "/docs/tsx-component", + }, + { + title: "Function Component", + url: "/docs/fn-component", + }, + { + title: "Server Side Rendering", + url: "/docs/ssr", + }, + { + title: "OAuth", + url: "/docs/oauth", + }, + { + title: "MySQL", + url: "/docs/mysql", + }, + { + title: "Postgres", + url: "/docs/postgres", + }, + { + title: "Redis", + url: "/docs/redis", + }, + { + title: "Mongo", + url: "/docs/mongo", + }, + { + title: "Deno KV", + url: "/docs/kv", + }, + { + title: "Grouping", + url: "/docs/group", + }, + { + title: "Deployment", + url: "/docs/deploy", + }, + { + title: "Benchmarks", + url: "/docs/benchmarks", + }, +]; + export default function ( props: { CSS: string; @@ -14,21 +121,6 @@ export default function ( const previous = props.attrs.previous as string; const next = props.attrs.next as string; - const toc = [ - { - title: "Get Started", - url: "/docs/start", - }, - { - title: "Application Structure", - url: "/docs/structure", - }, - { - title: "Benchmarks", - url: "/docs/benchmarks", - }, - ]; - return ( @@ -52,14 +144,14 @@ export default function ( class={"grow md:grid md:grid-cols-10 p-6 md:p-0 "} >
{toc.map((v) => { return {v.title}; })}
diff --git a/modules/web/index.page.tsx b/modules/web/index.page.tsx index 8e0da8e30..4356e2df8 100644 --- a/modules/web/index.page.tsx +++ b/modules/web/index.page.tsx @@ -340,8 +340,8 @@ export default function Index({ data }: PageProps<
diff --git a/modules/web/main.ts b/modules/web/main.ts index b705d7ec1..f1e8875da 100644 --- a/modules/web/main.ts +++ b/modules/web/main.ts @@ -79,15 +79,43 @@ s.page("/blog", { folder: "modules/web", handler: (_req, ctx) => { return ctx.render({ - posts: [{ - title: "Collaboration and Profit Sharing", - url: "/blog/collaboration", - date: "6/18/2024", - }, { - title: "Set up Tailwind on Deno", - url: "/blog/tailwind", - date: "1/26/2024", - }], + posts: [ + { + title: "Collaboration and Profit Sharing", + url: "/blog/collaboration", + date: "06/18/2024", + }, + { + title: "Set up Tailwind on Deno", + url: "/blog/tailwind", + date: "01/26/2024", + }, + { + title: "Deno KV OAuth Implementation", + url: "/blog/oauth", + date: "11/15/2023", + }, + { + title: "React: renderToReadableStream", + url: "/blog/render_to_readable_stream", + date: "10/26/2023", + }, + { + title: "React", + url: "/blog/react", + date: "10/22/2023", + }, + { + title: "Preact", + url: "/blog/preact_and_encrypted_props", + date: "08/16/2023", + }, + { + title: "Hello", + url: "/blog/hello", + date: "11/15/2023", + }, + ], }); }, }); diff --git a/post/collaboration.md b/post/collaboration.md index b408fd1dd..3f4363fc7 100644 --- a/post/collaboration.md +++ b/post/collaboration.md @@ -2,7 +2,7 @@ title: "Collaboration and Profit Sharing" description: "Unleash the Power of Collaboration! Programmers, Business Analysts, and Designers: Discover how to maximize profits and fuel team success with a winning profit-sharing strategy for your app." image: https://fastro.deno.dev/collab.png -author: Yanu Widodo +author: Admin date: 06/18/2024 --- @@ -13,15 +13,18 @@ developed to attract a large user base. We will place relevant ads on these apps. If a user wants to remove the ads, they will need to subscribe monthly. -Every profit generated will be divided according to the following percentages. - -| Role | Description | Output | Sharing Profit | -| ------------------ | ---------------------------------------------------- | --------------------------------------- | :-------------------------------------------: | -| Business Analyst | Define user requirements & business flow | Business Requirements Document (BRD) | 23 % | -| Designer | Design UI/UX applications. | Clickable Figma Prototype | 22 % | -| Frontend Developer | Create a user interface and integrate it with APIs | Web Application (SSR) | 22 % | -| Backend Developer | Build, test, and deploy the applications | Application Programming Interface (API) | 23 % | -| Sales | Attract vendors or brands to run ads on the platform | Ads placement | 5% commission from every income they bring in | +Profits generated will be divided based on the following percentages, according +to workload assumption. + +| Role | Description | Output | Sharing Profit | +| ------------------ | ------------------------------------------------ | --------------------------------------- | :-------------------------------------------: | +| Business Analyst | Define user requirements & business flow | Business Requirements Document (BRD) | 20 % | +| Designer | Design UI/UX applications. | Clickable Figma Prototype | 20 % | +| Frontend Developer | Create a user interface & integrate it with APIs | Web Application (SSR) | 20 % | +| Backend Developer | Build, test & deploy the applications | Application Programming Interface (API) | 20 % | +| Core Framework | Framework maintenance & app dev coordination | Fastro Framework & Timeline | 10 % | +| Infrastructure | Maintain the operational of Server & Database | The Live Application | 5% | +| Freelance Sales | Attract vendors to run ads on the platform | Ads placement | 5% commission from every income they bring in | Those schemes can be changed to adapt to different situations and conditions. diff --git a/post/oauth.md b/post/oauth.md index a0db8439b..abc72f67a 100644 --- a/post/oauth.md +++ b/post/oauth.md @@ -2,7 +2,7 @@ title: "Deno KV OAuth Implementation" description: "Implementing a modular codebase for Deno KV OAuth in Fastro" image: https://fastro.deno.dev/fastro.png -author: Yanu Widodo +author: Admin date: 11/15/2023 --- diff --git a/post/preact_and_encrypted_props.md b/post/preact_and_encrypted_props.md index c6f138319..0bc2e02a0 100644 --- a/post/preact_and_encrypted_props.md +++ b/post/preact_and_encrypted_props.md @@ -2,7 +2,7 @@ title: "Fastro v0.80.0: Preact and Server Side Props Encryption" description: "Preact integration and robust encryption of Server Side Props" image: https://fastro.deno.dev/fastro.png -author: Yanu Widodo +author: Admin date: 08/16/2023 --- diff --git a/post/react.md b/post/react.md index 51c7ea427..e630d7c7e 100644 --- a/post/react.md +++ b/post/react.md @@ -2,7 +2,7 @@ title: "Fastro v0.82.0: Back to using React" image: https://fastro.deno.dev/fastro.png description: "The error in the previous version has been resolved" -author: Yanu Widodo +author: Admin date: 10/22/2023 --- diff --git a/post/render_to_readable_stream.md b/post/render_to_readable_stream.md index 246da0253..fc6cb8506 100644 --- a/post/render_to_readable_stream.md +++ b/post/render_to_readable_stream.md @@ -3,7 +3,7 @@ title: "Fastro v0.83.0: renderToReadableStream" image: https://fastro.deno.dev/fastro.png description: "Use renderToReadableStream to improve the performance of the page load " -author: Yanu Widodo +author: Admin date: 10/26/2023 --- diff --git a/post/tailwind.md b/post/tailwind.md index b61b463da..62629d44d 100644 --- a/post/tailwind.md +++ b/post/tailwind.md @@ -2,7 +2,7 @@ title: "Set up Tailwind on Deno" description: "Integrating Tailwind CSS into a Deno Project" image: https://fastro.deno.dev/tailwind.png -author: Yanu Widodo +author: Admin date: 01/26/2024 ---