Coder Social home page Coder Social logo

snowwintermaye / bun-elysia-nextjs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from itzderock/bun-elysia-nextjs

0.0 0.0 0.0 88 KB

Demo showing Bun + Elysia + NextJS (app dir)

Home Page: https://bun-elysia-nextjs-production.up.railway.app/

JavaScript 1.64% TypeScript 93.27% CSS 5.08%

bun-elysia-nextjs's Introduction

Bun + ElysiaJS + NextJS

demo-video-bun.mp4

Demo Deployment

A sample project showing ElysiaJS running as the Next.JS custom server with full end-to-end typesafety similar to tRPC and ts-rest. You get to define the route paths (unlike with tRPC) and no extra boilerplate is needed (unlike with ts-rest contracts). All running on the fast bun runtime.

You can access Bun globals in React Server Components (for example, Bun.password, Bun.file). Hot Module Reloading is also supported.

Tested with bun v1.0.4

Production Deployment

Simply run bun build and wait for NextJS to build the pages. Then you can start the server in production mode with bun start or run the entrypoint with NODE_ENV set to production. This will serve the built NextJS pages from the .next folder in the process's cwd.

Based on my measurements, this basic app uses 0% CPU on idle and ~280MB of RAM on start. This is compared to normal Node.JS which uses ~400MB for a similar sized app.

On Railway (nixpacks)

Railway is a simple cloud deployment platform and with their Nixpacks builder, you can deploy this project with a single click. On their dashboard, just connect your GitHub repo and sit back and relax.

With Docker

soon™️

bun-elysia-nextjs's People

Contributors

itzderock 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.