AI-Powered Marine Risk & Fisheries Intelligence System
Empowering fishermen and marine operators with real-time risk prediction, weather intelligence, and profit analytics.
OceanGuard is a full-stack SaaS platform that leverages machine learning and real-time weather data to help fishermen and marine operators make safer, smarter decisions at sea.
By combining a Random Forest ML model, live OpenWeather API data, and a rule-based hybrid system, OceanGuard delivers accurate marine risk predictions, profit estimations, and actionable analytics — all through a clean, responsive dark-mode interface.
Built for fisheries communities to reduce risk, maximize profit, and navigate with confidence. 🐟⚓
| Feature | Description |
|---|---|
| 🤖 ML Risk Prediction | Random Forest model predicts marine risk levels based on real-time conditions |
| 🌦️ Weather Integration | Live wind speed, wave height, and conditions via OpenWeather API |
| 🔀 Hybrid Prediction | Rule-based fallback system combined with ML for higher accuracy |
| 💰 Profit Calculator | Deterministic profit calculation module for fisheries planning |
| 📊 Analytics Dashboard | Risk trends, historical insights, and decision support |
| 🔐 Secure Auth | JWT-based authentication with OTP email verification |
| 💳 Subscription Access | Free, Pro, and Enterprise tier access control |
| 🌙 Dark Mode UI | Fully responsive interface with dark mode support |
- ⚛️ React — Component-based UI
- 🎨 Tailwind CSS — Utility-first styling
- 🔷 TypeScript — Type-safe development
- 🟢 Node.js — Runtime environment
- 🚂 Express.js — REST API framework
- 🔑 JWT + OTP — Authentication & verification
- 📧 Gmail OAuth2 — Email service
- 🐍 Python — ML development
- ⚡ FastAPI — High-performance ML API
- 🌲 scikit-learn — Random Forest model
- 🍃 MongoDB Atlas — Cloud database
- 🌤️ OpenWeather API — Real-time weather data
- 🔺 Vercel — Frontend hosting
- 🎯 Render — Backend & ML hosting
User Request
│
▼
┌─────────────┐
│ Frontend │ React + Tailwind (Vercel)
│ (React) │
└──────┬──────┘
│ HTTP/REST
▼
┌─────────────┐
│ Backend │ Node.js + Express (Render)
│ (Node.js) │──────────────────────────────┐
└──────┬──────┘ │
│ ▼
│ ┌──────────────────┐
├──► OpenWeather API │ MongoDB Atlas │
│ (Weather Data) │ (Users, OTPs, │
│ │ Risk Logs) │
▼ └──────────────────┘
┌─────────────┐
│ ML Service │ Python + FastAPI (Render)
│ (FastAPI) │ Random Forest Model
└─────────────┘
│
▼
Risk Prediction
(safe / moderate / dangerous)
oceanguard
├── backend
│ ├── src
│ │ ├── config
│ │ │ └── db.js
│ │ ├── controllers
│ │ │ ├── authController.js
│ │ │ ├── contactController.js
│ │ │ ├── dashboardController.js
│ │ │ ├── profitController.js
│ │ │ ├── riskController.js
│ │ │ └── subscriptionController.js
│ │ ├── middleware
│ │ │ ├── auth.js
│ │ │ └── subscription.js
│ │ ├── models
│ │ │ ├── Contact.js
│ │ │ ├── OTP.js
│ │ │ ├── Profit.js
│ │ │ ├── Risk.js
│ │ │ └── User.js
│ │ ├── routes
│ │ │ ├── authRoutes.js
│ │ │ ├── contactRoutes.js
│ │ │ ├── dashboardRoutes.js
│ │ │ ├── profitRoutes.js
│ │ │ ├── riskRoutes.js
│ │ │ └── subscriptionRoutes.js
│ │ ├── services
│ │ │ ├── mlService.js
│ │ │ └── weatherService.js
│ │ ├── utils
│ │ │ ├── apiResponse.js
│ │ │ ├── generateOTP.js
│ │ │ └── sendEmail.js
│ │ └── app.js
│ ├── .gitignore
│ ├── package-lock.json
│ ├── package.json
│ └── server.js
├── frontend
│ ├── public
│ │ ├── favicon.png
│ │ └── favicon.svg
│ ├── src
│ │ ├── assets
│ │ │ └── hero-bg.jpg
│ │ ├── components
│ │ │ ├── dashboard
│ │ │ │ └── DashboardLayout.tsx
│ │ │ ├── landing
│ │ │ │ ├── Footer.tsx
│ │ │ │ └── LandingNavbar.tsx
│ │ │ ├── ui
│ │ │ │ ├── sonner.tsx
│ │ │ │ ├── toast.tsx
│ │ │ │ ├── toaster.tsx
│ │ │ │ └── tooltip.tsx
│ │ │ ├── NavLink.tsx
│ │ │ └── OceanGuardLogo.tsx
│ │ ├── hooks
│ │ │ ├── use-mobile.tsx
│ │ │ ├── use-toast.ts
│ │ │ └── useTheme.tsx
│ │ ├── lib
│ │ │ ├── api.ts
│ │ │ └── utils.ts
│ │ ├── pages
│ │ │ ├── dashboard
│ │ │ │ ├── AnalyticsPage.tsx
│ │ │ │ ├── OverviewPage.tsx
│ │ │ │ ├── ProfitCalculatorPage.tsx
│ │ │ │ ├── RiskHistoryPage.tsx
│ │ │ │ ├── RiskPredictionPage.tsx
│ │ │ │ ├── SettingsPage.tsx
│ │ │ │ └── SubscriptionPage.tsx
│ │ │ ├── AboutPage.tsx
│ │ │ ├── ContactPage.tsx
│ │ │ ├── ForgotPasswordPage.tsx
│ │ │ ├── HomePage.tsx
│ │ │ ├── LoginPage.tsx
│ │ │ ├── NotFound.tsx
│ │ │ ├── ResetPasswordPage.tsx
│ │ │ ├── ServicesPage.tsx
│ │ │ └── SignupPage.tsx
│ │ ├── App.tsx
│ │ ├── index.css
│ │ ├── main.tsx
│ │ └── vite-env.d.ts
│ ├── .gitignore
│ ├── index.html
│ ├── package-lock.json
│ ├── package.json
│ ├── postcss.config.js
│ ├── tailwind.config.ts
│ ├── tsconfig.app.json
│ ├── tsconfig.app.tsbuildinfo
│ ├── tsconfig.json
│ ├── tsconfig.node.json
│ ├── tsconfig.node.tsbuildinfo
│ ├── vercel.json
│ └── vite.config.ts
└── ml_service
├── Procfile
├── main.py
├── model.pkl
├── model.py
├── requirements.txt
└── scaler.pkl
- Node.js v18+
- Python 3.9+
- MongoDB Atlas account
- OpenWeather API key
git clone https://github.com/Mokshith08/OceanGuard.git
cd OceanGuardcd backend
npm install
cp .env.example .env # Fill in your environment variables
node server.jscd ml_service
pip install -r requirements.txt
uvicorn main:app --host 0.0.0.0 --port 8001 --reloadcd frontend
npm install
cp .env.example .env # Fill in your environment variables
npm run devFrontend runs at
http://localhost:5173Backend runs athttp://localhost:5000ML Service runs athttp://localhost:8001
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/signup |
Register new user |
| POST | /api/auth/login |
Login & send OTP |
| POST | /api/auth/verify-otp |
Verify OTP & get JWT |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/risk/predict/:city |
Get marine risk for a city |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/profit/calculate |
Calculate fishing profit |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/contact |
Submit contact form |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/dashboard |
Get analytics & risk trends |
| Property | Details |
|---|---|
| Algorithm | Random Forest |
| Framework | scikit-learn |
| API | FastAPI (Python) |
| Output | safe / moderate / dangerous |
features = [
"wind_speed", # Wind speed in m/s
"wave_height", # Estimated wave height
"weather_code", # OpenWeather condition code
"day_of_week", # 0 = Monday, 6 = Sunday
"is_daytime", # 1 = day, 0 = night
]If ML confidence > threshold:
Use ML prediction
Else:
Fallback to rule-based system
wind_speed > 10 → dangerous
wind_speed > 6 → moderate
else → safe
- ⚖️ Class balancing applied during training to handle imbalanced risk data
- 📏 StandardScaler used for feature normalization
- 🔄 Model persistence via joblib for fast inference
- 🧠 Advanced ML Models — XGBoost, LSTM for time-series risk forecasting.
- 📡 Real-time IoT Integration — Live sensor data from marine buoys.
- 📱 Mobile App — React Native app for fishermen on the go.
- 🗺️ Geo-mapping — Interactive risk heatmaps using Mapbox/Leaflet.
- 🌐 Multi-language Support — Regional language support for fishermen.
- 📶 Offline Mode — PWA support for low-connectivity areas.
- 💳 Payment Integration — Payment integration for subscription.
- 🔔 Alert and notification system — Fisherman gets alert before going to sea.
- 🤖 AI chatbot - AI chatbot for OceanGuard.
|
Mokshith GitHub |
This project is licensed under the MIT License — see the LICENSE file for details.
Made with ❤️ and ☕ for the fishing communities of India 🇮🇳
OceanGuard — Navigate Smarter. Fish Safer. 🌊