This guide provides instructions to set up and run the frontend of the TacticWave project, which uses Vite and React JS. Additionally, this project requires Python with Flask for the backend.
Ensure you have the following tools installed on your machine:
- Node.js (version 14.18+ or 16+ is recommended): Download Node.js
- npm (comes with Node.js) or yarn (optional):
npm -v # Check npm version yarn -v # Check yarn version (if using yarn)
- Python (version 3.8+): Download Python
python --version # Check Python version pip --version # Check pip version
- Arduino IDE (for ESP32 setup): Download Arduino IDE
To get started, clone the repository to your local machine:
git clone https://github.com/Nguyenle23/TacticWave.gitNavigate to the project directory:
cd TacticWaveSince the project already has vite.config.js and package.json configured, you only need to install the dependencies:
npm installyarn installInstall the required Python packages:
pip install -r requirements.txtFor MacOS, install pyserial instead of serial.
Copy Hardware > [NEW] VIBRATION CONTROL.ino and paste to Arduino IDE
-
Install the Arduino IDE from Arduino Software.
-
Set up ESP32 in Arduino IDE:
- Open the Arduino IDE.
- Go to File > Preferences.
- In the "Additional Board Manager URLs" field, add the following URL:
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json - Click OK.
-
Install the ESP32 Board Package:
- Go to Tools > Board > Boards Manager.
- Search for
ESP32. - Click Install on the "ESP32 by Espressif Systems" package.
-
Select the ESP32 Board:
- Go to Tools > Board > ESP32 Arduino.
- Select your specific ESP32 board (e.g.,
ESP32 Dev Module).
-
Connect your ESP32 device to your computer using a USB cable.
-
Select the Port:
- Go to Tools > Port and select the port corresponding to your ESP32 device. If your PORT is not COM4, go to Server > controllers > RunExpController.py and edit the value of esp32_port to match your PORT.
- Choose Upload Speed: 115200
Start the development server to view the project locally:
npm run devyarn devAfter starting, you should see output similar to this:
VITE v<version> ready in <time>
🌐 Local: http://localhost:5173/
📡 Network: http://<your-ip>:5173/
Open your browser and navigate to http://localhost:5173/ to view the application.
Run the Flask server:
python app.pyThe backend should be running at http://localhost:5000 by default. Adjust the host or port in app.py if needed.
The project may require specific environment variables to run. If an .env file is included in the repository, ensure it is configured correctly.
If the .env file is missing, you may need to create one in the root directory based on the provided .env.example file:
cp .env.example .envEdit the .env file to match your environment setup.
To build the project for production, run:
npm run buildyarn buildThe production-ready files will be generated in the dist/ directory. You can deploy this folder to any static hosting service, such as Netlify, Vercel, or AWS S3.
- Missing dependencies: Ensure you have run
npm install,yarn install, orpip installas required. - Environment issues: Ensure all required environment variables are set in the
.envfile. - Port conflict: If ports
5173(frontend) or5000(backend) are already in use, update the respective configurations or use the following commands to specify a different port:- Frontend:
npm run dev -- --port=3000
- Backend (in
app.py):app.run(port=4000)
- Frontend:
Feel free to raise an issue in the GitHub repository or reach out to the project maintainers.
This project is licensed under the terms specified in the repository. Please check the LICENSE file for more information.