This document outlines the main features of the DisasterWatch web application, including real-time alerts, interactive maps, user profiles, resource management, and the notification system.
The application provides real-time alerts about natural disasters, allowing users to stay informed about ongoing events in their area.
- Live Updates: Alerts are updated in real-time as new information becomes available.
- Filtering: Users can filter alerts by type, location, and severity.
- Push Notifications: Users can opt-in to receive push notifications for critical alerts.
// Example of fetching real-time alerts
const fetchAlerts = async () => {
const response = await api.get('/alerts');
setAlerts(response.data);
};The application includes an interactive map that displays disaster zones and relevant information.
- Disaster Zones: Highlighted areas on the map indicate disaster zones.
- User Location: Users can view their current location on the map.
- Custom Markers: Custom markers for different types of disasters.
// Example of rendering a map with disaster zones
const MapView = () => {
return (
<GoogleMap
center={center}
zoom={zoom}
>
{disasterZones.map(zone => (
<Polygon
key={zone.id}
paths={zone.coordinates}
options={{
fillColor: zone.severity === 'high' ? 'red' : 'yellow',
fillOpacity: 0.5,
strokeColor: 'black',
strokeWeight: 1
}}
/>
))}
</GoogleMap>
);
};Users can create and manage their profiles, including personal information and preferences.
- Profile Creation: Users can create a profile with personal details.
- Profile Updates: Users can update their profile information at any time.
- Preferences: Users can set preferences for notifications and alerts.
// Example of updating user profile
const updateProfile = async (userData) => {
const response = await api.put('/profile', userData);
setUser(response.data);
};The application allows users to manage resources related to disaster response and recovery.
- Resource Listing: Users can view a list of available resources.
- Resource Allocation: Users can allocate resources to specific disaster zones.
- Resource Tracking: Track the status and location of resources.
// Example of fetching resources
const fetchResources = async () => {
const response = await api.get('/resources');
setResources(response.data);
};The application includes a notification system to keep users informed about important updates.
- Push Notifications: Users can receive push notifications for critical alerts.
- In-App Notifications: Notifications are also displayed within the application.
- Notification Preferences: Users can customize their notification settings.
// Example of subscribing to push notifications
const subscribeToNotifications = async () => {
const registration = await navigator.serviceWorker.ready;
const subscription = await registration.pushManager.subscribe({
userVisibleOnly: true,
applicationServerKey: process.env.NEXT_PUBLIC_VAPID_PUBLIC_KEY
});
await api.post('/notifications/subscribe', subscription);
};- The application can function offline, allowing users to access critical information without an internet connection.
- The application is designed to be responsive, providing a seamless experience on both desktop and mobile devices.
- The application adheres to accessibility guidelines, ensuring that all users can access and use the application effectively.
- The application includes analytics and reporting features to track user engagement and application performance.
- Integration with more data sources for real-time updates.
- Advanced filtering and search capabilities.
- Community features, such as user forums and shared resources.
- Gamification elements to encourage user participation.
- Integration with emergency services and disaster response organizations.
- Support for third-party applications and APIs.
- Predictive analytics for disaster forecasting.
- Customizable dashboards for data visualization.
describe('Real-time Alerts', () => {
it('should fetch alerts successfully', async () => {
// Test alert fetching
});
it('should filter alerts by type', async () => {
// Test alert filtering
});
});
describe('Interactive Maps', () => {
it('should render disaster zones correctly', () => {
// Test map rendering
});
it('should update user location', () => {
// Test location updates
});
});-
Alert Notifications
- Check notification settings
- Verify push notification subscription
- Ensure network connectivity
-
Map Rendering
- Check Google Maps API key
- Verify map data sources
- Clear browser cache
-
Profile Updates
- Check API responses
- Verify user permissions
- Review data validation
- Check the Issues page
- Create a new issue with detailed information
- Join our Discord community for support