{"id":22482137,"url":"https://github.com/hamza-cpp/bank-iav","last_synced_at":"2025-03-27T19:18:37.794Z","repository":{"id":223555329,"uuid":"760704826","full_name":"Hamza-cpp/Bank-IAV","owner":"Hamza-cpp","description":"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.","archived":false,"fork":false,"pushed_at":"2024-03-18T02:28:30.000Z","size":63,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-01T22:12:22.821Z","etag":null,"topics":["backend","flask","python","python3","rest-api","solid-principles","sqlalchemy","webapp"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Hamza-cpp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-02-20T19:32:06.000Z","updated_at":"2024-02-23T15:53:05.000Z","dependencies_parsed_at":"2024-03-17T22:51:32.560Z","dependency_job_id":null,"html_url":"https://github.com/Hamza-cpp/Bank-IAV","commit_stats":null,"previous_names":["hamza-cpp/bank-iav"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hamza-cpp%2FBank-IAV","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hamza-cpp%2FBank-IAV/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hamza-cpp%2FBank-IAV/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hamza-cpp%2FBank-IAV/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Hamza-cpp","download_url":"https://codeload.github.com/Hamza-cpp/Bank-IAV/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245907557,"owners_count":20691956,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backend","flask","python","python3","rest-api","solid-principles","sqlalchemy","webapp"],"created_at":"2024-12-06T16:19:34.026Z","updated_at":"2025-03-27T19:18:37.759Z","avatar_url":"https://github.com/Hamza-cpp.png","language":"Python","readme":"# Bank IAV API\n\nThe **`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.\n\n## **Features**\n\n- **User Registration and Authentication**: Secure signup and login capabilities.\n- **Database Version Control**: Utilizes Flask-Migrate for handling database migrations, ensuring consistency across environments.\n- **Modular Design**: Structured for scalability with clear separation of concerns (models, controllers, api, services).\n- **Comprehensive `.gitignore`**: Keeps the repository clean by excluding unnecessary or sensitive files.\n\n## **Getting Started**\n\n### **Prerequisites**\n\n- **Python (3.10):** The programming language.\n- **Flask (3.0.2)**: Serves as the foundational web framework for building the **Bank-IAV API**. Flask is lightweight and modular, making it a good choice for building scalable applications.\n- **Flask-Migrate (4.0.5)**: Utilized for handling database migrations. This is crucial in a banking application where the data model may evolve over time, requiring changes to the database schema without loss of data.\n- **Flask-SQLAlchemy (3.1.1)**: Offers an ORM layer for interacting with the database, simplifying database transactions and queries.\n- **Flask-JWT-Extended (4.6.0)**: Adds support for JWT-based authentication, ensuring secure user authentication and session management.\n- **psycopg2-binary (2.9.9)**: Provides PostgreSQL database connectivity, a reliable and powerful database choice for financial applications where transactions and data integrity are critical.\n- **python-dotenv (1.0.1)**: Manages environment variables, helping in configuring the application in different environments (development, testing, production) without hard-coding configuration values.\n- **SQLite** (for local development)\n- **PostgresSQL** (for production)\n\n### **Installation and running locally**\n\n1. **Clone the Repository**\n\n    ```bash\n    git clone https://github.com/Hamza-cpp/Bank-IAV.git\n    cd Bank-IAV\n    ```\n\n2. **Set Up a Virtual Environment and activate it**\n\n    ```bash\n    python3 -m venv .venv\n    source .venv/bin/activate \n    ```\n\n3. **Install Dependencies**\n\n    ```bash\n    pip install -r requirements.txt\n    ```\n\n4. **Install and Run PostgreSQL**\n\n    - Install PostgreSQL on your machine. You can download it from the official website: [PostgreSQL Downloads](https://www.postgresql.org/download/).\n\n    - Start the PostgreSQL server.\n\n    \u003e **Note:** Before proceeding to the next step, ensure that the PostgreSQL server is up and running on the default port(5432).\n\n5. **Initialize the Database and Apply Migrations**\n\n    ```bash\n    flask db upgrade head\n    ```\n\n    This command applies the existing migrations to your database, setting up necessary tables.\n\n6. **Run the Application**\n\n    ```bash\n    python run.py\n    ```\n\n**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.\n\n### **Installation and Running with Docker**\n\n 1. **Clone the Repository**\n\n     ```bash\n     git clone https://github.com/Hamza-cpp/Bank-IAV.git\n     cd Bank-IAV\n     ```\n\n 2. **Build and run the first Docker Compose Service (flask_db)**\n\n     ```bash\n     docker compose up flask_db\n     ```\n\n    This will start the PostgreSQL database container defined in the `docker-compose.yml` file.\n 3. **Build and run the second Docker Compose Service (flask_app)**\n\n     ```bash\n     docker compose up flask_app\n     ```\n\n    This will start the flask application container defined in the `docker-compose.yml` file.\n\n**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.\n\n### **Project Structure**\n\n```bash\n\nBank-IAV/\n│\n├── app/\n│   ├── __init__.py                # Initializes the application\n│   ├── models/                    # Contains all our SQLAlchemy models\n│   │   ├── __init__.py            # Makes models a package\n│   │   ├── user.py                # User model\n│   │   ├── account.py             # Account model\n│   │   ├──transaction.py          # Transaction model\n│   │   └── ...\n│   │\n│   ├── services/                  # Business logic layer\n│   │   ├── __init__.py            # Makes services a package\n│   │   ├── auth_service.py        # Authentication related operations\n│   │   ├── user_service.py        # User management operations\n│   │   ├── account_service.py     # Account related operations\n│   │   └── ...\n│   │\n│   ├── api/                       # RESTful API endpoints\n│   │   ├── __init__.py            # Makes api a package\n│   │   ├── errors.py              # Error handlers for API\n│   │   ├── auth.py                # Authentication endpoints\n│   │   ├── user.py                # User endpoints\n│   │   ├── account.py             # Account endpoints\n│   │   └── ...\n│   │\n│   └── utils/                     # Utility functions\n│       ├── __init__.py            # Makes utils a package\n│       ├── validators.py          # Request data validation functions\n│       └── helpers.py             # Miscellaneous helper functions\n│ \n├── migrations/                    # Database migrations\n│   ├── versions/                  # Individual migration scripts\n│   └── ...\n├── tests/                         # Test suite\n│\n├── .gitignore                     # Specifies intentionally untracked files to ignore\n├── config.py                      # Configuration settings\n├── run.py                         # Entry point to run the application\n├── requirements.txt               # Project dependencies\n└── README.md                      # Project documentation (this file)\n```\n\n### **Usage**\n\nAfter running the application, you can interact with it using HTTP requests. For example:\n\n- **Register a New User**\n\n    ```bash\n    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\n    ```\n\n## **Contributing**\n\nWe 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.\n\n## **Acknowledgments**\n\n- Flask for providing a lightweight and powerful web framework.\n- Flask-Migrate for making database migrations easy to manage.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhamza-cpp%2Fbank-iav","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhamza-cpp%2Fbank-iav","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhamza-cpp%2Fbank-iav/lists"}