Skip to content

Repository files navigation

EV Charging App

A React Native mobile application for managing EV charging sessions, built with Node.js + Express backend and SQLite database.


Getting Started

Step 1 — Clone the Repository

git clone https://github.com/yjyun0531/wirelessAssignment.git
cd wirelessAssignment

Step 2 — Install Dependencies

npm install

Step 3 — Set Your IP Address

Open the file:

frontend/src/utils/api.js

Find the BASE_URL line and replace it with your PC's IPv4 address:

// Before
export const BASE_URL = 'http://10.74.91.100:3000';

// After (example — use YOUR actual IPv4)
export const BASE_URL = 'http://192.168.1.5:3000';

How to find your IPv4 address: Open Command Prompt and run ipconfig, then look for IPv4 Address under your active network adapter.


Step 4 — Start the Backend Server

Open a Command Prompt, navigate to the backend folder, and run the server:

cd backend
node server.js

You should see:

Server running on port 3000

Keep this terminal open while using the app.


Step 5 — Run the App on Android

Open a new Command Prompt, go back to the root project folder, and run:

cd ..
npx react-native run-android

Make sure your Android device is connected via USB with USB Debugging enabled, or an Android emulator is running.


Project Structure

wirelessAssignment/
├── backend/
│   ├── models/
│   │   └── database.js       # SQLite database setup
│   ├── routes/
│   │   ├── auth.js           # Register & login
│   │   ├── users.js          # User profile CRUD
│   │   └── sessions.js       # Charging session CRUD
│   └── server.js             # Express + Socket.IO server
└── frontend/
    └── src/
        ├── context/
        │   └── AuthContext.js
        ├── navigation/
        │   └── AppNavigator.js
        ├── screens/
        │   ├── HomeScreen.js
        │   ├── LoginScreen.js
        │   ├── RegisterScreen.js
        │   ├── SearchScreen.js
        │   ├── ChargingScreen.js
        │   ├── HistoryScreen.js
        │   ├── ProfileScreen.js
        │   └── SummaryScreen.js
        └── utils/
            └── api.js        # Base URL & API helpers

Tech Stack

Layer Technology
Mobile Frontend React Native
Backend Node.js + Express
Database SQLite
Real-time Socket.IO

Common Issues

App cannot connect to server

  • Make sure BASE_URL in api.js matches your PC's IPv4 address
  • Make sure the backend server is running (node server.js)
  • Make sure your phone and PC are on the same Wi-Fi network

npx react-native run-android fails

  • Make sure Android Studio and an emulator are installed, or a physical device is connected with USB Debugging on
  • Run adb devices to verify your device is detected

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages