FALCON 🦅
Fall Alert Landslide Condition Observation Network
A full-stack application for rockfall prediction, risk analysis, and route optimization using drone imagery and machine learning. This was my Smart India Hackathon (SIH) project where I contributed in developing the backend infrastructure and the crack segmentation model using computer vision techniques.
⚡ Quick Start
# Install dependencies
npm run install:all
# Start development servers
npm run dev
# Access Points:
Frontend: http://localhost:5173
Backend: http://localhost:8000
API Docs: http://localhost:8000/docs
🏗️ Architecture
Project Structure
FALCON/
├── frontend/ # React + TypeScript Frontend
│ ├── src/
│ │ ├── components/
│ │ │ ├── PredictionWorkflow/
│ │ │ │ ├── DataInjection.tsx # File upload & data input
│ │ │ │ ├── ModelPredicting.tsx # ML model execution
│ │ │ │ └── RockfallForecast.tsx # Results visualization
│ │ │ ├── AuthModal.tsx # Authentication system
│ │ │ ├── Dashboard.tsx # Main control center
│ │ │ ├── InteractiveMapNew.tsx # Map visualization
│ │ │ ├── Navigation.tsx # Top navigation bar
│ │ │ ├── OptimizedRoute.tsx # Route planning
│ │ │ ├── RiskAnalysisPanel.tsx # Risk assessment display
│ │ │ ├── LeftSidebar.js # Dashboard sidebar
│ │ │ ├── RightSidebar.js # Dashboard controls
│ │ │ └── SimpleMap.tsx # Basic map component
│ │ ├── services/
│ │ │ └── api.ts # API service layer
│ │ ├── lib/
│ │ │ ├── completeAuth.ts # Authentication logic
│ │ │ └── firebaseConfig.ts # Firebase configuration
│ │ ├── App.tsx # Main application component
│ │ ├── main.tsx # Application entry point
│ │ └── index.css # Global styles
│ ├── public/
│ │ ├── falcon-logo.png # Application logo
│ │ └── index.html # HTML template
│ ├── vite.config.ts # Vite build configuration
│ ├── tailwind.config.js # Tailwind CSS configuration
│ ├── tsconfig.json # TypeScript configuration
│ └── package.json # Frontend dependencies
├── backend/ # FastAPI Python Backend
│ ├── main.py # FastAPI application & endpoints
│ ├── models/ # ML Model files
│ │ ├── weather_pipeline.pkl # Weather prediction model
│ │ ├── crack_segmentation.h5 # Crack detection model
│ │ └── DEM.pkl # Digital Elevation Model
│ ├── weather_processor.py # Weather analysis module
│ ├── crack_segmentation.py # Crack detection module
│ ├── dem_processor.py # DEM analysis module
│ ├── requirements.txt # Python dependencies
│ └── .env # Environment variables
├── package.json # Root development scripts
└── README.md # Project documentation
├── frontend/ # React + TypeScript Frontend
│ ├── src/
│ │ ├── components/
│ │ │ ├── PredictionWorkflow/
│ │ │ │ ├── DataInjection.tsx # File upload & data input
│ │ │ │ ├── ModelPredicting.tsx # ML model execution
│ │ │ │ └── RockfallForecast.tsx # Results visualization
│ │ │ ├── AuthModal.tsx # Authentication system
│ │ │ ├── Dashboard.tsx # Main control center
│ │ │ ├── InteractiveMapNew.tsx # Map visualization
│ │ │ ├── Navigation.tsx # Top navigation bar
│ │ │ ├── OptimizedRoute.tsx # Route planning
│ │ │ ├── RiskAnalysisPanel.tsx # Risk assessment display
│ │ │ ├── LeftSidebar.js # Dashboard sidebar
│ │ │ ├── RightSidebar.js # Dashboard controls
│ │ │ └── SimpleMap.tsx # Basic map component
│ │ ├── services/
│ │ │ └── api.ts # API service layer
│ │ ├── lib/
│ │ │ ├── completeAuth.ts # Authentication logic
│ │ │ └── firebaseConfig.ts # Firebase configuration
│ │ ├── App.tsx # Main application component
│ │ ├── main.tsx # Application entry point
│ │ └── index.css # Global styles
│ ├── public/
│ │ ├── falcon-logo.png # Application logo
│ │ └── index.html # HTML template
│ ├── vite.config.ts # Vite build configuration
│ ├── tailwind.config.js # Tailwind CSS configuration
│ ├── tsconfig.json # TypeScript configuration
│ └── package.json # Frontend dependencies
├── backend/ # FastAPI Python Backend
│ ├── main.py # FastAPI application & endpoints
│ ├── models/ # ML Model files
│ │ ├── weather_pipeline.pkl # Weather prediction model
│ │ ├── crack_segmentation.h5 # Crack detection model
│ │ └── DEM.pkl # Digital Elevation Model
│ ├── weather_processor.py # Weather analysis module
│ ├── crack_segmentation.py # Crack detection module
│ ├── dem_processor.py # DEM analysis module
│ ├── requirements.txt # Python dependencies
│ └── .env # Environment variables
├── package.json # Root development scripts
└── README.md # Project documentation
System Architecture
Frontend Layer (React + TypeScript)
- Component-Based Architecture: Modular React components with TypeScript
- State Management: React hooks and context for global state
- Styling: Tailwind CSS with glassmorphism design patterns
- Routing: Client-side routing for SPA experience
- API Integration: Axios-based service layer for backend communication
Backend Layer (FastAPI + Python)
- RESTful API: FastAPI framework with automatic OpenAPI documentation
- ML Pipeline: Multi-model prediction system with three specialized models
- Data Processing: File upload handling for drone images and elevation data
- Authentication: JWT-based user authentication system
- CORS Configuration: Cross-origin resource sharing for frontend integration
Machine Learning Pipeline
- Weather Model: Meteorological risk assessment
- Crack Segmentation: Computer vision for structural analysis
- DEM Analysis: Topographical and geological risk evaluation
Data Input → Preprocessing → Multi-Model Analysis → Risk Averaging → Results
🚀 Features
Frontend
- Interactive dashboard with real-time monitoring
- Risk analysis panel with severity mapping
- Route optimization with interactive maps
- Prediction workflow (Data Injection → Model Prediction → Results)
- Authentication system with glassmorphism design
Backend
- RESTful API with auto-documentation
- ML model integration (Weather, Crack Segmentation, DEM)
- Multi-model risk assessment with averaging
- File upload for drone images and DEM data
- Real-time data processing
🛠️ Tech Stack
React 18
TypeScript
Vite
Tailwind CSS
FastAPI
Python 3.8+
Machine Learning
Computer Vision
OpenCV
Firebase
🔧 Commands
npm run dev
Start both servers
npm run dev:frontend
Frontend only
npm run dev:backend
Backend only
npm run build
Build for production
npm run install:all
Install all dependencies
📚 Key API Endpoints
POST /api/comprehensive-analysis # Multi-model risk analysis
POST /api/auth/login # User authentication
GET /api/monitoring/live-data # Real-time monitoring
🚀 Deployment
Frontend:
cd frontend
npm run dev
Backend:
cd backend
pip install -r requirements.txt
uvicorn main:app --host 0.0.0.0 --port 8000 --reload
FALCON Command Center - Advanced geospatial analysis for safer navigation 🦅
Made with ❤️ by Lakshya Tripathi