Biblia Codex - Web/Mobile Architecture
This skill defines the structural patterns, technology stack, and best practices exclusively for the Biblia Codex application (React + Capacitor hybrid).
🛠 Tech Stack
- Frontend Core: React 19 (hooks and Context API), TypeScript.
- Build Tool: Vite +
tsx(for dev server/API). - Styling: Tailwind CSS 4,
framer-motion(animations),lucide-react(icons),clsx+tailwind-mergefor class utility. - Offline Database & Storage:
sql.js(for SQLite modules) andidb(for IndexedDB native app caching). - Mobile Wrapping: Capacitor 6 (Core, Android, Filesystem plugins).
🏗 Architectural Rules
1. State Management (No Redux)
- Do NOT introduce external complex state managers like Redux or Zustand unless explicitly requested.
- DO use React Context (
AppContext.tsx) combined with Hooks (useContext,useReducer,useState) for global states.
2. Styling Patterns (Tailwind 4 + UI Libraries)
- Utilize the
clsxandtailwind-mergeutility for dynamic class names:className={twMerge(clsx("base", dynamicCondition && "active"))} - Component designs must follow the Codex application's unified premium aesthetic (clean contrasts, dark mode support in Tailwind).
- For animations, strictly rely on
framer-motionproperties (initial,animate,exit).
3. File Execution & Scripts
- Always prefer Vite native plugins for React (
@vitejs/plugin-react). - Android builds rely on:
npm run cap:syncandnpx cap run android. When adding a new Capacitor plugin, do not forget to document the required Android XML changes (Manifest permissions).
4. Background Processing (SQLite & IDB)
- Blobs & WASM: Ensure
sql.jsinitializes with the correct WASM path (usually handled in the public directory). - Heavy database processes like searching through the entire Bible must not block the main JS thread. While
idboperations are natively asynchronous,sql.jsqueries on large module datasets may require splitting work or utilizing WebWorkers/requestAnimationFrameif performance becomes a bottleneck.
🤝 Agent Interaction
- mobile-developer / frontend-specialist: Rely on this skill file instead of traditional Android Kotlin documents when modifying the core app UX/UI.