2. Wildfire App
The Wildfire app project idea
When my plane was about to land in Trapani, I saw a small
fire on a field. As one of my friends in Trapani works at forest
fires department, I was thinking how reporting of wildfires
could be made easier.
A week later, when I was leaving, Palermo airport was closed
due to the raging wildfires. A week before the Catania
airport.
The Wildfire App.
My first bigger Java programming project at Software
Development Academy
3. Wildfire App
WILDFIRE TAB
• Add Wildfire name, latitude, longitude,
radius, coefficient values to the "wildfire"
database
4. Wildfire App
MAP TAB
• After saving wildfire info in database, the
"Map" tab shows all wildfires info right
away.
Wildfire App
5. Wildfire App
WILDFIRE TAB
• Only double values are allowed in
latitude, longitude, radius and coefficient
fields
Wildfire App
6. Wildfire App
MAP TAB
• All wildfires in Database are displayed in
the table when pressing “Show wildfires”.
• Some initial wildfires are auto-generated
at the app start, so if app starts, the info
of auto-generated wildfires is shown.
7. Wildfire App
MAP TAB
• When selecting one of the wildfires in
wildfires table:
▫ Open Street Map of the fire location is
displayed (querying latitude, longitude from
database and connecting OSM).
8. Wildfire App
MAP TAB / PEOPLE IN AREA TAB
• When selecting one of the wildfires in
map tab:
▫ People in Red Zone are displayed in
"People in Area" tab.
9. Wildfire App
MAP TAB
• Deleting a wildfire:
▫ Wildfires can be deleted from table and
database by pressing "Delete a wildfire"
button.
10. Wildfire App
MAP TAB
• Deleting a wildfire:
▫ If no wildfire is selected then pressing
“Delete a wildfire” button causes an alert
modal to be shown with text: “To delete a
wildfire, please select a wildfire first!”
11. Wildfire App
MAP TAB
• Updating a wildfire:
▫ Wildfires can be updated by pressing
“Update wildfire" button.
12. Wildfire App
MAP TAB
• Updating a wildfire:
▫ After selecting a particular wildfire and
pressing "Update wildfire", a new scene is
displayed to update wildfire info in
database.
13. Wildfire App
MAP TAB
• Updating a wildfire:
▫ As the result the Wildfire info is updated
both in app and database
14. Wildfire App
DATABASE VIEW
• Updating a wildfire:
▫ As the result the Wildfire info is updated
both in app and database
15. Wildfire App
FIRESTATIONS TAB
• In firestations tab you can see all
firestations (from database).
• The functionality to show the closest
firestations is yet to be developed
16. Wildfire App
PEOPLE IN AREA TAB
• To see people in Red Zone, select a
wildfire in MAP tab.
• The functionality of button “Update status
of people in area” is to be developed yet.
17. Wildfire App
PEOPLE IN AREA TAB
• You may also query the data of all people
from database if you press “Display all
residents” button.
18. Wildfire App
RESCUERS IN AREA TAB
• If you have selected a wildfire in MAP tab,
then “Rescuers in Area” shows which
rescuers are currently working in this
particular wildfire area.
• With initial demo data you may see that
only Corleone has sent rescuers to the
area.
19. Wildfire App
RESCUERS IN AREA TAB
• If no rescuers are connected to the
wildfire in database, the alert is
displayed: “No rescuers connected to the
wildfire yet!”
20. Wildfire App
RESCUERS IN AREA TAB
• If no rescuers are connected to the
wildfire yet (i.e. Trapnani Fire, Palermo
Fire), then the alert is displayed:
No rescuers connected to the wildfire yet!
21. Wildfire App
ADD RESCUERS IN AREA VIEW
• If you pressed the button “Add rescuers in
area” then a new view to add rescuers is
shown.
• The view is still in development (not
working at the moment)
22. Wildfire App
WEATHER TAB
• To see weather broadcast of the wildfire
area:
▫ MAP tab → select wildfire
▫ WEATHER tab → “Get weather data”
• Real time 5-day weather data of the
selected location is fetched through the
Open Weather Map API
23. Wildfire App
THE CODE
• The code is divided into packages:
▫ Controllers (which control the actions of tabs,
buttons, views etc.)
▫ Data:
◦ Dao (interfaces, classes)
◦ Entities
◦ Utils (hibernateUtil class for hibernate settings)
▫ Weatherdata (defining weather data from
web)
24. Wildfire App
USED TECHNOLOGIES
• Java
• JavaFx
• Hibernate
• MySql (for database)
• Open Weather Map API (for fetching
weather data from web)
• Map data is fetched from Open Street Map
from web (no API key needed)
25. Wildfire App
PREREQUISITES TO RUN THE CODE
• Maven
• Mysql DB
• intelliJ (optional)
• OpenWeatherMap API key (if you want to fetch weather data from web)
26. Wildfire App
TO RUN THE APP
• git clone this repository locally https://gitlab.com/java-
remote-ee27-course/wildfire-app.git
• verify MySql is running on the target system
• create a MySql database named: wildfire (or use dump
provided)
• copy the file
src/main/resources/app.properties.example into
src/main/resources/app.properties and provide
appropriate options
• Get Open Weather Map "Call 5 day / 3 hour forecast
data" API key to fetch weather data from web:
https://openweathermap.org/forecast5
• provide API key to your new file:
src/main/resources/app.properties
• the database tables will be created automatically
because of the HBM2DDL_AUTO=create
• launch the application, the entry point is:
com.lunamezzogiorno.wildfireapp.WildfireApp
class