From Safe Streets to safe cities, countries and the world!
Safe Streets assists women, children, seniors, and other groups that don’t feel safe while getting around the city on their own.
Safe Streets is an app, aiming to solve the 5th and 11th Sustainable Development Goals . The core idea is to help those who do not feel safe on the street, especially girls and women, by providing filters (informative points) and area-based maps (ranking of crime reports).
The three types of points are: danger (high recommendation to avoid the area), recommendation ( medium recommendation to be careful) and safe (advice to be aware of safe places in the city). Danger (red) and recommendation (yellow) are community-generated features, while safe (green) are official places, generated by the app.
The area-based map is coloured, based on official crime reports from city police. Thus, the user can see what areas are better and what are worse.
After all, the app includes a forum for points discussion and making the area a better place, and support emergency contacts. Also, there is a space for user profile settings and other administrative features.
Watch our You-Tube video to get the overview of the app!
2023 Solution Challenge | Google Developers
To get started with this project, you'll need to have Flutter installed on your local machine. You can follow the installation instructions on the Flutter website.
You'll also need to have the following software installed:
- Android Studio or Visual Studio Code (with Flutter and Dart plugins) for development
- A Google Cloud Platform account with the Maps API and Firebase services enabled
- Clone this repository to your local machine
using
git clone https://github.com/Maksym-Bondarenko/safe_streets.git
. - Run
flutter pub get
to install the required dependencies. - Run the app using
flutter run
on emulator or your connected device. - Run the conde generator using
make generate
during development, since the project uses go_router_builder, riverpod_generator and freezed.
If you want to start a local server, start Docker, go to the backend
folder, open console and type
following commands, while running
your Docker Desktop:
docker build .
docker tag <id_of_built_image> run_db
docker run -p 8080:8080 run_db
Those commands will start the server locally on your machine via docker.
To be able fetch and save the points, you have to change in code host
variable from its value
to "localhost"
(you need to uncomment some lines of code in start_page.dart
and dialog_window.dart
, that are mentioned in
comments).
You can try (e.g. via Postman) run a
get-request: http://127.0.0.1:8080/get/all_places
and see all
already created points.
You should now be able to run the app on your emulator or physical device.
Currently our app is using Google Maps API Key, that is protected via Google Cloud Console and the value are hidden in the Environmental Variables. If you want to use your own API Key, please, update following files (You can follow the Google Cloud Platform documentation for instructions on how to do this.):
AndroidManifest.xml
(to run on Android devices)AppDelegate.swift
(to run on iOS devices)index.html
(to run on web)index.html
amdindex.js
indata-driven-styling
-folder ( for data-driven-styling of the maps) Also, you need to change the API key in the source code in the filestart_page.dart
, by adding your own key in theapiKey
-variable in_onMapCreated()
-function (for fetching the police-stations and saved points).
For the proof of concept, we built a 3-tier application on the Google cloud platform. The presentation layer was built on Flutter. For the business logic tier, we launched a docker container on a VM instance using Flask Python. Finally, the database is a PostgreSQL server, which is stored in Cloud SQL. The connection between the frontend and the backend was implemented using the REST API. Before deploying an application to production, we are going to transfer the backend server to Google Kubernetes Engine. Since users will update danger points frequently, we will deploy an in-memory database for the points.
- Flutter - The framework used
- Dart - The language used
- Flask Python - For backend
- PostgreSQL - For Database
- Docker - For running Server in a container
- Google Maps API - For maps and location services
- Firebase - For authentication
- Google Cloud Platform - For cloud services
- Currently following pages are placeholders with dummy data and with no
functionality:
dds_map.dart
,edit_user_details_page.dart
,forum_page.dart
andsettings_page.dart
- As Data Driven Styling (DDS) by Google Maps for Flutter Applications is currently under development, we could not implement it into our maps
- Also, currently we faced problems with fetching data from the backend (markers of custom user points: DangerPoints and RecommendationPoints) on Android. On iOS it works on other hand. It should be a problem on Google-side (Google Issue Tracker and GitHub Issue), so we are waiting for the fix to implement it in our app.
- Updating the current placeholders for the settings-page, edit-profile-details-page, and forum-page to provide a better user experience and more functionality.
- On the settings-page, add options for changing user preferences such as language, time zone, and notification settings.
- Restructure the source code by dividing it into multiple files and extracting it into reusable components
- Implement voting for points (dangerPoint, recommendationPoint and safePoint) and logic for their auto-deletion.
- Add overall information for regions from DDS, containing report details, such as: last criminal rate, amount of thefts; touristic advices for countries.
- On the edit-profile-details-page, allow users to update their profile information such as name, email address, and profile picture.
- On the forum-page, add features such as upvoting and downvoting posts, write own posts, and sorting posts by popularity, date, or relevance.
- Improve the user interface and design of all three pages to make them more visually appealing and easier to navigate.
- Provide clustering of map-markers by zoom-out.
- Add unit and integration tests for these pages to ensure that they are functioning correctly and to prevent any regressions in functionality.
- Consider adding support for additional languages to make the website accessible to a wider audience.
The application was tested on mobile devices with Android and iOS:
- Android 13 (Xiaomi 11T) - physical device
- iOS 16.2 (iPhone 12) - emulator
There are some of screenshots of our SafeStreets-App:
Title | Screenshot |
---|---|
Intro-slider | |
Main screen | |
DDS map | |
User profile | |
User profile | |
Filter map | |
Safe point | |
point creation |
This project is licensed under the Apache License, Version 2.0. See the LICENSE file for details.
The Apache License, Version 2.0 is a permissive open source software license that allows you to use, modify, and distribute the software for both commercial and non-commercial purposes. Under the terms of the Apache License, the software is provided "as is", without warranty of any kind, and the copyright holder (the original author or authors of the software) is not liable for any damages arising from the use or distribution of the software.
One key feature of the Apache License is its patent license grant, which means that anyone who receives the software also receives a license to any patents that are necessary to use the software. This provision helps to prevent patent disputes and ensures that the software can be used and distributed without fear of patent litigation.
For more information about the Apache License, Version 2.0, please see the official license page.