Skip to content

rahulshendre/Mechanic-app

 
 

Repository files navigation


The mobile command center for MechTrix mechanics.
Bookings · Earnings · Navigation · Real-time updates — all in one wrench-tight package.


🔧 What Is This?

MechTrix Mechanic App is the React Native (Expo) mobile application powering the mechanic side of the MechTrix platform. It handles everything a mechanic needs on the go — from accepting bookings and navigating to job sites, to tracking earnings and managing their profile.


⚙️ Tech Stack

Layer Technology
Framework Expo SDK 54 + React Native 0.81
Navigation React Navigation
HTTP Client Axios
Real-time Socket.IO Client
Builds EAS Build

🛠️ Prerequisites

Before you start, make sure you have:

  • Node.js 18+Download
  • npm 9+
  • Android Studio — for emulator/device builds
  • Expo CLI — optional; npx expo works without a global install

🚀 Setup

1 · Navigate to the app directory

cd mechanic-app

2 · Install dependencies

npm install

3 · Create your local environment file

🪟 PowerShell (Windows)
Copy-Item .env.example .env
🍎 macOS / Linux
cp .env.example .env

4 · Fill in your .env values

EXPO_PUBLIC_API_URL=https://your-backend-domain/api
EXPO_PUBLIC_GOOGLE_MAPS_KEY=your_google_maps_key

⚠️ Important: EXPO_PUBLIC_API_URL is mandatory — the app will refuse to start without it.


▶️ Running the App

Command What it does
npm run start Start the Expo dev server
npm run android Launch on Android emulator/device
npm run ios Launch on iOS simulator (macOS only)
npm run web Launch web preview in browser

📦 Building with EAS

Make sure you're logged into your Expo account (npx eas login) and EAS CLI is installed (npm install -g eas-cli).

Preview APK — great for testing on real devices:

eas build --platform android --profile preview

Production AAB — ready for the Play Store:

eas build --platform android --profile production

🗂️ Project Structure

mechanic-app/
├── App.js               # App entry point, navigation composition
├── AuthContext.js        # Authentication state & context provider
├── ThemeContext.js       # Theme state & context provider
├── config/
│   └── api.js           # API base URL + Maps key wiring
├── screens/             # All mechanic-facing screens
│   ├── Dashboard
│   ├── Bookings
│   ├── Earnings
│   ├── Navigation
│   └── Profile
└── android/             # Native Android project files

🌍 Environment Variables

Variable Required Description
EXPO_PUBLIC_API_URL ✅ Yes Backend API base URL. App will not start without this.
EXPO_PUBLIC_GOOGLE_MAPS_KEY ⚠️ Recommended Powers all maps & navigation features.

🩺 Troubleshooting

Missing API URL error

If you see:

Missing EXPO_PUBLIC_API_URL environment variable

Fix: Make sure .env exists inside mechanic-app/ and contains EXPO_PUBLIC_API_URL.

Android build issues
  1. Verify Android SDK is installed and an emulator/device is connected.
  2. Try a clean reinstall:

PowerShell:

Remove-Item -Recurse -Force node_modules
Remove-Item -Force package-lock.json
npm install

macOS / Linux:

rm -rf node_modules package-lock.json
npm install

📜 Scripts Reference

Script Description
npm run start Start Expo development server
npm run android Run on Android
npm run ios Run on iOS (macOS only)
npm run web Run web preview

Built for the MechTrix platform · React Native + Expo

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 94.9%
  • Kotlin 5.1%