Skip to content

da-b0ss/Gridpath

Repository files navigation

NextEra Energy Drone Optimization Challenge

Project Setup

This project consists of a Python backend API and a React frontend. Follow the steps below to set up and run both.

Prerequisites

  • Python 3.8+
  • Node.js 16+ and npm
  • Git

Backend Setup

1. Navigate to the Backend Directory

cd backend

2. Set Up the Virtual Environment

python3 -m venv venv
source venv/bin/activate

3. Install Backend Dependencies

pip install -r requirements.txt

4. Run the Backend Server

python main.py

The backend API will start running and serve requests from the frontend.


Frontend Setup

1. Navigate to the Frontend Directory

cd frontend

2. Install Frontend Dependencies

npm install

3. Run the Frontend Development Server

npm start

or

npm run dev

The frontend will open in your browser, typically at http://localhost:5173 (Vite default).


Complete Setup (From Project Root)

If you want to set up both backend and frontend from the root directory:

# Backend setup
cd backend
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

# In one terminal, run the backend
python main.py

# In another terminal, set up and run the frontend
cd ../frontend
npm install
npm start

Running the Pipeline

To run the complete pipeline (data loading, routing, and visualization):

cd backend
source venv/bin/activate
python main.py

This will:

  • Load the data.
  • Solve the routing problem.
  • Generate the drone_missions_map.html file in the project root.

You can then open drone_missions_map.html in your browser to view the interactive map of drone missions.


Project Structure

.
├── data/
│   ├── asset_indexes.npy
│   ├── distance_matrix.npy
│   ├── photo_indexes.npy
│   ├── points_lat_long.npy
│   ├── polygon_lon_lat.wkt
│   ├── predecessors.npy
│   ├── waypoint_indexes.npy
├── src/
│   ├── __init__.py
│   ├── config.py
│   ├── data_loader.py
│   ├── routing.py
│   ├── path_decoder.py
│   ├── visualize.py
├── main.py
├── requirements.txt
├── .gitignore
├── venv/
└── drone_missions_map.html

Key Files

  • data/: Contains input data files.
  • src/: Contains modular Python scripts for the pipeline.
  • main.py: Entry point for the pipeline.
  • requirements.txt: Lists Python dependencies.
  • .gitignore: Specifies files to ignore in version control.
  • drone_missions_map.html: Output file with the interactive map.

Troubleshooting

Common Issues

  1. Virtual Environment Not Activated:

    • Ensure you see (venv) in your terminal prompt.
    • Run source venv/bin/activate to activate the virtual environment.
  2. Missing Dependencies:

    • Run pip install -r requirements.txt to install all required packages.
  3. Index Out of Bounds Errors:

    • Ensure all .npy and .wkt files are in the data/ directory.

Getting Help

Refer to the official documentation for tools used in this project:


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages