remix logo

Hacker Remix

Show HN: Bhvr, a Bun and Hono and Vite and React Starter

122 points by stevedsimkins 1 day ago | 92 comments

Hey all! I've been using this stack personally for a while now and decided to automate it a bit by turning it into a template I can reuse. Hope others might find it helpful!

pavlov 1 day ago

I think you might want to elaborate on why this stack is good.

Right now it’s summarized as “typesafe fullstack monorepo”… But that’s so dense, it’s practically just three buzzwords together. A more realistic description of the pros and cons would be welcome.

I’ve never heard of Hono, and I’d personally need a lot more convincing to pick an unknown framework for a new app.

hombre_fatal 1 day ago

Koa was next gen Express when TJ Hollowaychuk made it. Used first class promises to have real middleware like “response = await next()”

Hono is basically next gen Koa: zero dependencies and made to work in additional contexts like in CloudFlare Workers.

- Express deps: https://npmgraph.js.org/?q=express (lol)

- Hono deps: https://npmgraph.js.org/?q=hono

Node web servers are all so similar (you write ~identical code no matter which one you use) that tie-breaking on a dep diff this big is reasonable.

josephg 15 hours ago

In what way is Hono better than Koa? Any package can have zero dependencies if you just inline / bundle them in your package.

hombre_fatal 10 hours ago

Trivial dependencies should be inlined. Consider leftPad or isEven.

Or these Koa deps:

- https://github.com/isaacs/inherits/blob/main/inherits.js

- https://github.com/component/toidentifier/blob/master/index....

When you're building a web server library, you need to care about supply chain attacks because you're the one exposing people to them.

Anyways, that's beside the point. Hono is what Koa should have been if Koa wasn't frozen 10 years ago: a simple `res = await handle(req)` abstraction that works everywhere including edge workers.

Wazako 14 hours ago

It was designed by cloduflare for serverless use. There's no dependency on node, as cloudflare is based on web standards, so it was designed around warper for browser-native js modules (Request, crypto, ... hence the low dependency), which is why it integrates well with bun and deno.

nopelynopington 1 day ago

[dead]

DrStartup 12 hours ago

Not a dev, but I know what these are. Maybe the post was meant for people that know. Bun / deno new nodejs. Hono new koa new express. Vite new webpack. React still React but most popular.

stevedsimkins 1 day ago

I appreciate the feedback! This stack does kinda assume you already know what Hono is but I can definitely flesh it out a bit more, and perhaps show some code to demonstrate it.

johnhamlin 1 day ago

I had the same reaction to Hono, but now see it has 23k+ stars on GitHub. Learn about a new JS framework everyday!

mathgeek 1 day ago

As to whether or not this is a good thing is left as an exercise to the reader. ;)

VyseofArcadia 1 day ago

I mean, I also don't know Bun and Vite. I've at least seen React. You should probably just explain the whole stack.

Etheryte 1 day ago

This is like saying a Java library readme should start with what the JVM is. It's fine to not know these things, but the majority of this comes with the territory. Right now it sounds like you're simply not the target audience. The Github readme includes a link to all of the major bits, so I don't really see the problem.

pavlov 1 day ago

If you were trying to convince me to build a web app in Java, you wouldn’t need to explain what the JVM is, but you’d need to make a strong argument for why Java is better than the alternatives available in 2025.

So the question is whether the target audience here is “people who want to build full-stack web apps” or “people who are already using the BHVR stack”.

crab_galaxy 1 day ago

The benefits are very clear to me.

If you build MERN apps, this is a template that replaces Express with Hono, Node with bun, and Webpack with Vite.

All of which are significantly faster than their counterparts. Hono can be deployed anywhere and has a much smaller bundle size than Express.

pavlov 1 day ago

These two paragraphs would already be a much more helpful project description than “typesafe fullstack monorepo”.

pier25 1 day ago

If you've never heard of Bun or Vite you're clearly not the audience for this.

pavlov 1 day ago

Why not? There are a lot of people who use the 2010s de facto standard JS server stack — Node, Express, Webpack etc. — but don't necessarily have the time or inclination to keep up to date with every new project in this space. It's a lot to follow.

The exclusive gatekeeping messaging doesn't seem very useful. There's probably a much bigger audience for "Hey, instead of starting yet another Node project, why not try this?" rather than preaching to the already converted early adopters.

pier25 1 day ago

Vite is a project with 25M weekly NPM downloads and used by some 9M github repos. It's not an obscure project by any stretch of the imagination. Heck it's almost as popular as React.

https://npmtrends.com/react-vs-vite-vs-webpack

Imagine someone posting a project that uses React and then someone demanding they explain what React is...

dev_l1x_be 1 day ago

You are selecting the frontend crew and making claims based on that. Many of us are not frontend devs just want to wrap an API. At least I do.

pier25 1 day ago

> Many of us are not frontend devs

That's fine but OP's template is clearly for devs with frontend skills. No?

zaphirplane 13 hours ago

Heard not an expert in, parent is right

liveafterlove 1 day ago

Hono is pretty good js a runtime agnostic router. On their site:

Works on Cloudflare, Fastly, Deno, Bun, AWS, or Node.js. The same code runs on all platforms.

https://hono.dev

How does compare to ultrajs? Or just use hono client side jsx, its pretty much like react already.

insin 17 hours ago

Hono also has an official Vite devserver plugin if want an easy way to run a single integrated dev server locally for an API which also serves up your UI and has the hot reloading goodness you want.

I've used a very similar setup for a couple of new projects which were about to default to Next.js but didn't really specifically need what Next.js does (e.g. its SSR abstractions, these were internal, client-only apps sitting behind an auth redirect) from wasting their time fighting it.

Hono also supports JSX on the backend out of the box of you want to use components as a superior alternative to string templating libraries to serve up some HTML, a middle ground of sorts if Astro (:heart:) is too much for what your app needs to do.

I haven't needed to take advantage of this yet, but if you don't need full-fat React, it can also SSR and run on the client, sort of "vanilla JSX" if you will (sorry).

molszanski 14 hours ago

Astro :heart: indeed.

I think Astro is perfect fit for majority of projects.

Ridiculously simple in use without all the next toil and issues

vlucas 8 hours ago

Alternatives are good, but there is almost no information on this site. I went to the site hoping to see things like what a route looks like, the syntax, how I might create a page or layout, how to make server only things vs. client only things, etc. None of that is on the page or GitHub README though. Not even one code example. Show people how this works!

pier25 1 day ago

Hono is great. It's a shame it all depends on a single maintainer and there's zero official funding afaik.