Skip to content

karthikeya-ms/tum-science-hack25

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TUM Science Hackathon 2025: Demining Dashboard

Overview

This repository contains two main parts:

  • Backend: A FastAPI service that generates a synthetic landmine‐risk map for Ukraine, partitions it among partners, and caches the result as a PNG.
  • Frontend: A React application (Vite + Tailwind via CDN) providing role‑based dashboards for:
    • Operator
    • Team Lead
    • NGO / Partner
    • Government / UN

Prerequisites

  • Node.js & npm (v16+)
  • Python 3.8+
  • pip (or conda / venv) for Python packages
  • Git for code branching

Project Structure

tum-science-hack25/        # Project root (Git repo)
├── backend/                # FastAPI + Python map generator
│   ├── ua.json             # Ukraine GeoJSON boundary
│   ├── map_generator.py    # Risk map logic
│   └── server.py           # FastAPI app (caches map PNG)
├── src/                    # React app
│   ├── pages/              # Role-based page components
│   │   ├── Login.jsx
│   │   ├── OperatorHome.jsx
│   │   ├── OperatorTasks.jsx
│   │   ├── OperatorIncidents.jsx
│   │   ├── TeamLeadHome.jsx
│   │   ├── TeamLeadAssignments.jsx
│   │   ├── TeamLeadIncidents.jsx
│   │   ├── NgoHome.jsx
│   │   ├── NgoOperations.jsx
│   │   ├── NgoReports.jsx
│   │   ├── GovOverview.jsx
│   │   ├── GovRegional.jsx
│   │   └── GovDownload.jsx
│   ├── App.jsx             # Main app with login & tabs
│   ├── main.jsx            # React entry point
│   └── index.html          # HTML template (includes Tailwind CDN)
├── package.json            # Frontend dependencies & scripts
├── vite.config.js          # Vite config (optional)
└── README.md               # This file

Git Branching

Work on a separate branch for the React frontend and avoid disturbing main:

git checkout -b react-frontend
# make your changes, then:
git add .
git commit -m "Initial React frontend MVP"
git pull --rebase origin react-frontend
# resolve any conflicts, then:
git push -u origin react-frontend

If the remote already has commits, git pull --rebase origin react-frontend brings them in before pushing.

Getting Started

1. Run the Backend

  1. Open a new terminal and navigate to the backend directory:
    cd tum-science-hack25/backend
  2. (Recommended) Create & activate a Python virtual environment:
    python -m venv .venv
    source .venv/bin/activate    # Linux/macOS
    .\.venv\\Scripts\\activate  # Windows
  3. Install dependencies:
    pip install fastapi uvicorn geopandas shapely rtree matplotlib openpyxl fpdf
  4. Start the FastAPI server (map is generated & cached at startup):
    uvicorn server:app --reload --port 8000
    You should see a message with the PNG endpoint:
    🗺️  Risk map ready at -> http://localhost:8000/risk-map/png
    

2. Run the Frontend

  1. Open another terminal at the project root:
    cd tum-science-hack25
  2. Install npm dependencies:
    npm install react-chartjs-2 chart.js jspdf leaflet 
  3. Start the development server:
    npm run dev
  4. Open your browser to:
    http://localhost:5173
    

Usage

  1. Login: On the React app, select your role, enter any non-empty username/password, and click Sign In.
  2. Navigate: Use the tabs to switch between pages for your role.
  3. Generate Risk Map: In Government / UN → Overview, click Generate Risk Map to fetch the cached PNG instantly.

API Endpoints

  • Map PNG: http://localhost:8000/risk-map/png
    Fetches the precomputed risk map as a PNG image.

Notes

  • The map generation runs only once at backend startup for speed (cached).
  • Tailwind CSS is loaded via CDN in index.html, so no extra build step for CSS.
  • To adjust resolution or partner shares, modify map_generator.py in the backend.

Happy hacking and good luck at the TUM Science Hackathon! 🚀

About

TUM Science Hackathon 2025 - The Red Embedding

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •