This is a frontend template for web-based projects that ensures consistency across all applications. It utilizes React, Tailwind, @thatsit/ui, TypeScript, Dexie, and Zustand. Every app we build with this template should be local-first and have the ability to work offline.
Read more about the purpose and logic of this particular app in @README.md
- ALWAYS use @thatsit/ui components for UI. Avoid creating anything custom unless absolutely necessary. Ask first.
- ALWAYS use @thatsit/ui CSS variables for colors (--bg, --text-primary, --primary, etc.)
- ALWAYS use @thatsit/ui fonts (Inter for body, Nunito for headings, Work Sans for quotes)
- ALWAYS use Zustand for state management. Never use React Context.
- Use Tailwind for styling, but prefer @thatsit/ui component props when available.
- Prioritize simplicity.
Every app MUST be a proper PWA:
- Use
vite-plugin-pwawithregisterType: 'autoUpdate' - Include proper manifest with icons (192x192 and 512x512)
- Support offline mode via service worker
- Use
viewport-fit=coverfor iOS safe area support - Wrap content in
Layout.tsxwhich handles safe-area insets
The template includes automatic safe-area handling for iOS PWAs:
index.htmlhasviewport-fit=coverin the viewport meta tagindex.cssexposes safe-area-inset CSS variablesLayout.tsxapplies padding usingmax(1rem, var(--safe-area-inset-*, 0px))
Do NOT modify this safe-area setup unless you understand iOS PWA edge cases.
When creating a new app from this template:
-
Update
index.html:- Change
<title>to your app name (e.g.,Tasks | That's It) - Update
apple-mobile-web-app-titlemeta tag - Update
descriptionmeta tag
- Change
-
Update
vite.config.tsPWA manifest:- Change
idto unique app ID (e.g.,/tasks-thatsit/) - Change
nameto full app name - Change
short_nameto short display name - Update
description
- Change
-
Create app icons:
- Create your SVG icon in
public/favicon.svg - Copy to
public/mask-icon.svg - Update paths in
scripts/generate-icons.mjs - Run
node scripts/generate-icons.mjs
- Create your SVG icon in
-
Update
src/lib/syncConfig.ts:- Change
appIdfrom'my-app'to your app name (e.g.,'tasks','calendar') - Change
tablesfrom['items']to your actual Dexie table names - The
appIdmust be registered on the sync backend or auth will fail with "Invalid App"
- Change
-
Update
src/lib/db.ts:- Replace the example
Iteminterface with your app's data types - Update the Dexie schema to match your tables
- Update
serializeEntityanddeserializeEntityfor your types
- Replace the example
-
Register the app on sync backend (sync.thatsit.app) if using sync
pnpm install- installs dependenciespnpm dev- starts the development serverpnpm build- builds the project for productionnode scripts/generate-icons.mjs- generates PWA icons from SVG