Home

Awesome

tinybase-ts-react-electricsql

This is a template for a simple TinyBase app, using TypeScript, React, and ElectricSQL.

It is a fork of the ElectricSQL web example app, with small changes to introduce TinyBase into the view layer. All the credit for the magic goes to ElectricSQL!

A four-way sync between browsers

Instructions

  1. Make a copy of this template into a new directory:
npx tiged tinyplex/tinybase-ts-react-electricsql my-tinybase-app
  1. Go into the directory:
cd my-tinybase-app
  1. Install the dependencies:
npm install

Note that you will also need to install Docker.

  1. Start Postgres and Electric using Docker:
npm run backend:up
  1. Setup the database schema:
npm run db:migrate
  1. Generate the type-safe client:
npm run client:generate
  1. Run the server:
npm run dev
  1. Go the URL shown and enjoy!

Other templates

There are eleven templates for TinyBase, of which this is one:

TemplateLanguageReactPlus
vite-tinybaseJavaScriptNo
vite-tinybase-tsTypeScriptNo
vite-tinybase-reactJavaScriptYes
vite-tinybase-ts-reactTypeScriptYes
vite-tinybase-ts-react-syncTypeScriptYesSynchronization
vite-tinybase-ts-react-sync-durable-objectTypeScriptYesSync & Durable Objects
vite-tinybase-ts-react-pgliteTypeScriptYesPGlite
vite-tinybase-ts-react-crsqliteTypeScriptYesCR-SQLite
tinybase-ts-react-partykitTypeScriptYesPartyKit
👉tinybase-ts-react-electricsqlTypeScriptYesElectricSQL
expo/examples/with-tinybaseJavaScriptYesReact Native & Expo

License

This template is forked from an ElectricSQL example that has an Apache-2 license. TinyBase is MIT licensed.