-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add news app code; needs more documentation, but is a better represen…
…tation of the framework
- Loading branch information
1 parent
01d0e3f
commit e1f9b5b
Showing
26 changed files
with
992 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
PORT=1234 | ||
DEBUG=false | ||
TELEGRAM_BOT_TOKEN=abcd | ||
TELEGRAM_CHAT_ID=efgh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
{ | ||
"parser": "@babel/eslint-parser", | ||
"parserOptions": { | ||
"ecmaVersion": 2021, | ||
"sourceType": "module", | ||
"babelOptions": { | ||
"presets": [ | ||
"@babel/preset-env", | ||
"@babel/preset-react" | ||
] | ||
} | ||
}, | ||
"env": { | ||
"browser": true, | ||
"node": true | ||
}, | ||
"plugins": [ | ||
"react" | ||
], | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:react/recommended" | ||
], | ||
"rules": {} | ||
} | ||
"parser": "@babel/eslint-parser", | ||
"parserOptions": { | ||
"ecmaVersion": 2021, | ||
"sourceType": "module", | ||
"babelOptions": { | ||
"presets": ["@babel/preset-env", "@babel/preset-react"] | ||
} | ||
}, | ||
"env": { | ||
"browser": true, | ||
"node": true | ||
}, | ||
"plugins": ["react", "@typescript-eslint"], | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:react/recommended", | ||
"plugin:@typescript-eslint/recommended" | ||
], | ||
"rules": { | ||
"@typescript-eslint/explicit-module-boundary-types": "error", | ||
"@typescript-eslint/explicit-function-return-type": "error" | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,40 @@ | ||
# hyperwave | ||
|
||
hyperwave combines the benefits of traditional server-rendered applications with the flexibility of modern client-side frameworks. | ||
hyperwave combines the strengths of traditional server-rendered applications with the flexibility of modern client-side frameworks. It is designed to deliver fast, responsive applications while providing a streamlined developer experience. | ||
|
||
- **Performance:** Server-side rendering ensures fast, responsive applications, tailored to produce the smallest possible bundles. | ||
- **Developer experience:** HTMX and Tailwind provide a minimalistic and declarative approach to building user interfaces | ||
- **Deployment:** bun applications can be easily deployed on any platform as portable binaries | ||
- Performance: Only 200 lines of JS with zero client side dependencies. Works well in 2G network conditions. | ||
- Developer Experience: tailwind-compatible syntax and html over the wire offer a minimalistic and declarative approach to UI development. | ||
- Deployment: Bun applications can be deployed easily on any platform as portable binaries. | ||
|
||
## Getting started | ||
``` | ||
$ git clone https://github.com/tireymorris/hyperwave.git | ||
$ cd hyperwave | ||
$ bun install | ||
$ bun dev | ||
``` | ||
|
||
Follow these steps to start developing with hyperwave: | ||
Navigate to http://localhost:1234 in your browser and start editing server.tsx to observe your changes live. | ||
|
||
1. Clone the repository: | ||
remove any of the articles code from the example if you want, it's not many lines. see the server, model files, routes, and db.ts. | ||
|
||
```sh | ||
git clone https://github.com/tireymorris/hyperwave.git | ||
cd hyperwave | ||
``` | ||
|
||
2. Install dependencies: | ||
## hyperwave.js | ||
|
||
```sh | ||
bun install | ||
``` | ||
dynamically load content on user events, without requiring a page reload. | ||
|
||
3. Start the development server: | ||
attaches automatically to any element with an href attribute (besides an anchor/link tag, which is treated as normal) | ||
|
||
```sh | ||
bun dev | ||
``` | ||
### Usage: | ||
|
||
4. Visit `http://localhost:1234` in your browser. | ||
``` | ||
<div href="/next-page" target="#content"></div> | ||
``` | ||
|
||
5. Start editing `server.tsx` to see your changes live. | ||
- `trigger`: Event that triggers loading (e.g., click, scroll). | ||
- `method`: HTTP request method (e.g., GET, POST). | ||
- `debounce`: Delay in milliseconds to optimize performance. | ||
- `offset, limit, data-total`: Manage pagination settings. | ||
|
||
``` | ||
<div href="/next-page" target="#content" trigger="scroll" method="GET" debounce="50" offset="0" limit="10" data-total="100"></div> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
module.exports = { | ||
apps: [ | ||
{ | ||
name: "hyperwave-server", | ||
script: "./dist/server", | ||
env: { | ||
NODE_ENV: "production", | ||
}, | ||
}, | ||
{ | ||
name: "hyperwave-worker", | ||
script: "./dist/worker", | ||
env: { | ||
NODE_ENV: "production", | ||
}, | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.