A comprehensive coastal safety and alert system for Gujarat, India. This project provides real-time coastal alerts, SMS notifications, and safety information for coastal communities.
- Real-time Coastal Alerts - Monitor and manage coastal safety alerts
- SMS Alert System - Send instant SMS notifications to subscribers
- Admin Dashboard - Comprehensive admin interface for alert management
- User Subscriptions - Allow users to subscribe to SMS alerts
- Multi-severity Alerts - Low, Medium, High, and Critical alert levels
- Safe Places Directory - Information about safe locations during emergencies
- Fisheries Information - Coastal fisheries data and safety guidelines
- Pollution Reporting - System for reporting coastal pollution incidents
- Real-time Updates - Auto-refreshing dashboard every 30 seconds
- Responsive Design - Mobile-friendly interface using TailwindCSS
- RESTful API - Clean API endpoints for frontend-backend communication
- Database Management - SQLite database with Django ORM
- Backend: Django 5.2.1 (Python)
- Frontend: HTML5, TailwindCSS, JavaScript
- Database: SQLite3
- SMS Service: Twilio Integration
- Deployment: Development server (ready for production)
Before running this project, make sure you have:
- Python 3.8+ installed
- pip package manager
- Git for version control
- Twilio Account (for SMS functionality)
git clone <your-repository-url>
cd SAMUNDRASETUpip install -r requirements.txtCreate a .env file in the root directory:
# Twilio Configuration
TWILIO_ACCOUNT_SID=your_twilio_account_sid_here
TWILIO_AUTH_TOKEN=your_twilio_auth_token_here
TWILIO_PHONE_NUMBER=your_twilio_phone_number_here
# Django Configuration
SECRET_KEY=your_django_secret_key_here
DEBUG=True
ALLOWED_HOSTS=localhost,127.0.0.1python manage.py makemigrations
python manage.py migratepython manage.py createsuperuserpython manage.py runserverThe application will be available at: http://127.0.0.1:8000/
- Sign up at https://www.twilio.com/
- Get your Account SID and Auth Token from the dashboard
- Purchase a Twilio phone number
Replace the placeholder values in backend/settings.py:
TWILIO_ACCOUNT_SID = 'your_actual_account_sid'
TWILIO_AUTH_TOKEN = 'your_actual_auth_token'
TWILIO_PHONE_NUMBER = 'your_twilio_phone_number'SAMUNDRASETU/
βββ backend/ # Django project settings
β βββ settings.py # Main configuration
β βββ urls.py # Root URL configuration
β βββ wsgi.py # WSGI configuration
βββ mainapp/ # Main Django application
β βββ models.py # Database models
β βββ views.py # View functions
β βββ urls.py # App URL patterns
β βββ admin.py # Admin interface
β βββ utils.py # Utility functions
βββ templates/ # HTML templates
β βββ index.html # Home page
β βββ alerts.html # Alerts dashboard
β βββ adminfrontend.html # Admin interface
β βββ fisheries.html # Fisheries information
β βββ pollution.html # Pollution reporting
β βββ safeplaces.html # Safe places directory
βββ static/ # Static files
β βββ images/ # Image assets
βββ manage.py # Django management script
βββ requirements.txt # Python dependencies
βββ README.md # This file
- Home (
/) - Main landing page with SMS subscription - Alerts (
/alerts/) - Real-time alerts dashboard - Admin Dashboard (
/adminfrontend/) - Alert management interface - Fisheries (
/fisheries/) - Fisheries information - Pollution (
/pollution/) - Pollution reporting system - Safe Places (
/safeplaces/) - Emergency safe locations - Django Admin (
/admin/) - Database management
POST /api/subscribe-sms/- Subscribe to SMS alertsPOST /api/unsubscribe-sms/- Unsubscribe from SMS alertsGET /api/subscribers/- Get all SMS subscribers
GET /api/alerts/- Get all active alertsPOST /api/create-alert/- Create new alert (Admin only)POST /api/test-sms/- Test SMS functionality
- Alert - Coastal safety alerts with severity levels
- SMSSubscriber - Users subscribed to SMS notifications
- NotificationLog - Log of sent SMS notifications
- Fishery - Fisheries information
- SafePlace - Emergency safe locations
- PollutionReport - Pollution incident reports
- Uses TailwindCSS for responsive design
- Custom color scheme with ocean-themed colors
- Responsive grid layouts for mobile and desktop
- Low - Normal conditions
- Medium - Potential concern, monitor
- High - High risk, prepare
- Critical - Severe, evacuate if told
- Instant notifications to all subscribers
- Configurable alert severity levels
- Real-time delivery status tracking
- Emergency contact numbers
- Safe evacuation routes
- Coastal safety guidelines
- Create models in
mainapp/models.py - Add views in
mainapp/views.py - Update URLs in
mainapp/urls.py - Create templates in
templates/directory - Test thoroughly before deployment
- Follow PEP 8 Python guidelines
- Use meaningful variable and function names
- Add docstrings to functions and classes
- Comment complex logic
- Set
DEBUG = Falsein production - Use environment variables for sensitive data
- Configure proper database (PostgreSQL recommended)
- Set up static file serving
- Configure HTTPS
- Use production WSGI server (Gunicorn)
export DJANGO_SETTINGS_MODULE=backend.settings
export SECRET_KEY=your_production_secret_key
export ALLOWED_HOSTS=yourdomain.com- 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.
For support and questions:
- Create an issue in the repository
- Contact the development team
- Check the documentation
- Coastal Communities - For inspiration and feedback
- Django Community - For the excellent framework
- TailwindCSS - For the beautiful UI components
- Twilio - For reliable SMS services
- Weather integration
- Tide monitoring
- Mobile app development
- Multi-language support
- Advanced analytics dashboard
- Integration with government APIs
- Real-time weather alerts
- Community reporting system
Built with β€οΈ for Coastal Safety in Gujarat, India
Last updated: August 2025