Git Product home page Git Product logo

vite-hono-starter's Introduction

Vite & Hono Starter

This is a starter template for building fullstack applications using Vite (with React) and Hono. It provides a foundation for quickly prototyping and developing web applications without the need for frameworks like Next.js.

Features

  • Hono server for building scalable and performant backend APIs ady build configuration for optimized deployments
  • Integration of Vite to build the frontend application for Hono to serve
  • TypeScript support for both the frontend and backend
  • RPC support for building fullstack applications with a single server

Getting Started

To get started, install the dependencies and start the development server:

pnpm install && pnpm run dev

This will start the Hono server and Vite development server at http://localhost:4000.

Building for Production

To build the application for production, run:

pnpm run build

This will build the frontend application using Vite and the backend application using Hono. The built application will be available in the dist directory for the server and the build directory for the client.

Routing

The Hono server handles all server-side routing. To add a new route, create a new file in the api directory. Update api/index.ts to include the new route.

Hono also serves the frontend application. This allows you to take advantage of Hono RPC, allowing you to build fullstack applications with a single server.

Accesing API Routes

To access the API routes, you can use the api object from the utils/frontend module. For example:

import { api } from "../utils/frontend"
const res = await api.todo.list.$get()

Contributing

This starter template is open to contributions. If you have any ideas or improvements, feel free to open an issue or a pull request.

vite-hono-starter's People

Contributors

sammyjoyce avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.