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:
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 is SuperSecretPassword
)
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 search
authorization: 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
.env.example.
to .env
and edit the .env file. (This file will be renamed as .env.old
once everything has been loaded to the settings.json
file)
mv .env.example .env
nano .env
database/settings.json
directlynano 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/login
route. Once its updated, the web server should be restartedStart the web server
python3 app.py