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 invite.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)
Workspaces
This monorepo uses npm workspaces to manage multiple projects:
| Workspace | Path | Purpose |
|---|---|---|
admin | /admin | Internal admin portal linking to Wiki.js for docs editing |
discord-bot | /discord-bot | Discord bot for GitHub issue integration |
firebase-functions | /firebase-functions | Cloud Functions for Firebase backend |
Admin Portal
The admin portal (/admin) is an internal-only React app for managing documentation and platform data:
- Tech Stack: Vite + React (same as main app)
- Docs Editing: StackEdit or GitHub.dev (direct GitHub integration)
- Auth: Firebase Auth with admin role check
- Deployment: Cloudflare Pages at
admin.ourlantern.app - Git Integration: Edits commit directly to
/docsfolder in GitHub
Key Files:
admin/src/App.jsx— Main app with auth flowadmin/src/firebase.js— Firebase config with admin role checkingadmin/src/components/DocsEditor.jsx— Links to StackEdit and GitHub.dev
Commands:
npm run admin:dev— Run admin dev server on port 3001npm run admin:build— Build admin for productionnpm run admin:preview— Preview built admin portal
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 dependenciesnpm run dev— run dev server (Vite)npm run build— production buildnpm run preview— preview built site (best for PWA testing)npm run storybook— run Storybook on http://localhost:6006npm test— run unit tests (Vitest)npm run lint— lintsrcnpm run lint:fix— autofix lint issuesnpm run format— format source filesnpm run format:check— check formatting onlynpm run test:coverage— run tests with coverage
Mobile (next)
- Recommended: Initialize an Expo project in
/mobile/withnpx 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.mdfor local testing instructions.
Suggested backend approaches
- Realtime: Firebase or Supabase for quick prototypes
- Custom backend: Node.js + Express + WebSocket (or Socket.IO)