Skip to content

rocicorp/reflect-starter-ts-vanilla

Repository files navigation

Simple Reflect/Vite/TypeScript/Vanilla Starter

This is the Vite TS/Vanilla starter app (npm create vite@latest) adjusted to use Reflect instead of in-memory state.

Install

npm install

Dev

In one shell, start the Reflect dev server:

npx @rocicorp/reflect dev

In another shell, start the UI dev server:

npm run dev

Open http://localhost:5173/ in two tabs and click the increment button.

Deploy Reflect

Deploy the Reflect server to relect.net:

npx @rocicorp/reflect publish

Change the serverOrigin Reflect parameter to point to the production server with a wss protocol:

const r = new Reflect({
  userID: "someUser",
  roomID: "myRoom",
  // Whatever publish printed out --  note `wss` protocol
  socketOrigin:
    "wss://reflect-starter-ts-vanilla.rocicorp-bot.reflect-server.net",
  mutators,
});

Run the UI against the deployed server:

npm run dev

You can also publish the UI anywhere, for example Vercel:

npx vercel

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published