Skip to content

Lantern โ€” Scaffold Notes โ€‹

This file describes the current scaffold and how to work with it.

Web scaffold โ€‹

  • Vite + React
  • PWA enabled via vite-plugin-pwa (configured in vite.config.mjs)
  • Tailwind CSS configured (tailwind.config.cjs, postcss.config.cjs, src/tailwind.css)
  • Storybook for component development (npm run storybook)
  • Vitest + Testing Library for unit tests (vitest.config.js, test.setup.js)

Key files โ€‹

  • Root: package.json, index.html, .gitignore
  • App shell & routing: src/main.jsx, src/App.jsx (hash-based routes)
  • Merchants: src/screens/merchant/MerchantDashboard.jsx, src/screens/merchant/OfferForm.jsx
  • Firebase setup: src/firebase.js
  • Shared helpers: src/lib/ (auth/profile services, encryption, device helpers)
  • PWA: public/manifest.webmanifest, public/icons/*, vite.config.mjs
  • Tests: vitest.config.js, test.setup.js, src/__tests__/
  • Storybook docs: docs/storybook/*

Commands โ€‹

  • npm install โ€” install dependencies
  • npm run dev โ€” run dev server (Vite)
  • npm run build โ€” production build
  • npm run preview โ€” preview built site (best for PWA testing)
  • npm run storybook โ€” run Storybook on http://localhost:6006
  • npm test โ€” run unit tests (Vitest)
  • npm run lint โ€” lint src
  • npm run lint:fix โ€” autofix lint issues
  • npm run format โ€” format source files
  • npm run format:check โ€” check formatting only
  • npm run test:coverage โ€” run tests with coverage

Mobile (next) โ€‹

  • Recommended: Initialize an Expo project in /mobile/ with npx create-expo-app mobile.
  • Share UI logic where possible; consider monorepo structure later.

PWA (web) โ€‹

  • Installable behavior on supported browsers; service worker generated at build time.
  • See ./PWA.md for local testing instructions.

Suggested backend approaches โ€‹

  • Realtime: Firebase or Supabase for quick prototypes
  • Custom backend: Node.js + Express + WebSocket (or Socket.IO)

Built with VitePress