A web-based disaster management platform built with Spring Boot, MySQL, and Thymeleaf. The system allows users to register, report disasters, and track their reports β while admins can manage all reports, update their statuses, and oversee the user base.
π For more UI screenshots, please refer to the screenshots folder.
- Features
- Tech Stack
- Prerequisites
- Getting Started
- First Admin Setup
- Configuration
- Usage
- Project Structure
- Register and log in via a shared login page
- Submit disaster reports
- View all personal reports and their current status
- Log in via the same shared login page (role-based redirect after login)
- Add new admin accounts after logging in
- View all registered users
- View and manage all disaster reports
- Update report statuses (e.g. Pending β Approved)
| Layer | Technology |
|---|---|
| Backend | Java 17, Spring Boot |
| Frontend | Thymeleaf, HTML, CSS |
| Database | MySQL |
| ORM | Spring Data JPA / Hibernate |
| Security | Spring Security |
| Build Tool | Maven (via Maven Wrapper) |
Make sure the following are installed before running the project:
| Tool | Version | Notes |
|---|---|---|
| Java (JDK) | 17 | Download here |
| MySQL | 8+ | Must be running before starting the app |
| Git | Any | For cloning the repository |
| Maven | Not required | Included via mvnw Maven Wrapper |
git clone https://github.com/asnaassalam/disaster-management-system.git
cd disaster-management-systemCreate a MySQL database:
CREATE DATABASE disaster_management_project;Copy the example properties file and fill in your credentials:
cp src/main/resources/application.properties.example src/main/resources/application.propertiesThen edit application.properties with your MySQL username and password.
./mvnw spring-boot:runOn Windows:
mvnw.cmd spring-boot:run
β οΈ Important: The root URLhttp://localhost:8080/has no page and will show an error.
Start here:
http://localhost:8080/user/index
π For privacy and security reasons, the first admin must be inserted manually into the database. Once logged in, that admin can add further admins through the application.
After the application has started (so Hibernate has created the tables), run the following SQL query in your MySQL client:
INSERT INTO admin (
name,
email,
username,
password,
role,
enabled,
created_at,
updated_at
) VALUES (
'Demo Admin',
'admin@gmail.com',
'demo_admin',
'Admin@123',
'ADMIN',
1,
NOW(),
NOW()
);Then log in at:
http://localhost:8080/user/login
Using these credentials:
| Field | Value |
|---|---|
| Username | demo_admin |
| Password | Admin@123 |
The application.properties file is not committed to this repository to protect sensitive credentials. Use the provided application.properties.example as a template.
Key settings to configure:
spring.datasource.url=jdbc:mysql://localhost:3306/disaster_management_project
spring.datasource.username=your_username
spring.datasource.password=your_passwordThe database schema is auto-managed by Hibernate (ddl-auto=update), so tables will be created automatically on first run.
Both users and admins share the same login page at /user/login. Role assignment works as follows:
| Action | Role Assigned |
|---|---|
| Self-registration | USER |
| Admin adds new admin | ADMIN |
After a successful login, the system automatically redirects based on the user's role:
| Role | Redirected To |
|---|---|
USER |
Report Incident form page |
ADMIN |
Admin dashboard |
β οΈ http://localhost:8080/is not a valid page β always use the URLs below directly.
| Page | URL |
|---|---|
| Login | http://localhost:8080/user/login |
| User Home | http://localhost:8080/user/index |
src/
βββ main/
β βββ java/project/java/projectdisastermanagement/
β β βββ controller/ # MVC Controllers
β β βββ model/ # Entity classes
β β βββ repository/ # JPA Repositories
β β βββ service/ # Business logic
β βββ resources/
β βββ templates/ # Thymeleaf HTML templates
β βββ static/ # CSS, JS, images
β βββ application.properties.example
βββ test/
βββ java/project/java/projectdisastermanagement/
- Session timeout is set to 10 minutes by default
- Spring Security debug logging is enabled in development β disable for production
- Make sure MySQL is running before starting the application
- The embedded Tomcat server runs on port 8080 by default



