A Capacitor app with three deployment targets sharing one web codebase: web/PWA, iOS, and Android.
- App name: Bhagvad Geeta
- Bundle/Application ID:
com.bhagvadgeeta.app - Web assets (canonical source):
www/(plain HTML/CSS/JS — no frontend framework/bundler) — edit here directly, this is not a copy of anything - Web/PWA deploy: GitHub Pages (
gitagyan.in), auto-deployed by.github/workflows/deploy-pages.ymlwheneverwww/**changes onmain. - Native projects:
ios/App(Xcode, Swift Package Manager) andandroid(Gradle) — both built from the samewww/vianpx cap sync - iOS CI:
codemagic.yamlbuilds and publishes to TestFlight on push tomain, skipped automatically for commits that only touchwww/(see pre-publish checklist)
www/ was ported from a separately maintained static PWA (gitagyan.github.io) to fit this repo's Capacitor structure. That source also contained ~700 pre-rendered per-chapter/per-verse static HTML pages built for GitHub Pages SEO (plus a Hindi mirror under hi/) — those are not included here, since this app serves everything through the single index.html SPA with a catch-all rewrite (same as the www/ used in the sibling muktmuni-app and vachanamrut-app repos). If SEO-optimized static pages for gitagyan.in are still wanted, keep maintaining those in the original GitHub Pages repo separately — it's a different serving model than this one.
The original site also had a newer, in-progress React/Vite rewrite (with server-side Gemini AI endpoints via Firebase Functions) previously pushed to this repo. That version was not carried forward — this repo now ships the vanilla-JS PWA instead, matching the architecture of the other Capacitor apps in this family. If the AI guidance feature is wanted again later, it needs to be re-added deliberately (client-side key entry, like the original static site's design, or a server-side Cloud Function, like the React rewrite's design — pick one and be consistent about where the API key lives).
www/ is the single source for all three targets:
- Web/PWA — deployed straight from
www/to GitHub Pages (gitagyan.in) by.github/workflows/deploy-pages.ymlon every push tomainthat toucheswww/**. Domain config:www/CNAME. - iOS —
npx cap synccopieswww/intoios/App/App/public;codemagic.yamlbuilds and ships to TestFlight. - Android —
npx cap synccopieswww/intoandroid/app/src/main/assets/public; build locally (see below) or wire up Codemagic/other CI the same way as iOS if needed.
Editing www/ and pushing to main updates the live web app automatically.
It does not by itself ship a new native build — npx cap sync +
rebuilding/reinstalling (or a Codemagic run) is still a separate step for
iOS/Android, same as any native app update.
Editing www/ (verse text, styling, etc.) doesn't need a new App Store
build every time, and Apple review/TestFlight processing isn't free in time
even when free in money. codemagic.yaml uses Codemagic's changeset
condition to skip the ios-testflight workflow when a push only touches
www/**. Any commit that touches something outside www/ (native code,
capacitor.config.json, package.json, codemagic.yaml itself, etc.) still
triggers a build normally, even if it also touches www/.
www/assets/verse_recitation/ holds ~112MB of MP3 Sanskrit recitation audio
for offline in-app playback, bundled straight into both native shells (per
the architecture decision for this app — same approach as the bundled audio
in the vachanamrut-app repo). Combined with assets/gita.db (~15MB) and
images/ (~35MB), expect long npx cap sync copies and a sizeable install
(~200MB) on both stores. If that ever becomes a problem, the fix is
switching audio playback in js/app.js to an absolute URL pointing at the
Firebase-hosted www/ instead of the bundled relative path, and dropping
assets/verse_recitation/ from the native copies.
bhagvadgeeta-app/
├── www/ # Web app source — this is what ships inside both native shells
├── ios/App/ # Xcode project (open App.xcodeproj or App.xcworkspace)
├── android/ # Android Studio / Gradle project
├── capacitor.config.json # Capacitor config (appId, appName, webDir)
├── resources/ # Source icon/splash art for `npx @capacitor/assets generate`
└── package.json
Capacitor copies www/ into each native project (ios/App/App/public, android/app/src/main/assets/public) whenever you run npx cap sync or npx cap copy. Never edit those copied folders directly — they're overwritten on every sync. Edit www/ itself; it's the canonical source.
| Tool | Notes |
|---|---|
| Node.js 18+ and npm | Runs the Capacitor CLI |
| macOS + Xcode (latest stable) | Required for iOS builds; install via the App Store |
| Xcode Command Line Tools | xcode-select --install |
| Android Studio (latest stable) | Required for Android builds |
| JDK 21 | This project pins Gradle to JDK 21 in android/gradle.properties via org.gradle.java.home. Install with brew install openjdk@21, or update/remove that line to point at your own JDK 21 install. |
| Apple Developer account | Needed to sign and upload to App Store Connect |
| Google Play Console account | Needed to sign and upload to the Play Store |
CocoaPods is not used — iOS dependencies are managed via Swift Package Manager (ios/App/CapApp-SPM), so there's no pod install step.
npm installThis installs the Capacitor CLI and core/iOS/Android platform packages listed in package.json. The ios/ and android/ native projects are already generated and committed — you don't need to run npx cap add.
- Edit
www/directly. Pushing tomainauto-deploys the web/PWA and, if the push also touches non-www/files, triggers the iOS CI build. - To see changes in the native apps, sync and rebuild:
You can also sync a single platform:
npx cap sync
npx cap sync iosornpx cap sync android. Usenpx cap copyinstead if you only changed web assets and haven't touched Capacitor plugins/config — it's faster since it skips the native dependency update step. - Open the native IDE and run on a simulator/emulator or device (see below).
- Sync and open the Xcode workspace:
(Opens
npx cap sync ios npx cap open ios
ios/App/App.xcworkspacein Xcode.) - In Xcode, select the App target → Signing & Capabilities:
- Choose your Team.
- Set a unique bundle identifier if you don't have access to
com.bhagvadgeeta.app.
- Bump version numbers as needed (target → General tab, or edit directly):
- Version (
MARKETING_VERSION, currently1.0) — user-facing version. - Build (
CURRENT_PROJECT_VERSION, currently1) — must increase on every App Store Connect upload.
- Version (
- Select Any iOS Device (arm64) as the run destination (not a simulator).
- Product → Archive.
- When the Organizer window opens, click Distribute App → App Store Connect → Upload, and follow the prompts (automatic signing is easiest).
- In App Store Connect, attach the uploaded build to a version, fill in release notes/screenshots/metadata, and submit for review.
Minimum supported iOS version is 15.0 (set in ios/App/CapApp-SPM/Package.swift).
npx cap run ios- Sync and open the project in Android Studio:
(Opens the
npx cap sync android npx cap open android
android/folder in Android Studio.) - Bump versions in
android/app/build.gradle:versionCode(currently1) — integer, must increase on every Play Store upload.versionName(currently"1.0") — user-facing version string.
- Create a release keystore (one-time, keep it outside of git and back it up — losing it means you can never update the app again under the same listing):
keytool -genkey -v -keystore bhagvadgeeta-release.keystore \ -alias bhagvadgeeta -keyalg RSA -keysize 2048 -validity 10000
- Build a signed release bundle. Easiest path is via Android Studio: Build → Generate Signed App Bundle / APK → Android App Bundle, point it at your keystore, and build the
releasevariant.- Or from the command line, after configuring signing in
android/app/build.gradle(or akeystore.propertiesfile):The outputcd android ./gradlew bundleRelease.aablands inandroid/app/build/outputs/bundle/release/.
- Or from the command line, after configuring signing in
- Upload the
.aabto the Google Play Console, fill in the release track (internal/closed/open/production), listing details, and submit.
Supported SDKs (from android/variables.gradle): minSdkVersion 24, compileSdkVersion/targetSdkVersion 36.
npx cap run android- Store listing content (description, keywords, age rating, privacy/data-collection answers, etc.)
- iOS builds/TestFlight without a local Mac for every collaborator — wire up a Codemagic team, App Store Connect integration named
codemagic_asc_integration, and signing before relying oncodemagic.yaml. - GitHub Pages enabled on repository with custom domain
gitagyan.inand HTTPS enforced. - App icons and splash screens generated from
resources/via@capacitor/assets— verify how they look on real devices before shipping. - Version/build numbers bumped on both platforms.
- Privacy policy URL ready (required by both stores) — note the app requests no accounts/logins, but does store user bookmarks/settings locally.
- Store listing copy and screenshots prepared at each store's required resolutions.
- iOS: archived with a distribution (not development) signing profile.
- Android: built with the release keystore, and that keystore is safely backed up.
- Tested a release build on a real device for both platforms before submitting.
- Confirm the ~150-200MB bundled audio/db/images are acceptable for both stores' size guidance, or switch to remote streaming (see A note on app size).
| Command | Purpose |
|---|---|
npx cap sync |
Copy www/ into both native projects and update native plugin dependencies |
npx cap copy [ios|android] |
Copy web assets only (no dependency update) |
npx cap open [ios|android] |
Open the native IDE for a platform |
npx cap run [ios|android] |
Build and run on a connected device/simulator |
npx cap doctor |
Sanity-check your Capacitor setup |