A professional, multilingual platform for crowdsourced ocean hazard reporting with real-time mapping, AI analysis, and offline capabilities. Built for coastal communities to report and track ocean hazards like tsunamis, flooding, and coastal erosion.
- ๐ User Authentication - Secure registration and login
- ๐ฑ Media Upload - Upload photos and videos of hazards
- ๐บ๏ธ Real-time Map - Interactive dashboard with live hazard reports
- ๐ฅ Dynamic Hotspots - AI-powered threat detection and clustering
- ๐ Multilingual Support - 5 regional languages (English, Hindi, Tamil, Telugu, Bengali)
- ๐ก Offline Mode - Works in remote coastal areas, syncs when connected
- ๐ค AI Analysis - Advanced NLP for hazard detection and severity assessment
- ๐ Social Media Integration - Real-time social media monitoring
- ๐จ Professional UI - Modern, responsive design
Before you begin, make sure you have:
- Node.js (version 18 or higher) - Download here
- Git - Download here
- A Supabase account - Sign up here (free)
- An OpenRouter account (optional, for AI features) - Sign up here
# Clone the project
git clone https://github.com/your-username/incois-hazard-platform.git
# Navigate to the project directory
cd incois-hazard-platform# Install all required packages
npm install-
Create a new Supabase project:
- Go to supabase.com
- Click "New Project"
- Choose your organization
- Enter project name: "incois-hazard-platform"
- Set a database password (save this!)
- Choose a region close to you
- Click "Create new project"
-
Wait for the project to be ready (2-3 minutes)
-
Get your project credentials:
- Go to Settings โ API
- Copy the "Project URL" and "anon public" key
-
Set up the database tables:
- Go to the SQL Editor in your Supabase dashboard
- Click "New Query"
- Copy and paste the following SQL code:
-- Create reports table
CREATE TABLE reports (
id UUID DEFAULT gen_random_uuid() PRIMARY KEY,
latitude DECIMAL(10, 8) NOT NULL,
longitude DECIMAL(11, 8) NOT NULL,
hazard_type VARCHAR(50) NOT NULL,
description TEXT,
image_url TEXT,
video_url TEXT,
severity_score INTEGER CHECK (severity_score >= 1 AND severity_score <= 10),
language VARCHAR(10) DEFAULT 'en',
user_id UUID REFERENCES auth.users(id),
status VARCHAR(20) DEFAULT 'pending',
ai_reasoning TEXT,
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);
-- Create social_posts table
CREATE TABLE social_posts (
id UUID DEFAULT gen_random_uuid() PRIMARY KEY,
username VARCHAR(100) NOT NULL,
post_content TEXT NOT NULL,
location_tag VARCHAR(100),
sentiment VARCHAR(20),
post_timestamp TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
ai_analysis_complete BOOLEAN DEFAULT FALSE,
is_relevant BOOLEAN DEFAULT FALSE
);
-- Create storage bucket for media files
INSERT INTO storage.buckets (id, name, public) VALUES ('hazard-media', 'hazard-media', true);
-- Set up security policies
ALTER TABLE reports ENABLE ROW LEVEL SECURITY;
ALTER TABLE social_posts ENABLE ROW LEVEL SECURITY;
-- Allow users to insert their own reports
CREATE POLICY "Users can insert their own reports" ON reports
FOR INSERT WITH CHECK (auth.uid() = user_id);
-- Allow public read access to reports
CREATE POLICY "Anyone can read reports" ON reports
FOR SELECT USING (true);
-- Allow public read access to social posts
CREATE POLICY "Anyone can read social posts" ON social_posts
FOR SELECT USING (true);- Click "Run" to execute the SQL
- Create a
.env.localfile in your project root:
# Create the file
touch .env.local- Add your Supabase credentials to
.env.local:
# Supabase Configuration
NEXT_PUBLIC_SUPABASE_URL=https://your-project-id.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key-here
# AI Analysis (Optional - for advanced features)
OPENROUTER_API_KEY=your-openrouter-api-key-hereHow to get these values:
NEXT_PUBLIC_SUPABASE_URL: From your Supabase project settings โ API โ Project URLNEXT_PUBLIC_SUPABASE_ANON_KEY: From your Supabase project settings โ API โ anon public keyOPENROUTER_API_KEY: (Optional) Get from OpenRouter for AI features
# Start the development server
npm run devThe application will start at http://localhost:3000
- Open your browser and go to
http://localhost:3000 - Register a new account using the sign-up form
- Test the report form by:
- Capturing your location
- Selecting a hazard type
- Adding a description
- Uploading a photo (optional)
- View the dashboard at
http://localhost:3000/dashboard - Test offline mode by disconnecting your internet and submitting a report
-
Register an Account
- Click "Sign Up" on the homepage
- Enter your details and verify your email
-
Report a Hazard
- Click "Report Ocean Hazard"
- Allow location access when prompted
- Select the type of hazard
- Add a description in your preferred language
- Upload photos/videos if available
- Submit the report
-
View Live Dashboard
- Go to the Dashboard to see all reports on the map
- Use filters to view specific hazard types
- Toggle between map view and heatmap view
-
Monitor Reports
- View the real-time dashboard
- Check hotspot areas with high report density
- Review AI-analyzed severity scores
-
Manage Data
- Access the Supabase dashboard for detailed data
- Export reports for analysis
- Monitor social media integration
The platform supports 5 languages:
- English (en)
- Hindi (hi) - เคนเคฟเคจเฅเคฆเฅ
- Tamil (ta) - เฎคเฎฎเฎฟเฎดเฏ
- Telugu (te) - เฐคเฑเฐฒเฑเฐเฑ
- Bengali (bn) - เฆฌเฆพเฆเฆฒเฆพ
Users can select their preferred language when submitting reports.
The platform works offline in remote coastal areas:
- Reports are saved locally when offline
- Data automatically syncs when connection is restored
- No data loss during network interruptions
- Perfect for remote fishing communities
1. "Cannot find module" errors
# Delete node_modules and reinstall
rm -rf node_modules package-lock.json
npm install2. Supabase connection errors
- Check your
.env.localfile has correct credentials - Verify your Supabase project is active
- Ensure the database tables were created successfully
3. Media upload not working
- Check if the
hazard-mediabucket exists in Supabase Storage - Verify storage policies are set correctly
4. AI features not working
- Make sure you have a valid OpenRouter API key
- Check if you have credits in your OpenRouter account
5. Location not capturing
- Ensure you're using HTTPS (required for geolocation)
- Check browser permissions for location access
If you encounter issues:
- Check the browser console for error messages
- Verify all environment variables are set correctly
- Check the Supabase logs in your project dashboard
- Ensure all dependencies are installed with
npm install
- Push your code to GitHub
- Connect to Vercel:
- Go to vercel.com
- Import your GitHub repository
- Add your environment variables
- Deploy!
The platform can be deployed to:
- Netlify
- Railway
- DigitalOcean App Platform
- AWS Amplify
id- Unique identifierlatitude/longitude- GPS coordinateshazard_type- Type of hazard reporteddescription- User descriptionimage_url/video_url- Media attachmentsseverity_score- AI-calculated severity (1-10)language- Report languageuser_id- Reporter's user IDstatus- Report status (pending/verified/rejected)
id- Unique identifierusername- Social media usernamepost_content- Post text contentlocation_tag- Geographic locationsentiment- AI-analyzed sentimentis_relevant- Whether post is hazard-relevant
We welcome contributions! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- INCOIS (Indian National Centre for Ocean Information Services)
- Supabase for the backend infrastructure
- OpenRouter for AI analysis capabilities
- Leaflet for mapping functionality
- Radix UI for accessible components
For support and questions:
- Create an issue in this repository
- Contact the development team
- Check the documentation
Built with โค๏ธ for coastal community safety
This platform helps protect coastal communities by enabling real-time hazard reporting and early warning systems.