Skip to content

A web-based platform that helps fuel stations manage fuel availability, with user-friendly UI and comprehensive admin panel

License

Notifications You must be signed in to change notification settings

hirusha-adi/Fuel-Availability

Repository files navigation

Fuel Availability / Fuel App / Fuel Check

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.

How to setup on Ubuntu Server

Install and Setup MongoDB

  1. Install

    sudo apt update && sudo apt upgrade -y
    sudo apt install mongodb -y
    sudo systemctl enable mongodb --now
  2. Run this command and open the config file

    sudo nano /etc/mongodb.conf
  3. Change bind_ip from 127.0.0.1 to 0.0.0.0

    bind_ip = 0.0.0.0
  4. 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

  1. Start MongoDB CLI

    mongo
  2. Switch to the default pre-made admin database

    use admin
    
  3. 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

  1. Open the config file

    sudo nano /etc/mongodb.conf
  2. Edit the file content Ctrl+W to search

    authorization: enabled
    
  3. Restart MongoDB Service

    sudo systemctl restart mongod

Install and Setup the Web App

  1. Install main dependencies

    sudo apt update && sudo apt upgrade -y
    sudo apt install python3 python3-pip git nano -y
  2. Create a seperate folder (Optional)

    mkdir FuelApp && cd ./FuelApp
  3. Clone the repo and cd into it

    git clone "https://github.com/hirusha-adi/Fuel-Availability.git" && cd ./Fuel-Availability
  4. Install requirements

    python3 -m pip instal -r requirements.txt
  5. 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 the settings.json file)
    mv .env.example .env
    nano .env
    • or, edit the database/settings.json directly
    nano database/settings.json
    • adminkey: Password to access admin panel
    • flaskSecret: Flask Secret Key. Learn more here
    • JawgToken: Token for the Map's Dark Theme. You can get it from here
    • mongodb 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

  1. Start the web server

    python3 app.py

Images

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

About

A web-based platform that helps fuel stations manage fuel availability, with user-friendly UI and comprehensive admin panel

Resources

License

Stars

Watchers

Forks

Packages

No packages published