This is a simple web base GUI banking system , built with python flask and postgresql.
In this system we have 3 types of users:
- Super Admin: ability to perform any kind of tasks in the system. (Only have one in the system)
- Edit Profile
- Add Users
- Delete Users
- Add admins
- Delete Admins
- Normal Admin: can perform same tasks as super admin except adding another admin and deleting them.
- Edit Profile
- Add Users
- Delete Users
- Normal User: which only perform tasks related to their accounts. They are added by admins.
- Edit profile basic information (can not delete accoun)
- Deposit Money
- Withdraw Money
- Check Balance
Users can also reset their password
-
PostgreSQL: For database (Linux) (Wiindows)
-
Flask: Install
-
Falsk-wtf: Used to handle forms in flask. Install
-
email_validator: To validate email fields. It is part of flask-wtf.
pip3 install email_validator
-
SQLAlchemy: SQLAlchemy is a popular SQL toolkit and Object Relational Mapper.
pip3 install Flask-SQLAlchemy
-
Flask-Migrate: Flask-Migrate is an extension that handles SQLAlchemy database migrations for Flask applications using Alembic.
pip3 install Flask-Migrate
-
Flask-Script: The Flask-Script extension provides support for writing external scripts in Flask.
pip3 install Flask-Script
-
pylint-flask: pylint-flask is a Pylint plugin to aid Pylint in recognizing and understanding errors caused when using Flask.
pip3 install pylint-flask
-
passlib: Passlib is a password hashing library for Python 2 & 3, which provides cross-platform implementations.
pip3 install passlib
-
flask-mail: The Flask-Mail extension provides a simple interface to set up SMTP with your Flask application and to send messages from your views and scripts.
pip3 install Flask-Mail
Python Files
- connections.py: This file create flask app, generate secrete key for our app and connect to postgresql database.
- main.py: This file is the entry pase of our app it runs the app.
- migrations.py: This file contains the datbase migrations. our table structure.
- seed.py: This file contains the data to be seeded to database for first time.
- models.py: This file contains models of our tables. Each class represet a table in the database.
- password_reset.py: this file contains functions to reset user password
- forms.py: This file has our all forms classes. using the wtforms.
- authentication.py: This file has login, logout and also functions to keep user track.
- functions.py: This file include some cusom validation functions and functions used globaly in the templates.
- users.py: This file contain all functions to be used when working as normal user.
- admin.py: This file contain all functions to be used when working as admin user. and some functions can be accessed from user.py file too.
- generate_reciept.py: This file generate user reciepts for chekcing, withdrawing and depositing money.
Template Files
- Admin Dirctory: Contain all admin related templates.
- Authentiation Directory: Contain all templates realted to authentication and passwrod reset
- Layouts Directory: Contain main template for our project.
- Other files are related to normal user
Assets Files
- static folder: contains all the assests files
- Css: All css files
- Js: All Javascript and jquery files
-
You should have python and postgresql installed in your system.
-
Download the project.
-
Go to connections file and edit your postgresql database URI and database name.
-
You should set the email configurations in connections file aswell. if you use smtp.gmail.com then you should have a app password for your gmail account. go and create one before proceeding. and alsow edit the configurations
-
Run Migrations: Go to the project dirctory and run the following commands:
python3 migrations.py db init python3 migrations.py db migrate python3 migrations.py db upgrade
-
Seed data: Add one super admin by running the seed file:
python3 seed.py
-
export App:
export FLASK_APP=man.py
-
Run File:
flask run