AiroPath calculates multiple routes between two points and ranks them by real-time AQI (Air Quality Index) — so you can choose the cleanest path, not just the fastest one.
| Feature | Description |
|---|---|
| 🗺️ AQI-aware routing | Fetches live AQI data along each route and scores them by air quality |
| 🚴 Multi-mode | Supports cycling and walking travel modes via OpenRouteService |
| 📍 Location search | Nominatim (OpenStreetMap) autocomplete for start/end points with current location detection |
| 📊 Route cards | Side-by-side route comparison with distance, duration, and AQI score |
| 🔐 Auth | Email/password + Google OAuth via Supabase |
| 🌗 Dark / Light theme | Stark monochromatic theme that auto-follows system preference |
- Framework: Expo (React Native) with Expo Router (file-based routing)
- Styling: NativeWind (Tailwind CSS for React Native)
- Maps:
react-native-mapswith Google Maps provider - Routing: OpenRouteService API
- Air Quality: WAQI API
- Auth & DB: Supabase (email/password + Google OAuth)
- Language: TypeScript
airopath/
├── app/ # Expo Router routes (file-based navigation)
│ ├── (auth)/ # Unauthenticated stack
│ │ ├── _layout.tsx
│ │ ├── login.tsx
│ │ ├── register.tsx
│ │ └── onboarding.tsx # Shown once, right after first sign-in
│ ├── (tabs)/ # Authenticated stack
│ │ ├── _layout.tsx
│ │ └── index.tsx # Main map & route screen
│ ├── _layout.tsx # Root layout: providers + auth-gated redirects
│ └── profile.tsx # User profile / settings
│
├── components/ # Presentational, reusable UI (no routing/global state)
│ ├── common/ # Shared across screens
│ │ ├── EmptyState.tsx # Pre-analysis walkthrough steps
│ │ └── LoadingOverlay.tsx # Analysis loading indicator
│ └── map/ # Map-screen-specific pieces
│ ├── BottomSheet.tsx # Draggable bottom sheet
│ ├── LocationSearch.tsx # Nominatim-powered place search with GPS fallback
│ ├── PinBar.tsx # Start/end pin selection bar
│ └── RouteCard.tsx # Route summary card with AQI score
│
├── context/ # App-wide React context providers
│ ├── AuthContext.tsx # Session/profile state + Supabase auth (incl. Google OAuth)
│ └── ThemeContext.tsx # Light/dark theme, wired into NativeWind's color scheme
│
├── lib/ # Framework-agnostic logic (no React)
│ ├── routeService.ts # Route fetching + AQI scoring logic
│ └── supabase.ts # Supabase client + auto-refresh setup
│
├── constants/
│ ├── theme.ts # Design tokens, colors, map styles
│ └── env.ts # Typed accessors for env vars (via expo-constants)
│
├── supabase/
│ └── migrations/ # SQL migrations (run in Supabase SQL editor / CLI)
│
├── assets/ # Images, icons, splash screens
│
├── app.config.js # Expo config (reads from .env)
├── tailwind.config.js # NativeWind/Tailwind theme tokens (light/dark)
├── babel.config.js / metro.config.js # NativeWind build wiring
├── global.css # Tailwind directives, imported once in app/_layout.tsx
└── .env.example # Environment variable template
Where does X live?
- Adding a new screen/route →
app/ - Adding a reusable UI piece used by more than one screen →
components/common/ - Adding something specific to the map screen →
components/map/ - Adding global state (auth, theme, etc.) →
context/ - Adding an API call / business logic with no JSX →
lib/ - Adding a color, font size, or other design constant →
constants/
git clone https://github.com/S-Axhwin/Airopath.git
cd Airopathbun install
# or
npm installcp .env.example .envThen fill in your keys in .env:
GOOGLE_MAPS_API_KEY="" # Google Cloud Console → Maps SDK for Android/iOS
WAQI_TOKEN="" # https://aqicn.org/data-platform/token/
ORS_KEY="" # https://openrouteservice.org/dev/#/login
SUPABASE_URL="" # Supabase project → Settings → API
SUPABASE_ANON="" # Supabase project → Settings → API → anon key
API_URL="" # Your backend URL (e.g. http://localhost:3000)
GOOGLE_WEB_CLIENT_ID="" # Google Cloud Console → OAuth 2.0 Credentials
GOOGLE_ANDROID_CLIENT_ID="" # Google Cloud Console → OAuth 2.0 CredentialsNever commit
.env— it is gitignored. Use.env.exampleas a template.
# Start Expo dev server
npx expo start
# Run on Android
npx expo run:android
# Run on iOS
npx expo run:iosAll secrets are injected through app.config.js via process.env and accessed in the app via expo-constants. No secrets are hardcoded in source.
| Variable | Where to get it |
|---|---|
GOOGLE_MAPS_API_KEY |
Google Cloud Console → APIs & Services → Credentials |
WAQI_TOKEN |
aqicn.org/data-platform/token |
ORS_KEY |
openrouteservice.org |
SUPABASE_URL |
Supabase Dashboard → Project Settings → API |
SUPABASE_ANON |
Supabase Dashboard → Project Settings → API → anon key |
GOOGLE_WEB_CLIENT_ID |
Google Cloud Console → OAuth 2.0 Client IDs → Web |
GOOGLE_ANDROID_CLIENT_ID |
Google Cloud Console → OAuth 2.0 Client IDs → Android |
- Fetch routes — OpenRouteService returns up to 3 alternative routes for the selected travel mode.
- Sample AQI — WAQI API is queried every ~3 km along each route; results are cached to avoid redundant calls.
- Score — Routes are ranked by average AQI. Lower AQI = cleaner air = better score.
- Display — Each route card shows distance, estimated duration, and a color-coded AQI badge (Good / Moderate / Unhealthy).
- Fork the repo
- Create a feature branch:
git checkout -b feat/your-feature - Commit your changes:
git commit -m 'feat: add your feature' - Push and open a PR
MIT
