• Stars
    star
    1,053
  • Rank 42,153 (Top 0.9 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created 10 months ago
  • Updated 17 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The Full Stack JavaScript SDK

The JavaScript Server SDK to build full stack apps and frameworks with your own opinions.
powered by vite and nitro

vinxi

Compose full stack applications (and frameworks) using Vite, the versatile bundler and dev server, and Nitro, the universal production server. The core primitive in vinxi is a router.

Inspired by the Bun.App API.

  • Routers are handlers that tell us how specific URLs should be handled. We support various router modes: "static", "spa", "handler", "node-handler" (and new ones can be added). Routers specify the handler file (entrypoint) to use for their base-prefixed routes. They can also specify a dir and style in some router modes to include a file system router that is provided to the handler. Routers specify their bundler configuration, via the build property. The routers tell the bundler what entry points to build, what vite plugins to use, etc.

Examples

Framework Category Example StackBlitz Link
React RSC SPA Open in StackBlitz
SPA Basic Open in StackBlitz
MDX Open in StackBlitz
TanStack Router (Pages) Open in StackBlitz
TanStack Router (App) Open in StackBlitz
Wouter Open in StackBlitz
SSR Basic Open in StackBlitz
Basic w/Cloudflare Open in StackBlitz
TanStack Router (App) Open in StackBlitz
Wouter Open in StackBlitz
Solid SPA Basic Open in StackBlitz
SSR Basic Open in StackBlitz
Solid Router Open in StackBlitz
Solid Start Open in StackBlitz
Vanilla SPA Open in StackBlitz
TRPC Open in StackBlitz

Goals

Primary goal is to build the tools needed to build a NextJS or SolidStart style metaframework on top of vite without worrying about a lot of the wiring required to keep dev and prod working along with SSR, SPA, RSC, and all the other acronyms. etc. On top of that, we should be able to deploy anywhere easily.

Mostly trying to disappear for the user outside the app.js file

The surface layer we are intending to tackle:

  1. Full stack builds (handle manifest stuff to figure out what assets to load at prod runtime)
  2. Dev time asset handling (avoiding FOUC in SSR frameworks) and smoothing over some of vite's dev/prod mismatching behaviours by providing common manifest APIs that work in dev and prod the same way
  3. File system router (not any specific file system conventions, just an API for interfacing with FileSystemRouters and utils to implement your conventions in them)
  4. Building the server, and providing a simple opaque handler API to control the server
  5. Adapter stuff to deploy to various platforms with support for all the features they provide
  6. Not to abstract away the platforms. Let people use what they want to the fullest
  7. Have little opinion about how the app should be authored or structured

Roadmap

  • vinxi deploy
  • hooks throughout the app licycle:
    • dev: app:created, app:started, router:created

Try it out

npm install vinxi

React SSR

import reactRefresh from "@vitejs/plugin-react";
import { createApp } from "vinxi";

export default createApp({
	routers: [
		{
			name: "public",
			mode: "static",
			dir: "./public",
		},
		{
			name: "client",
			mode: "build",
			handler: "./app/client.tsx",
			target: "browser",
			plugins: () => [reactRefresh()],
			base: "/_build",
		},
		{
			name: "ssr",
			mode: "handler",
			handler: "./app/server.tsx",
			target: "server",
		},
	],
});

Solid SSR

import { createApp } from "vinxi";
import solid from "vite-plugin-solid";

export default createApp({
	routers: [
		{
			name: "public",
			mode: "static",
			dir: "./public",
		},
		{
			name: "client",
			mode: "build",
			handler: "./app/client.tsx",
			target: "browser",
			plugins: () => [solid({ ssr: true })],
			base: "/_build",
		},
		{
			name: "ssr",
			mode: "handler",
			handler: "./app/server.tsx",
			target: "server",
			plugins: () => [solid({ ssr: true })],
		},
	],
});

More Repositories

1

magiql

๐ŸŒ ๐Ÿ’ซ Simple and powerful GraphQL Client, love child of react-query โค๏ธ relay
TypeScript
199
star
2

use-monaco

Use ๐Ÿ—’๏ธ monaco-editor in any โš›๏ธ React app with simple hooks ๐ŸŽฃ
TypeScript
101
star
3

vite-next

NextJS alternative built on top of Vite, React Router, React Query
TypeScript
46
star
4

magiql-browser

Web-based Browser and IDE for GraphQL (based on monaco-editor), useful for playgrounds for GraphQL servers
TypeScript
28
star
5

fully-react

TypeScript
25
star
6

lepton-footprint-extraction

Automated building polygon extraction from satellite imagery
Python
15
star
7

solid-mdx

MDX support for SolidJS
TypeScript
12
star
8

scoreboard-api

Live NBA scores and boxscores API (data scraped from ESPN website)
Python
6
star
9

game-tools

TypeScript
6
star
10

editable-jsx

TypeScript
6
star
11

excalidraw-studio

TypeScript
5
star
12

solid-three

TypeScript
4
star
13

react-box

A simple yet super powerful Box primitive (with others) for React powered by styled-system and framer-motion
TypeScript
4
star
14

pkger

๐Ÿ“ฆ Simple (yet powerful) build tool for any target (browser/node/cli) โš™ Powered by rollup, babel, gluegun, typescript
TypeScript
3
star
15

create-hook-context

A better and more powerful React.createContext powered by hooks ๐ŸŽฃ
TypeScript
2
star
16

vinxi-island

TypeScript
2
star
17

scoreboard

Desktop App for NBA live scores and boxscores
JavaScript
2
star
18

awesome-rsc

2
star
19

elf

YAML syntax-based task runner
TypeScript
1
star
20

todo-wallpaper

โ˜‘๏ธ Todo App for MacOS tray with auto-updating desktop wallpaper
JavaScript
1
star
21

ocean-theme

๐ŸŒŠOceanic theme for VS Code
JavaScript
1
star
22

solid-starter

Created with StackBlitz โšก๏ธ
TypeScript
1
star
23

tanstack-router-app

HTML
1
star
24

tavern

Super simple framework for service-based architecture in monolithic servers
TypeScript
1
star
25

next-monaco-editor

JavaScript
1
star
26

test-solid-6

TypeScript
1
star
27

solid-start-hybrid

TypeScript
1
star
28

examples

An example project showing how the <TLDraw/> component can be used and controlled in a React app.
TypeScript
1
star
29

sapiens

TypeScript
1
star
30

vite-react-starter

TypeScript
1
star
31

playground

TypeScript
1
star
32

vitap

The Vite App framework
JavaScript
1
star
33

reactscript

JavaScript
1
star
34

nba-stats

Java wrapper for NBA Stats API
Java
1
star
35

malaria-index

TypeScript
1
star
36

bluwy-whyframe-vq5xek

Created with StackBlitz โšก๏ธ
CSS
1
star
37

game-editor-monorepo

TypeScript
1
star
38

leva-1

๐ŸŒ‹ React-first components GUI
TypeScript
1
star
39

react-charts

โš›๏ธ Simple, immersive & interactive charts for React
HTML
1
star