Skip to content

Commit

Permalink
chore: update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ynwd committed Jun 22, 2024
1 parent 9ede4ad commit 7fe8226
Show file tree
Hide file tree
Showing 14 changed files with 223 additions and 46 deletions.
2 changes: 0 additions & 2 deletions bench/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 \`${
Expand Down
22 changes: 22 additions & 0 deletions docs/hello-context.md
Original file line number Diff line number Diff line change
@@ -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();
```
17 changes: 17 additions & 0 deletions docs/hello.md
Original file line number Diff line number Diff line change
@@ -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();
```
17 changes: 17 additions & 0 deletions docs/json.md
Original file line number Diff line number Diff line change
@@ -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();
```
2 changes: 1 addition & 1 deletion docs/structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
126 changes: 109 additions & 17 deletions modules/web/docs.layout.tsx
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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 (
<html lang="en">
<head>
Expand All @@ -52,14 +144,14 @@ export default function (
class={"grow md:grid md:grid-cols-10 p-6 md:p-0 "}
>
<div
class={`hidden md:flex md:flex-col md:grow md:gap-y-3 md:col-span-2 md:items-end md:text-right md:pr-6 md:pt-6`}
class={`hidden md:flex md:flex-col md:grow md:gap-y-3 md:col-span-2 md:items-end md:text-right md:pr-6 md:pt-6 md:pb-6`}
>
{toc.map((v) => {
return <a href={v.url}>{v.title}</a>;
})}
</div>
<div
class={`md:col-span-6 md:border-l md:border-l-gray-800 md:pl-5 md:pt-6 flex flex-col gap-y-6`}
class={`md:col-span-6 md:border-l md:border-l-gray-800 md:pl-5 md:pt-6 flex flex-col gap-y-6 max-w-4xl`}
>
<div class={`flex flex-col gap-y-3`}>
<div class={`block`}>
Expand Down
4 changes: 2 additions & 2 deletions modules/web/index.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,8 @@ export default function Index({ data }: PageProps<
<div class={`text-center`}>
<InlineNav
title="Fastro"
description="Deno & Tailwind CSS Setup"
destination={`${data.baseUrl}/blog/tailwind`}
description="Blog"
destination={`${data.baseUrl}/blog`}
/>
</div>

Expand Down
46 changes: 37 additions & 9 deletions modules/web/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
],
});
},
});
Expand Down
23 changes: 13 additions & 10 deletions post/collaboration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
---

Expand All @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion post/oauth.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
---

Expand Down
2 changes: 1 addition & 1 deletion post/preact_and_encrypted_props.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
---

Expand Down
2 changes: 1 addition & 1 deletion post/react.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
---

Expand Down
2 changes: 1 addition & 1 deletion post/render_to_readable_stream.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
---

Expand Down
2 changes: 1 addition & 1 deletion post/tailwind.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
---

Expand Down

0 comments on commit 7fe8226

Please sign in to comment.