SafeNav is an intelligent, ML-powered waterlogging precaution and monitoring system designed to help users navigate safely during monsoon seasons and flood-prone conditions. It provides real-time risk assessment, smart route planning, and live weather updates to ensure safe travel.
- 🗺️ Smart Route Planning: Find alternative routes that avoid flood-prone areas and waterlogged streets in real-time using advanced pathfinding algorithms.
- 📊 Area Risk Insights: Get detailed flood risk assessments for specific locations before you travel.
- 🌦️ Live Weather Integration: Real-time weather updates and monsoon safety warnings powered by OpenWeather API.
- 🤖 ML-Powered Risk Assessment: Utilizes machine learning models (Scikit-learn) to classify flood risk and predict severity based on environmental factors.
- 🧠 AI Assistant: Integrated Google Gemini AI for intelligent insights and assistance.
- 📢 Community Reporting: Report waterlogging issues to help the community stay safe.
- Framework: Next.js 13 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS, Shadcn/ui
- Maps: Leaflet / React-Leaflet
- State Management: React Hooks
- Auth: Supabase Auth / Clerk
- Framework: FastAPI (Python)
- Machine Learning: Scikit-learn (Joblib for model serialization)
- AI Integration: Google Gemini API
- Data Processing: Pandas, NumPy
- Database: Supabase
- Deployment: Netlify (Frontend)
- IDE: Kiro Specs and Vibe for Dijkstra's Algorithm
Before you begin, ensure you have the following installed:
- Node.js (v18 or higher)
- Python (v3.9 or higher)
- npm or yarn
git clone https://github.com/yourusername/SafeNav.git
cd SafeNavNavigate to the root directory to set up the Next.js frontend.
# Install dependencies
npm install
# Start the development server
npm run devThe frontend will be available at http://localhost:3000.
Navigate to the backend directory to set up the FastAPI server.
cd backend
# Create a virtual environment
python -m venv venv
# Activate the virtual environment
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate
# Install Python dependencies
pip install fastapi uvicorn joblib requests python-dotenv google-generativeai aiofiles
# Start the backend server
uvicorn main:app --reloadThe backend API will be available at http://localhost:8000.
Create a .env.local file in the root directory with the following variables:
# Backend
OPENWEATHER_API_KEY=your_openweather_api_key
GEMINI_API_KEY=your_gemini_api_key
# Frontend (Supabase/Clerk)
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
# Add other necessary keys based on your auth providerSafeNav/
├── app/ # Next.js App Router pages
│ ├── auth/ # Authentication pages
│ ├── home/ # Main dashboard
│ └── page.tsx # Landing page
├── backend/ # FastAPI Backend
│ ├── main.py # API Entry point
│ ├── models/ # ML Models (.pkl files)
│ └── uploads/ # User uploaded content
├── components/ # React Components
│ ├── ui/ # Shadcn UI components
│ ├── RiskMap.tsx # Map visualization
│ └── RouteMap.tsx # Navigation component
├── lib/ # Utility functions
├──public/ # Static assets
├── .kiro/ # Kiro AI assistant configurations
└── .bolt/ # Bolt.new configurations
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.