Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/daniel-le97/nuxt-bun-preset
https://github.com/daniel-le97/nuxt-bun-preset
Last synced: 24 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/daniel-le97/nuxt-bun-preset
- Owner: daniel-le97
- Created: 2024-01-01T18:25:02.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-10T03:35:50.000Z (about 1 year ago)
- Last Synced: 2024-12-09T14:57:55.528Z (about 1 month ago)
- Language: TypeScript
- Size: 953 KB
- Stars: 8
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Nuxt 3 Bun websocket chat
Look at the [Nuxt 3 documentation](https://nuxt.com/docs/getting-started/introduction) to learn more.
## notice
this project relies on bun in development and production so it is requiredthe custom preset can be found in [core](./server/core)
an extra nitro hook is added in this preset
```javascript
import {type Server} from 'bun'
export default defineNitroPlugin(nitroApp => {
// this will not be typed currently
nitroApp.hooks.hook('server', (server: Server) => {
// do something with the bun server
})
})
```
i am trying to turn this into a module but unsure of how to correctly update types## Features
1. custom dev and production preset to customize nuxt and nitro to the fullest
2. this project showcases a websocket chat with bun websockets
3. uses local auth via h3 sessions and bun password hashing [auth](./server/api/auth/)
4. both dev and prod include nitros new Tasks api
5. antfu's eslint config for formatting =)## Setup
Make sure to install the dependencies:
```bash
# bun
bun install
```## Development Server
Start the development server on `http://localhost:3000`:
```bash
# bun
bun run dev
```## Production
Build the application for production:
```bash
# bun
bun run build
```run production build:
```bash
# bun
bun run start
```## Deployment
a dockerfile has been provided for ease of deployments!Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.