Run in Browser
npm run start
Browser: Dev Frontend and Dev Backend (localhost)
This option should be at the top level of capacitor.config.json "server": { "url": "http://sam.local:5173", "cleartext": true },
Browser: Prod Frontend and Prod Backend
Run: vite build npx serve dist
If you need to login again: run localStorage.clear() in the browser dev tools console and then refresh the page.
Run On Device
https://capacitorjs.com/docs/ios#adding-the-ios-platform
One-Time Install: npm install @capacitor/ios npx cap add ios
To Open XCode: npx cap open ios
Run this command to rebuild for iOS npm run build && npx cap copy ios
If getting black screen: npx cap sync iOS
iOS: Dev Frontend and Dev Backend (localhost)
This option should be at the top level of capacitor.config.json "server": { "url": "http://sam.local:5173", "cleartext": true },
iOS: Dev Frontend with Prod Backend (frm.so)
Add "https://frm.so" to VITE_API_URL in .env.development
iOS: Prod Frontend and Prod Backend (frm.so)
Remove the "server" object from capacitor.config.
Various Commands
npx cap config - this will list the full configuration currently being used
Architecture
In Development, API routes are routed using the vite.config.js.
Notes
Background Color: In src/manifest.json, "#31d53d" refers to the green color which is visible in the background in the web version. This is not visible in the built version.
Test Push Notifications: https://icloud.developer.apple.com/dashboard/notifications/teams/53DK57C7ZF/app/russell.sam.forum/notifications/create?notificationId=8bb87cf2-9590-4a63-b7e1-e4c7f2a2c879&environment=DEVELOPMENT¬ificationType=push
Note: Even if built in "production" mode, the tokens will still be considered "development" by Apple until the app is actually deployed