Skip to content

Repository files navigation

OceanOS

OceanOS

A full-stack, real-time ocean health monitoring and conservation management system powered by AI.

License: MITNode.jsJavaScriptGemini AIThree.js


🌐 View the Detailed Platform Website

Overview

OceanOS is an integrated marine conservation platform that simulates, monitors, and manages ocean cleanup operations in real time. It combines a Node.js backend, an interactive admin dashboard, a fisherman incentive app, and multiple standalone 3D simulations — all communicating via WebSockets and a REST API.

Built with a local-first approach using sql.js for zero-dependency database storage, OceanOS is designed to run entirely on your machine with no cloud infrastructure required (except for the Gemini AI feature).


Project Structure

OceanOS/
│
├── backend/ # Express.js REST API + WebSocket server
│ ├── server.js # Main server (API routes, DB, WebSocket, Gemini)
│ ├── package.json
│ ├── .env # Your API key goes here (not committed)
│ └── .env.example # Template for .env
│
├── dashboard/ # Admin monitoring dashboard (HTML/CSS/JS)
│ ├── index.html
│ ├── app.js # Dashboard logic, charts, WebSocket client
│ └── style.css
│
├── fisherman-app/ # Fisherman incentive & reporting app (HTML/CSS/JS)
│ ├── index.html
│ ├── app.js
│ └── style.css
│
├── simulation/ # MAIN Unified 3D world simulation (Three.js)
│ ├── index.html # Connected to backend, dashboard & fisherman app
│ └── world.js # Full world engine
│
├── ocean-drone-sim/ # Standalone: Drone patrol simulation
│ ├── index.html
│ ├── main.js
│ └── style.css
│
├── ocean-pollution-sim/ # Standalone: Ocean pollution simulation
│ ├── index.html
│ ├── main.js
│ └── style.css
│
├── river simulator/ # Standalone: River plastic collection sim (Vite/TS)
│ ├── index.html
│ ├── main.js
│ ├── src/
│ └── package.json
│
├── ocean clean/ # Standalone: Ocean boom cleanup sim (Vite/TS)
│ ├── index.html
│ ├── main.js
│ ├── src/
│ └── package.json
│
├── flowchart.html # Interactive system architecture flowchart
├── start-all.ps1 # One-click startup script (Windows PowerShell)
├── LICENSE
├── CONTRIBUTING.md
└── README.md

Features

FeatureDescription
Unified 3D SimulationThree.js world with ocean cleanup boom, drone patrols, river nets & oil spills
Admin DashboardReal-time charts (Chart.js), stat cards, live WebSocket feed
Fisherman AppCredit system for fishermen who return nets & report debris
Gemini AIImage-based marine debris detection + conversational AI assistant
Illegal Fishing TrackerReal-time vessel monitoring with MPA zone violation detection
Pollution MonitorOil spill detection, chemical composition analysis, buoy alerts
Live NotificationsWebSocket-driven alerts across all connected clients
Local Databasesql.js SQLite — no external DB required
WebSocket FeedLive data broadcast every 5 seconds across all modules

Getting Started

Prerequisites


1. Clone the Repository

