Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and some Oxlint rules.

Currently, two official plugins are available:

React Compiler

The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see this documentation.

Expanding the Oxlint configuration

If you are developing a production application, we recommend enabling type-aware lint rules by installing tsrs and editing .oxlintrc.json:

{
  "$schema": "./node_modules/oxlint/configuration_schema.json",
  "plugins": ["react", "typescript", "oxc"],
  "options": {
    "typeAware": true
  },
  "rules": {
    "react/rules-of-hooks": "error",
    "react/only-export-components": ["warn", { "allowConstantExport": true }]
  }
}

See the Oxlint rules documentation for the full list of rules and categories.

Live chat

Run npm run dev for local development. Open the same address in two browser tabs to try the shared chat.

For a shared deployment, run npm run build and then npm start on a Node.js host using Node 24 or later. The server serves both the built site and the chat API on the same address. It listens on PORT (default 4173). A static-only deployment can display the site, but live chat needs the Node server. Deploy a single server instance to keep all visitors in the same room.

Chat is anonymous and keeps the latest 50 messages in memory until the server restarts. Cheat codes only affect the browser that enters them.

Test on a phone

Connect your computer and phone to the same Wi-Fi and run npm run dev:lan. Open the Wi-Fi IPv4 address printed by Vite on port 5174 on both devices. The LAN server and the regular localhost server run separate rooms. If the LAN address is unreachable, try a network that allows devices to communicate, such as a personal hotspot. If the page opens on a public URL but says it is connecting, check that the same URL serves the Node chat backend and allows the /api/chat/events stream.

Netlify deployment

Deploy the repository through Netlify's Git integration so Netlify runs the build in netlify.toml and bundles the chat function. Uploading just dist omits the function. The public site uses a same-origin function and Netlify Blobs for the latest 50 messages, with an update check every three seconds while the page is visible. Production and preview deploy contexts have separate chat histories. The LAN and Node environments continue to stream chat events.

Messages sent after deletion support is deployed can be deleted from the browser that sent them. The browser keeps each deletion key locally, so clearing site data removes access to those controls.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages