Skip to content

Desktop application for maintenance control within a company, using Realtime Database (Firebase). Can be transformed into other types of application

Notifications You must be signed in to change notification settings

Tam-Leal/Desktop_Maintenance_App---Firebase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

I.T Maintance

Application in Python to control the maintenance of computers in sectors of a company with a realtime database -Firebase.


The Project

The idea of this project is that the employees of a company can make maintenance requests when necessary. In addition, they can follow the progress of calls within a screen called "Queue".

Each user registers with their name, email and company sector. From there, it can execute a call and be recognized in the request queue.

The maintenance team can access this list and schedule the execution of each request. In addition to tracking case statistics in real time to assist in decision making

Dependencies

See requirements.txt

Installation

This application was packaged using PyInstaller.

For more information about PyInstaller installation, visit: https://pyinstaller.readthedocs.io/en/stable/installation.html


After installing all the above dependencies, install pyinstaller:

pip install pyinstaller

Open the command prompt terminal, activate your virtual environment and go to the folder that contains your project files main.py and main.kv.

Once that's done, type:

pyinstaller --onefile main.py

This will be created:

  • 1 folder calling build
  • 1 folder calling dist - with the executable file
  • 1 main.spec file - with application settings

Setting the App

Click on the main.spec file

Note: If you are not packaging an application that uses kivyMD, remove the second import from kivymd import hooks_path as kivymd_hooks_path and change the line hookspath=[]. Otherwise, skip this part.

# -*- mode: python ; coding: utf-8 -*-

from kivy_deps import sdl2, glew
from kivymd import hooks_path as kivymd_hooks_path   <-----

block_cipher = None


a = Analysis(['main.py'],
             pathex=[],
             binaries=[],
             datas=[('main.kv', '.'), ('./assets/*.gif','assets'),('./assets/*.ico','assets'),('./assets/*.png','assets')],
             hookspath=[kivymd_hooks_path],   <-----
             hiddenimports=[],
             hooksconfig={},
             #...
 )

After all this, save everything and run the code above in the terminal:

pyinstaller main.spec

Once you're done, go back to the dist folder and run the main.exe file. Your application should start normally

FIREBASE SETTINGS

After that, inside the console from Firebase:

  • Set a new Web application
  • Register your app
  • Click in Realtime Database on the left side of the console and Create Database
  • Follow the steps for configuration.

At this point your realtime database has been created.

Go to Project Overview at the left side of the console and click on the gear icon. Select Project settings. InGeneraltab, scroll down the page and search for the following items:

{
"apiKey": " project api key ",
"authDomain": " project authDomain ",
"databaseURL": " project databaseURL ",
"storageBucket": " project storageBucket "
}

*Note: If "databaseURL": " your project databaseURL "does not appear, refresh the page and wait a few seconds.

Replace these values inside the db.py file:

class LogData:
     def __init__(self):
         self.config = {
             "apiKey": " project api key ",
             "authDomain": " project authDomain ",
             "databaseURL": " project databaseURL ",
             "storageBucket": " project storageBucket ",
         }

From now on, your project is created, with a database connected.It still lacks the configuration of the rules of access to the database.

Firebase Rules of Database

Click on Realtime Databaseat the left side of the console and choose Rulestab.

Edit the rules to:

{
  "rules": {
    "users":{
       "$uid": {
        // Allow only authenticated content owners access to their data
        ".read":"auth != null && auth.uid == $uid",
        ".write":"auth != null && auth.uid == $uid"
        }
    },
    "issues":{
       ".read":"auth != null",
       ".write":"auth != null"
    },
            
    "requests":{
        ".read":"auth != null",
        ".write":"auth != null"
    },
         
     "requests_historic":{
        ".read":"auth != null",
        ".write":"auth != null"
    },
      
      "admin":{
        	// Allow only authenticated admin access to data
        	// put the email that will be the administrator. Example:
        ".read":"auth != null && auth.token.email == 'admin@mycompany.com' ",
        ".write":"auth != null && auth.token.email == 'admin@mycompany.com' "
        }
    }        
}

Note: To configure the app admin, change the auth.token.email == 'admin@mycompany.com' from read and write to the email that will be the admin created in Authentication

For more information about firebase rules, see: https://firebase.google.com/docs/database/security

Your application is ready to run!

Screens


Client Side Screens

Login

alt-text

SignUp

alt-text

Request Window

On this screen, the user points to which category of problem he requires assistance and details of what happened.

alt-text

Queue

Here, users can follow the progress of their requests

alt-text


Admin I.T Side Screens

Config Area

In this part, the administrator can enter new issues, view the correct entry in the issues list, and do a test submission to make sure everything is working.

alt-text

QUEUE

In this area, the administrator can see the requests and as he solves the problems, he can remove them from the queue. The database is automatically updated and users can follow the queue in real time.

alt-text

Historic Issues

To assist in decision making, there is an area with problem statistics. Thus, it is possible to evaluate recurring problems, assess costs and prevent future problems.

alt-text

Documentation

KivyMd

Kivy

License

KivyMD and kivy are released under the terms of the MIT License.

About

Desktop application for maintenance control within a company, using Realtime Database (Firebase). Can be transformed into other types of application

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published