Skip to content

Safe Streets assists women, children, seniors, and other groups that don’t feel safe while getting around the city on their own.

License

Notifications You must be signed in to change notification settings

Maksym-Bondarenko/safe_streets

Repository files navigation

🗺️ safeStreets

logo

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.

Flutter Version Dart Version Flask Version Python PostgreSQL Version Docker Version Firebase Google Maps API Google Cloud Platform

📝 Description

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

🚀 Getting Started

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.

🦾 Prerequisites

You'll also need to have the following software installed:

🦿 Installation

👀 Frontend

  1. Clone this repository to your local machine using git clone https://github.com/Maksym-Bondarenko/safe_streets.git.
  2. Run flutter pub get to install the required dependencies.
  3. Run the app using flutter run on emulator or your connected device.
  4. Run the conde generator using make generate during development, since the project uses go_router_builder, riverpod_generator and freezed.

⚙ Backend and Database

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.

➕ Notes

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 amd index.js in data-driven-styling-folder ( for data-driven-styling of the maps) Also, you need to change the API key in the source code in the file start_page.dart, by adding your own key in the apiKey-variable in _onMapCreated()-function (for fetching the police-stations and saved points).

💻 Technologies used

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.

🚫 Limitations:

  • Currently following pages are placeholders with dummy data and with no functionality: dds_map.dart, edit_user_details_page.dart, forum_page.dart and settings_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.

🔮 Future Work:

  • 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.

🧪 Tested on:

The application was tested on mobile devices with Android and iOS:

  • Android 13 (Xiaomi 11T) - physical device
  • iOS 16.2 (iPhone 12) - emulator

👥 Authors

📷 App-Screenshots

There are some of screenshots of our SafeStreets-App:

Title Screenshot
Intro-slider Screenshot of SafeStreets1
Main screen Screenshot of SafeStreets2
DDS map Screenshot of SafeStreets3
User profile Screenshot of SafeStreets4
User profile Screenshot of SafeStreets5
Filter map Screenshot of SafeStreets6
Safe point Screenshot of SafeStreets7
point creation Screenshot of SafeStreets8

⚖ License

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.