Serenity EWS Bogor is a comprehensive Early Warning System (EWS) designed to provide timely and accurate information about weather and potential natural disasters in the Bogor City and Regency areas. Built with modern web technologies and powered by Generative AI, this application aims to enhance community preparedness and safety.
- Real-time Weather Monitoring: Get current weather conditions and a 7-day forecast for Bogor City and Regency.
- AI-Powered Recommendations: Receive daily AI-generated suggestions for activities and clothing based on the weather forecast.
- Multi-Disaster Information Pages: Dedicated dashboards for monitoring:
- 🌊 Floods: Tracks water levels at key dams like Katulampa.
- 🌍 Earthquakes: Shows the latest seismic activity details.
- ⛰️ Landslides: Assesses and displays current landslide risks.
- 🔥 Fires: Reports on active fire incidents.
- 🌋 Volcanoes: Monitors the status of nearby volcanoes like Mount Salak.
- 🌪️ Whirlwinds/Typhoons: Provides alerts on tropical storms.
- Nearby Hazard Alerts: Uses your device's location to provide real-time, personalized safety alerts if you are near a potential hazard.
- Community Reporting: A crowd-sourcing platform for citizens to report incidents with photos and descriptions. Reports are analyzed and summarized by AI.
- Annual Disaster Reports: Interactive charts and AI-driven trend analysis of disaster data by year and location (Bogor City/Regency).
- Bilingual Support: Fully available in both English and Indonesian.
- Framework: Next.js (with App Router)
- Language: TypeScript
- UI: React, ShadCN UI, Tailwind CSS
- Generative AI: Google AI & Genkit
- Database: PostgreSQL
- Deployment: Firebase App Hosting (or any Node.js compatible platform)
Follow these instructions to get a copy of the project up and running on your local machine for development and testing purposes.
- Node.js (v18 or newer)
- npm or yarn
- PostgreSQL database running locally or accessible.
-
Clone the repository:
git clone https://github.com/sazwarriyadhs/SerenityEWS.git cd SerenityEWS -
Install dependencies:
npm install
-
Set up environment variables: Create a
.envfile in the root of the project. Fill in your details as shown below.# Google AI API Key for Genkit GOOGLE_API_KEY=YOUR_GOOGLE_AI_API_KEY # PostgreSQL Database Connection DB_USER=postgres DB_HOST=localhost DB_DATABASE=serenityews DB_PASSWORD=postgres DB_PORT=5432
Replace
YOUR_GOOGLE_AI_API_KEYwith your actual key from Google AI Studio. -
Set up the database:
- Make sure your PostgreSQL server is running.
- Create a new database named
serenityews. - Connect to your new database and run the SQL commands in
schema.sqlto create the necessaryreportstable.
Example using
psql:psql -U postgres -d serenityews -a -f schema.sql
-
Run the development server: The application will be available at
http://localhost:3000.npm run dev
-
(Optional) Run the Genkit Developer UI: To inspect and test your AI flows separately, run the Genkit development UI in a separate terminal. It will be available at
http://localhost:4000.npm run genkit:dev
src/app/: Contains all the pages and routes for the application, following the Next.js App Router structure.src/components/: Shared React components used across the application, including UI components from ShadCN.src/ai/:flows/: All Genkit AI flows are defined here. Each file typically encapsulates a single AI-driven task.genkit.ts: Genkit configuration file.
src/lib/:db.ts: PostgreSQL database connection setup.utils.ts: Shared utility functions.*.ts: Mock data sources and type definitions for various disaster types (e.g.,weather.ts,earthquake.ts).
src/contexts/: React Context providers, such as theLanguageProvider.src/locales/: JSON files for internationalization (i18n) strings (English and Indonesian).public/: Static assets, including the application logo.schema.sql: The SQL schema for the database tables.
This project was developed within Firebase Studio.
