Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jchris committed Oct 21, 2023
1 parent 761abe4 commit 3fe1a28
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 17 deletions.
37 changes: 27 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,28 @@
# hyperwave 🌊
# Bun, HTMX, and Fireproof

This is a simple proof-of-concept to get you started using Fireproof on the server side. In this example, we import Fireproof from the node build:

```ts
import { fireproof } from '@fireproof/core/node'
```

This ensures we get the filesystem and node-crypto APIs, instead of the browser versions.

## Notes

In a production deployment you'd want to link your edge Fireproof instances (the ones in your Bun server) to each other, most likely using something like PartyKit (CloudFlare durable objects) or IPFS. More info on [connecting Fireproof instances can be found here.](https://use-fireproof.com/docs/connect/)


## hyperwave 🌊

https://hyperwave.codes/

hyperwave is a server-side framework for building web applications.

* fast: Bun and Hono for best-in-class performance
* lightweight: ~20kb payload. Demo loads in a couple seconds even while throttled to 2G.
* productive: use the best tools for the job: Tailwind, HTMX, and TypeScript
* portable: compile a binary to deploy anywhere

- fast: Bun and Hono for best-in-class performance
- lightweight: ~20kb payload. Demo loads in a couple seconds even while throttled to 2G.
- productive: use the best tools for the job: Tailwind, HTMX, and TypeScript
- portable: compile a binary to deploy anywhere

### Setup

Expand All @@ -19,9 +33,11 @@ Visit port 3000 and edit `server.tsx`
---

### Example

This is the endpoint serving our initial landing page:

```typescript
app.get("/", ({ html }) =>
app.get('/', ({ html }) =>
html(
<Layout title="hyperwave">
<section class="flex flex-col gap-8">
Expand All @@ -35,10 +51,11 @@ app.get("/", ({ html }) =>
</button>
</div>
</section>
</Layout>,
),
);
</Layout>
)
)
```

- The API serves a full HTML document to the client, which includes Tailwind classes and HTMX attributes
- The response is wrapped in a `<Layout />` tag, a server-rendered functional component, which takes a `title` prop
- The button, when clicked, will issue a `GET` request to `/instructions` and replace the content of its parent div with the response.
Expand Down
7 changes: 0 additions & 7 deletions src/db.ts

This file was deleted.

0 comments on commit 3fe1a28

Please sign in to comment.