Interface : 2 App.js - 17chuchu/AutomaticBicycleInterface GitHub Wiki

This file is the centre of everything. I will highlight the important function here.

Table of Contents

Port And IP of the Django Server

Port and IP of the Django Server are located here.

myip = 'localhost'   // line 35
port = 7001

Set Bike Id

This function will save the id of the selected bike and it will be sent to the Django server to be checked for availability.

setBikeId = async (id) =>    // line 118
{
    this.setState({selectedbike : id})  // Save the id.
    SocketManager.selectedBike = id  // Save the id to SocketManager.
    SocketManager.checkbike(id)  // Send the id to the Django server.
}