Skip to main content
The watt.ma application is built with Expo (React Native) on the mobile side and FastAPI + MongoDB on the server side. This page covers the full local installation and how Mock Mode lets you test the app without a backend.

Prerequisites

  • Node.js v20 or later
  • Python 3.10 or later
  • MongoDB locally or a cloud database URL

1. FastAPI Backend

1

Go to the backend folder

2

Create and activate a Python virtual environment

3

Install dependencies

4

Copy and configure the environment file

Set at least MONGO_URL in the .env file.
5

Start the FastAPI server

The interactive Swagger documentation is available at http://127.0.0.1:8000/docs. Developer documentation in production is hosted at docs.watt.ma.

2. Expo Frontend (React Native)

1

Go to the frontend folder

2

Install npm packages

3

Copy the environment configuration

4

Start Expo

Use the developer menu:
  • i to open the iOS simulator
  • a to open the Android emulator
  • Scan the terminal QR code with the Expo Go app on a physical device

Mock Mode vs Production

The application has a global Mock Mode toggle. When EXPO_PUBLIC_MOCK_MODE=true in the frontend config:
  • No backend server or MongoDB is required.
  • OTP codes are auto-validated (any 6 digits pass).
  • Wallet top-ups are credited instantly for test cards.
  • Charging session metrics (kWh delivered, elapsed time, cost) are incremented and updated locally every second.
Setting EXPO_PUBLIC_MOCK_MODE=false redirects all traffic to the FastAPI server configured in frontend/services/api.ts.

Configuration Matrix

For a quick first test, leave EXPO_PUBLIC_MOCK_MODE=true: you will immediately see the authentication screens, the station map, and a simulated session without installing MongoDB or configuring Stripe.