Before you begin, ensure you have the following installed on your machine:
-
Install Frontend Dependencies: Open the project folder in your terminal and run the following command to install the necessary Node.js packages:
npm install
-
Start the Frontend Development Server: Once the dependencies are installed, start the development server by running:
npm run dev
-
Setup and Run the Backend Server: Navigate to the backend folder in your terminal:
cd backend
Run the backend server using Python:
pip install -r requirement.txt python app.py
-
Configure Twilio in Notification Server: Navigate to the
notification_server
folder, then go tocontrollers > publishHandler.js
and enter your Twilio SID and WhatsApp number in the required places in the code://Example entry (replace with your actual credentials) const client = require("twilio")( "Twilio SID 1","Twilio SID 2" ); const phoneNumbers = ["Phone number of station 1", "Phone number of station 2"];
-
Start the Notification Server: Open the
notificationServer
folder in your terminal:cd notification_server npm i
Run the server using Node.js:
node server.js
-
Connect WhatsApp to Twilio: To connect your WhatsApp number to Twilio, send a message from your WhatsApp to Twilio with the text "join locate-ordinary":
- Open WhatsApp
- Send a message to Twilio's provided number with the text:
join locate-ordinary
For quick reference, here is a summary of the commands you will need to run:
# In the project root folder
npm install
npm run dev
# In the backend folder
cd backend
pip install -r requirement.txt
python app.py
# In the notification server folder
cd ../notification_server
npm i
node server.js
By following these steps, you should have the project up and running with all servers operational. Ensure you have properly configured your Twilio credentials and connected your WhatsApp number for the notification functionality to work correctly.