An Expo React Native mobile application that helps disabled students have more accessibility around UT Campus on an interactive map, powered by Expo and Cloudflare Workers.
-
Clone the repository
git clone https://github.com/Longhorn-Developers/Mobilize.git cd Mobilize -
Install mobile app dependencies
pnpm install
-
Install server dependencies
cd server pnpm install -
Setup environment variables
.env.local
EXPO_PUBLIC_API_URL=http://localhost:54321
server/.env (you can find these in cloudflare dashboard)
CLOUDFLARE_ACCOUNT_ID= CLOUDFLARE_DATABASE_ID=
-
Google OAuth Configuration
Google OAuth requires configuration in two places: the mobile app (
.env) and the backend server (server/.env)..env(root directory - Mobile App)# Web Client ID - used by the mobile app for Google Sign-In EXPO_PUBLIC_GOOGLE_WEB_CLIENT_ID=your-web-client-id.apps.googleusercontent.comserver/.env(Backend Server)# Same Web Client ID as above - used to verify ID tokens GOOGLE_CLIENT_ID=your-web-client-id.apps.googleusercontent.com # Client Secret from Google Cloud Console (Web Client) GOOGLE_CLIENT_SECRET=GOCSPX-xxxxxxxxxxxxxxxxxxxxxxxxxxxx # Secret for signing sessions (generate a random 64-char hex string) BETTER_AUTH_SECRET=your-random-64-character-hex-secret # Your backend URL BETTER_AUTH_URL=http://localhost:54321
- Go to Google Cloud Console
- Create a new project or select an existing one
- Navigate to APIs & Services > Credentials
- Click Create Credentials > OAuth 2.0 Client ID
- Select Web application as the application type
- Add authorized redirect URIs (e.g.,
http://localhost:54321/api/auth/callback/google) - Copy the Client ID and Client Secret
(Prevent Google OAuth error on Android Emulator) Android Emulator runs in an isolated network. While
10.0.2.2maps to your host's localhost, Google OAuth callbacks need a publicly accessible URL. VS Code's built-in port forwarding creates a secure tunnel to your local server.How to Set Up VS Code Port Forwarding:
-
Start your backend server locally:
cd server pnpm dev -
In VS Code, open the Ports panel (View > Terminal, then click the "Ports" tab next to Terminal)
-
Click Forward a Port and enter
54321(your backend server port) -
VS Code will create a tunnel URL like
https://w5w3c6hf-54321.usw3.devtunnels.ms -
Right-click the forwarded port and set Port Visibility to Public (required for OAuth callbacks)
-
Copy the tunnel URL for the next steps
Configure Google Cloud Console:
- In Google Cloud Console, edit your Web OAuth Client
- Add to Authorized JavaScript origins:
https://w5w3c6hf-54321.usw3.devtunnels.ms - Add to Authorized redirect URIs:
https://w5w3c6hf-54321.usw3.devtunnels.ms/api/auth/callback/google
Update Environment Files:
.env(Mobile App)EXPO_PUBLIC_API_URL=https://w5w3c6hf-54321.usw3.devtunnels.ms
server/.env(Backend)BETTER_AUTH_URL=https://w5w3c6hf-54321.usw3.devtunnels.ms
Note: The tunnel URL changes sometimes, so if it changes, you'll need to update Google Cloud Console and your env files.
Run on iOS:
pnpm iosRun on Android:
pnpm androidStart local development server:
cd server
pnpm devGenerate database migrations (from updated server/src/db/schema.ts):
cd server
pnpm genApply database migrations:
cd server
pnpm migrateRegenerate types:
cd server
pnpm typesSeed the database with test profiles, avoidance_areas, and POIs:
cd server
pnpm seedLint code:
pnpm lintFormat code:
pnpm formatPrebuild native projects:
pnpm prebuildThis generates native iOS and Android projects from your Expo configuration.
.
βββ app/ # Expo Router pages
β βββ (tabs)/ # Tab navigation screens
β βββ _layout.tsx # Root layout
β βββ +not-found.tsx # 404 page
βββ components/ # Reusable React components
βββ assets/ # Images, fonts, and other static assets
βββ types/ # TypeScript type definitions
βββ utils/ # Utility functions and custom hooks
βββ server/ # Cloudflare Workers backend
β βββ src/ # Server source code
β βββ migrations/ # Database migrations
β βββ test/ # Server tests
βββ android/ # Native Android project
βββ ios/ # Native iOS project
βββ package.json # Project dependencies
Build for iOS:
expo build:iosBuild for Android:
expo build:androidDeploy to Cloudflare:
cd server
pnpm deploy- App Configuration:
app.json - TypeScript:
tsconfig.json - Tailwind:
tailwind.config.js - ESLint:
eslint.config.js - Prettier:
prettier.config.js - Server:
server/wrangler.jsonc - Database:
server/drizzle.config.ts
- Framework: React Native with Expo SDK 54
- Navigation: Expo Router v6
- Styling: NativeWind (TailwindCSS for React Native)
- Maps: Expo Maps (Apple Maps for iOS, Google Maps for Android)
- State Management: TanStack Query (React Query)
- UI Components:
- React Native Gesture Handler
- React Native Reanimated
- Gorhom Bottom Sheet
- Phosphor React Native (Icons)
- Geospatial: Turf.js
- Forms: React Hook Form with Zod validation
- Runtime: Cloudflare Workers
- Framework: Hono
- Database: Cloudflare D1 (SQLite)
- ORM: Drizzle ORM
- Testing: Vitest with Cloudflare Workers pool
- Node.js (v18 or higher recommended)
- pnpm (package manager)
- Expo CLI
- iOS Simulator (for iOS development) or Android Studio (for Android development)
- Cloudflare account (for backend deployment)
- Create a feature branch i.e.
astrol99/feat-thing - Make your changes
- Run linting and formatting:
pnpm format - Submit a pull request
Longhorn Developers
Built with β€οΈ using Expo and Cloudflare Workers