Loading repository data…
Loading repository data…
Hamza-cpp / repository
The Bank-IAV is a robust, scalable backend designed to power banking applications. Built with Flask and employing Flask-Migrate for database schema management, this API supports functionalities such as user registration, authentication, and handling banking transactions.
The Bank-IAV is a robust, scalable backend designed to power banking applications. Built with Flask and employing Flask-Migrate for database schema management, this API supports functionalities such as user registration, authentication, and handling banking transactions.
.gitignore: Keeps the repository clean by excluding unnecessary or sensitive files.Clone the Repository
git clone https://github.com/Hamza-cpp/Bank-IAV.git
cd Bank-IAV
Set Up a Virtual Environment and activate it
python3 -m venv .venv
source .venv/bin/activate
Install Dependencies
pip install -r requirements.txt
Install and Run PostgreSQL
Install PostgreSQL on your machine. You can download it from the official website: PostgreSQL Downloads.
Start the PostgreSQL server.
Note: Before proceeding to the next step, ensure that the PostgreSQL server is up and running on the default port(5432).
Initialize the Database and Apply Migrations
flask db upgrade head
This command applies the existing migrations to your database, setting up necessary tables.
Run the Application
python run.py
Note: Before running the application, make sure to create a .env file in the root directory of the project. You can use the .env.example file as a template and fill in the necessary configuration values.
Clone the Repository
git clone https://github.com/Hamza-cpp/Bank-IAV.git
cd Bank-IAV
Build and run the first Docker Compose Service (flask_db)
docker compose up flask_db
This will start the PostgreSQL database container defined in the docker-compose.yml file.
Build and run the second Docker Compose Service (flask_app)
docker compose up flask_app
This will start the flask application container defined in the docker-compose.yml file.
Note: Before running the application, make sure to create a .env file in the root directory of the project. You can use the .env.example file as a template and fill in the necessary configuration values.
Bank-IAV/
│
├── app/
│ ├── __init__.py # Initializes the application
│ ├── models/ # Contains all our SQLAlchemy models
│ │ ├── __init__.py # Makes models a package
│ │ ├── user.py # User model
│ │ ├── account.py # Account model
│ │ ├──transaction.py # Transaction model
│ │ └── ...
│ │
│ ├── services/ # Business logic layer
│ │ ├── __init__.py # Makes services a package
│ │ ├── auth_service.py # Authentication related operations
│ │ ├── user_service.py # User management operations
│ │ ├── account_service.py # Account related operations
│ │ └── ...
│ │
│ ├── api/ # RESTful API endpoints
│ │ ├── __init__.py # Makes api a package
│ │ ├── errors.py # Error handlers for API
│ │ ├── auth.py # Authentication endpoints
│ │ ├── user.py # User endpoints
│ │ ├── account.py # Account endpoints
│ │ └── ...
│ │
│ └── utils/ # Utility functions
│ ├── __init__.py # Makes utils a package
│ ├── validators.py # Request data validation functions
│ └── helpers.py # Miscellaneous helper functions
│
├── migrations/ # Database migrations
│ ├── versions/ # Individual migration scripts
│ └── ...
├── tests/ # Test suite
│
├── .gitignore # Specifies intentionally untracked files to ignore
├── config.py # Configuration settings
├── run.py # Entry point to run the application
├── requirements.txt # Project dependencies
└── README.md # Project documentation (this file)
After running the application, you can interact with it using HTTP requests. For example:
Register a New User
curl -X POST -H "Content-Type: application/json" -d '{"username":"john_doe", "email":"john@example.com", "password":"123456"}' http://127.0.0.1:5000/api/v1/auth/register
We welcome contributions to the Bank-IAV! If you have suggestions for improvement or want to contribute to the codebase, please feel free to fork the repository and submit a pull request.