VirtualBank is a containerized application simulating a virtual banking system. It includes backend services for user management, bank accounts, and transactions, all powered by PostgreSQL. The frontend is currently being built using React, and the project is designed for testing, learning, and potential deployment on Google Cloud Platform (GCP).
- Overview
- Features
- Technologies Used
- Setup and Installation
- Usage
- Architecture
- API Documentation
- Contributing
- License
VirtualBank is a Flask-based banking simulation project using Docker for containerization and PostgreSQL as its database. It offers basic banking functionalities like:
- User management
- Account creation
- Transactions handling
The frontend is being built with React, and future plans include hosting the entire system on Google Cloud Platform (GCP).
- User Management: Secure user registration and login.
- Bank Accounts: Create and manage bank accounts with encrypted account numbers.
- Transactions: Simulate transfers between accounts.
- Logging and Security: Includes token authentication and logging middleware.
- Extensibility: Designed for scalability and future cloud deployment.
- Frontend: React (under development)
- Backend: Python, Flask
- Database: PostgreSQL
- Containerization: Docker, Docker Compose
- Security: JWT for authentication, encryption for sensitive data
- Cloud Deployment: Planned for Google Cloud Platform (GCP)
- Docker and Docker Compose installed
- Python 3.x (optional for local development)
-
Clone the repository:
git clone https://github.com/roisol144/VirtualBank.git cd VirtualBank
-
Set up environment variables:
- Create a
.env
file in the root directory:DATABASE_URL=postgresql://<user>:<password>@db:5432/<dbname> SECRET_KEY=<your-secret-key>
- Create a
-
Build and run the Docker containers:
docker compose up --build
-
Access the application:
- Backend:
http://localhost:8000
- PostgreSQL:
localhost:5433
(use a database client)
- Backend:
(Optional, if tests are implemented)
pytest
Endpoint | Method | Description |
---|---|---|
/register |
POST | Register a new user |
/login |
POST | Login and get a token |
/accounts |
GET | List user accounts |
Below is the architecture diagram of the VirtualBank system, showcasing the interactions between components:
- Frontend: React application (in development) that interacts with the backend via RESTful APIs.
- Backend (Flask): Handles API requests, user management, and account-related operations.
- Database (PostgreSQL): Stores data for users, accounts, and transactions.
- Docker: Manages the backend and database as separate containers for easy deployment and scaling.
(Detailed endpoint documentation can go here or link to a separate file, e.g., API.md
.)
- Example for
/register
:POST /register Content-Type: application/json { "first_name": "John", "last_name": "Doe", "email": "[email protected]", "password": "securepassword" }
I welcome contributions! Here's how you can get involved:
- Fork the repository.
- Create a feature branch (
git checkout -b feature-name
). - Commit your changes (
git commit -m "Description"
). - Push to your fork (
git push origin feature-name
). - Open a pull request.
This Project MIT Licensed.