https://github.com/just-shadyumbrella/vite-solid-fastify
A simple example to develop front-end app with Vite and SolidJS as well as Fastify backend support through Vite's `server.proxy` config, and bundled with Rollup.
https://github.com/just-shadyumbrella/vite-solid-fastify
fastify fastify-boilerplate fastifyjs rollup rollupjs rollupjs-boilerplate solid solidjs solidjs-boilerplate vite vitejs
Last synced: 2 months ago
JSON representation
A simple example to develop front-end app with Vite and SolidJS as well as Fastify backend support through Vite's `server.proxy` config, and bundled with Rollup.
- Host: GitHub
- URL: https://github.com/just-shadyumbrella/vite-solid-fastify
- Owner: just-shadyumbrella
- Created: 2025-03-09T00:26:29.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-11T02:15:39.000Z (over 1 year ago)
- Last Synced: 2025-03-23T05:21:07.469Z (over 1 year ago)
- Topics: fastify, fastify-boilerplate, fastifyjs, rollup, rollupjs, rollupjs-boilerplate, solid, solidjs, solidjs-boilerplate, vite, vitejs
- Language: TypeScript
- Homepage:
- Size: 39.1 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Vite + Solid ~ Rollup + Fastify
A simple example to develop front-end app with Vite and SolidJS, as well as Fastify back-end support through Vite's [`server.proxy`](https://vite.dev/config/server-options#server-proxy) [config](./vite.config.ts#L15) and bundled with Rollup.
## Usage
```bash
npm install # or pnpm install or yarn install
```
Start backend server (first) and Vite dev server
```bash
npm run dev:backend
# Open seperate terminal
npm run dev
```
## Build
```bash
npm run build
```
Or run this separately
```bash
# Client
npm run build:client
# Server
npm run build:server
```
You can now serve the production build with `npm run preview`. Or just run `node .` at [`dist`](./dist/index.js) folder, it's generally fully portable and minified by `esbuild`. You can adjust the build output by editing the [`vite.config.ts`](./vite.config.ts) file for front-end and [`rollup.config.ts`](./rollup.config.ts) for back-end.
The API endpoint also works alongside [Solid Router](https://docs.solidjs.com/solid-router), including 404 and 500 error pages. Check out [`src/client/index.tsx`](./src/client/index.tsx#L23) and see how the Fastify server handles SPA requests in [`src/server/index.ts`](./src/server/index.ts#L34).
### Learn more on the [Solid Website](https://solidjs.com) and come chat with us on our [Discord](https://discord.com/invite/solidjs)
## Deployment
Learn more about deploying your application with the [documentations](https://vite.dev/guide)