git clone (https://github.com/ishaaqdev/OceanOS.git)
cd

2. Set Up the Backend

cd backend
npm install

Copy the environment template and add your Gemini API key:

# Windows
copy .env.example .env
# macOS / Linux
cp .env.example .env

Open .env and replace the placeholder:

GEMINI_API_KEY=your_gemini_api_key_here

3. Start the Full Platform (Windows)

From the project root, run the PowerShell startup script:

.\start-all.ps1

This will launch 4 services simultaneously:

ServiceURLPort
Backend APIhttp://localhost:30013001
Dashboardhttp://localhost:30023002
Fisherman Apphttp://localhost:30033003
3D Simulationhttp://localhost:30043004

The script will automatically open the dashboard in your browser.


4. Manual Start (macOS / Linux / Alternative)

Open 4 separate terminal windows and run each of the following:

Terminal 1 — Backend:

cd backend
node server.js

Terminal 2 — Dashboard:

cd dashboard
npx serve -l 3002

Terminal 3 — Fisherman App:

cd fisherman-app
npx serve -l 3003

Terminal 4 — Main Simulation:

cd simulation
npx serve -l 3004

Running Standalone Simulations

The standalone simulations are independent — they do not require the backend or other services to run. Open them directly in your browser or use a simple file server.

Option A: Open Directly in Browser

Just double-click the index.html file inside each folder.

Option B: Use a Local Server (recommended)

# Drone Patrol Simulationcd ocean-drone-sim
npx serve .# Ocean Pollution Simulationcd ocean-pollution-sim
npx serve .# River Collector Simulation (Node.js required)cd"river simulator"
npm install
npm run dev
# Ocean Cleanup Boom Simulation (Node.js required)cd"ocean clean"
npm install
npm run dev
SimulationBackend RequiredDescription
ocean-drone-simNoStandalone drone patrol over ocean with detection events
ocean-pollution-simNoStandalone oil spill & chemical pollution visualizer
river simulatorNoStandalone river plastic collection net simulator
ocean cleanNoStandalone ocean boom cleanup system
simulationYesFull unified world — posts data to backend, links to dashboard & fisherman app

API Reference

The backend exposes a REST API at http://localhost:3001.

MethodEndpointDescription
GET/api/stats/overviewPlatform-wide stats summary
GET/POST/api/plasticPlastic collection records
GET/POST/api/detectionsDrone detection events
GET/POST/api/pollutionPollution events
GET/POST/api/riverRiver net collection data
GET/api/fishing-zonesFishing zone map data
GET/api/fisherman/creditsFisherman credit leaderboard
POST/api/fisherman/return-netLog a net return & award credits
GET/POST/api/illegal-boatsIllegal vessel records
GET/api/notificationsNotification feed
PUT/api/notifications/:id/readMark notification as read
POST/api/gemini/analyzeAI debris image analysis
POST/api/gemini/chatAI chat assistant

WebSocket: Connect to ws://localhost:3001 for live event streaming.


Tech Stack

Technology Layers

LayerTechnology
BackendNode.js, Express.js, WebSocket (ws)
Databasesql.js (SQLite in-memory, file-persisted)
AIGoogle Gemini 2.5 Flash
3D GraphicsThree.js (WebGL)
ChartsChart.js
SimulationsVanilla Canvas 2D + Three.js
Standalone SimsVite + TypeScript
FrontendVanilla HTML / CSS / JavaScript
File UploadsMulter

Module and Application Breakdown

Module / ApplicationPrimary TechnologiesDescription
Backend APINode.js, Express, sql.js (WebAssembly SQLite), ws (WebSockets)Core REST and WS feed serving database changes.
Landing PageHTML5, CSS3, Vanilla ES6 JS, Canvas 2DEntry point with wave particles and app launcher.
Command Center DashboardHTML5, Vanilla ES6 JS, CSS3, Chart.jsAdmin dashboard with charts and live alerts.
FisherGuard CompanionHTML5, Vanilla ES6 JS, CSS3, Canvas 2DFisherman credit tracking, map, and Gemini chat.
Unified 3D SimulationThree.js (WebGL), HTML5Full 3D environment showing all operational zones.
Autonomous Drone PatrolThree.js (WebGL), Canvas 2D (minimap)Standalone UAV flight simulation with AI bounding box tracking.
Factory Chemical SpillThree.js (WebGL), Canvas 2D (smoke/oil particles)Plume dispersion simulator and buoy warnings.
River Plastic InterceptorVite, TypeScript, Three.js, Chart.js3D physics interceptor net with rate analytics.
Ocean Boom CleanupVite, TypeScript, Three.js, Canvas 2D3D U-boom current collection simulator.

Architecture Flowchart

Open flowchart.html in your browser to see an interactive visual diagram of the full system architecture — data flows, API connections, WebSocket events, and module relationships.


Security

  • API keys are stored in backend/.env and are never committed to the repository.
  • .env.example is provided as a safe template.
  • The database file (oceanos.db) is also excluded from version control.

Contributing

Contributions are welcome! Please read CONTRIBUTING.md before submitting a pull request.


License

This project is licensed under the MIT License — see the LICENSE file for details.


Made by Team Numero Uno

Building technology for a cleaner ocean.

About

OceanOS is an integrated system for marine waste management, featuring a Three.js simulation, admin dashboard, and IoT mobile app. Built with Node.js and WebSocket for real-time data, it uses an in-memory SQL database and Gemini AI for intelligent monitoring and pollution event handling.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages