Add expo mobile app - #10
Conversation
Adds a React Native app in mobile/ (Expo SDK 57, React 19, RN 0.86,
expo-router, TypeScript) and the Rails API it talks to.
Rails side:
- Api::BaseController inherits ActionController::API, so the phone is
not subject to CSRF, cookies or the allow_browser version check, and
renders 404/400/422 as predictable JSON.
- Api::V1::TasksController exposes CRUD at /api/v1/tasks. Task is a
placeholder resource wired end to end, meant to be replaced.
- rack-cors for the Expo web target. Native builds ignore CORS.
- Development Host Authorization now accepts .local hostnames, which
were 403ing requests from phones resolving the host over mDNS.
Mobile side:
- src/lib/api.ts derives the API host from the Metro bundler address
instead of hardcoding localhost, which resolves differently on the
iOS simulator, the Android emulator (10.0.2.2) and real devices.
EXPO_PUBLIC_API_URL overrides it and is required for release builds.
- Tasks screen lists, creates, toggles and deletes through the API,
updating optimistically and rolling back on failure.
Housekeeping: rubocop, brakeman and the Docker build context skip
mobile/, whose node_modules ship Ruby CocoaPods scripts that would
otherwise be linted and scanned as our own. WSL Zone.Identifier files
are now gitignored.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The SDK 57 rescaffold reset several things that had been customised on
the earlier add-expo-mobile branch. Carried them across:
- app.json: name "Along With You", slug along-with-you, and the
alongwithyou:// URL scheme. The scaffold defaults meant the app
installed on a phone as "mobile" and claimed the mobile:// scheme,
which matters as soon as OAuth callbacks or push notifications
need a deep link.
- package.json: name alongwithyou-mobile, plus the typecheck script.
- engines.node, set to >=20.19.4 rather than the previous >=20.19.0,
because React Native 0.86 will not build below that.
- eslint, installed at the versions matching SDK 57 rather than the
SDK 54 ones, and mobile/README.md rewritten for the src/ layout and
the API client, which the old copy predates.
Two react-hooks/set-state-in-effect errors surfaced once linting ran.
Loading tasks no longer sets state before its first await, which was a
real cascading render. The remaining report on the mount effect, and one
in Expo's own use-color-scheme.web.ts, are suppressed inline: both want
Suspense or a data library, which this app does not have yet.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
This shouldn't be commited
There was a problem hiding this comment.
TS error on start-up: src/components/animated-icon.web.tsx(5,21): error TS2307: Cannot find module './animated-icon.module.css'
There was a problem hiding this comment.
TS error on start-up: src/constants/theme.ts(6,8): error TS2882: Cannot find module or type declarations for side-effect import of '@/global.css'
|
Claude PR review: Review: Expo mobile app + Rails JSON API79 files · +14,179 −19 · 2 commits I ran the full check suite locally rather than reading only:
The Rails half is ready to go, and the README and commit messages are unusually good — they explain why, 🔴 Blockers1.
|
|
fix for those blockers here PaulgSmith#1 |
No description provided.