Fuel App is an innovative solution inspired by the fuel crisis that occurred in Sri Lanka from late 2021 to mid 2022. Fuel App was developed to provide an effective solution that simplifies the management of fuel usage and availability of fuel in filling stations.
Fuel App is a web-based platform that enables fuel stations to manage their fuel availability in a simple and user-friendly way. Designed with the needs of fuel stations in mind, this app provides a seamless experience for station owners, allowing them to manage their fuel stock with ease and efficiency once the station has been approved by the Administrator.
-
Account registration: Fuel stations can register an account on the app, providing them with access to a range of features and functionalities.
-
Interactive user interface: With an intuitive and user-friendly interface, Fuel App makes it easy for station owners to manage their fuel availability and make updates as required.
-
Station approval: All stations must be approved by an administrator before they can use the app, ensuring that the platform is used only by authorized fuel stations.
-
When users view the map on Fuel App, they have the option to give permissions to the app to access their geolocation. If permissions are granted, the app will automatically highlight fuel stations around the user's location, making it easy for them to find the nearest station.
-
To ensure the security of our users' data, we've implemented strict measures to protect their geolocation information. Specifically, we never send this data to the backend for any monitoring purposes. Instead, the data is processed locally on the user's device, ensuring that their geolocation information remains private and secure.
-
Admin Panel Features:
- The Fuel App admin panel is an interactive and user-friendly web interface that provides administrators with a range of features and functionalities. These features include:
- User management: The admin panel allows administrators to manage user accounts, including adding, editing, and deleting accounts as required.
- Station management: Administrators can also manage approved and pending fuel stations, ensuring that only authorized stations are allowed to use the app.
- Analytics: The admin panel provides a range of analytics tools, allowing administrators to monitor usage, track trends, and make informed decisions about fuel stock management.
- Logs: Administrators can access and review logs related to user activity and system events, providing valuable insight into app usage and performance.
- Security: The admin panel is designed with security in mind, providing administrators with the tools they need to manage access and protect user data.
-
Install
sudo apt update && sudo apt upgrade -y sudo apt install mongodb -y sudo systemctl enable mongodb --now
-
Run this command and open the config file
sudo nano /etc/mongodb.conf
-
Change bind_ip from 127.0.0.1 to 0.0.0.0
bind_ip = 0.0.0.0
-
run this command to restart mongo
sudo systemctl restart mongodb
MongoDB is now publicly accessible by the default Port and the Server IP. Now, create an account and enable authorization for security
-
Start MongoDB CLI
mongo
-
Switch to the default pre-made admin database
use admin
-
Create a new user (in this example, the username is
AdminUserName
and the password isSuperSecretPassword
)db.createUser( { user: "AdminUserName", pwd: "SuperSecretPassword", roles: [ { role: "userAdminAnyDatabase", db: "admin" }, "readWriteAnyDatabase" ] } )
The new user is created, Now, You have to make logging-in required
-
Open the config file
sudo nano /etc/mongodb.conf
-
Edit the file content
Ctrl+W
to searchauthorization: enabled
-
Restart MongoDB Service
sudo systemctl restart mongod
-
Install main dependencies
sudo apt update && sudo apt upgrade -y sudo apt install python3 python3-pip git nano -y
-
Create a seperate folder (Optional)
mkdir FuelApp && cd ./FuelApp
-
Clone the repo and cd into it
git clone "https://github.com/hirusha-adi/Fuel-Availability.git" && cd ./Fuel-Availability
-
Install requirements
python3 -m pip instal -r requirements.txt
-
Edit the main config file
- rename the
.env.example.
to.env
and edit the .env file. (This file will be renamed as.env.old
once everything has been loaded to thesettings.json
file)
mv .env.example .env nano .env
- or, edit the
database/settings.json
directly
nano database/settings.json
adminkey
: Password to access admin panelflaskSecret
: Flask Secret Key. Learn more hereJawgToken
: Token for the Map's Dark Theme. You can get it from heremongodb
and Others: Your Mongo DB Server IP, Username and Password- The admin user settings are to be filled once you create your account visiting the
/login
route. Once its updated, the web server should be restarted
- rename the
-
Start the web server
python3 app.py