SimpleBank

A lightweight, easy-to-use banking system implementation with core banking functionalities, designed for learning and prototyping purposes. This project focuses on simplicity, clarity, and foundational banking logic without complex infrastructure dependencies.

🚀 Features

  • User Account Management: Create, retrieve, update, and delete bank accounts
  • Transaction Handling: Deposit, withdraw, and transfer funds between accounts
  • Balance Tracking: Real-time balance verification and transaction history
  • Basic Authentication: Secure access to user accounts (configurable)
  • Error Handling: Robust validation for invalid transactions (e.g., insufficient funds)
  • Data Persistence: Lightweight storage (configurable for in-memory/file/DB)
  • API Support: RESTful endpoints for integration (if applicable)

📋 Prerequisites

  • Go 1.20+ (or your project's runtime - adjust based on actual tech stack)
  • Git
  • Optional: Docker (for containerized deployment)
  • Optional: PostgreSQL/MySQL (if using persistent database)

💻 Installation

1. Clone the Repository

git clone https://github.com/Squidwa2d/simpleBank.git
cd simpleBank

2. Install Dependencies

# If using Go
go mod download

# If using other languages (e.g., Python)
# pip install -r requirements.txt

3. Configure (Optional)

Edit the config.yaml (or .env) file to set:

  • Database connection details (if using external DB)
  • Authentication secrets
  • Port/host for the API server

4. Run the Application

# For Go (example)
go run main.go

# Or build and run
go build -o simplebank
./simplebank

# Docker (if Dockerfile exists)
docker build -t simplebank .
docker run -p 8080:8080 simplebank

📖 Usage

Basic Workflow

  1. Create a new account with a unique user ID/email
  2. Deposit funds into the account
  3. Withdraw/transfer funds (with balance checks)
  4. View account balance and transaction history

Example API Requests (if applicable)

# Create Account
POST /api/accounts
{
  "user_id": "12345",
  "name": "John Doe",
  "initial_balance": 1000.00
}

# Deposit Funds
POST /api/accounts/12345/deposit
{
  "amount": 500.00
}

# Transfer Funds
POST /api/transfers
{
  "from_account_id": "12345",
  "to_account_id": "67890",
  "amount": 200.00
}

# Get Account Balance
GET /api/accounts/12345/balance

CLI Usage (if applicable)

# Create account
./simplebank create-account --user-id 12345 --name "John Doe" --initial 1000

# Check balance
./simplebank check-balance --user-id 12345

🧪 Testing

# Run unit tests
go test ./... -v

# Run integration tests (if applicable)
go test ./integration -v

📁 Project Structure

simpleBank/
├── cmd/                # Main application entry point
│   └── server/         # Server setup
├── internal/           # Core business logic
│   ├── account/        # Account management logic
│   ├── transaction/    # Transaction handling
│   └── storage/        # Data persistence layer
├── api/                # API handlers and routes
├── config/             # Configuration files
├── tests/              # Test files
├── Dockerfile          # Docker configuration
├── go.mod              # Go module file
└── README.md           # Project documentation

⚠️ Limitations & Notes

  • This is a learning/prototyping project - not production-ready
  • Security features (e.g., encryption, rate limiting) are minimal (extend as needed)
  • In-memory storage is default (switch to DB for persistence)
  • No multi-tenancy or advanced banking features (e.g., loans, interest)

🛠️ Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/your-feature)
  3. Commit your changes (git commit -m 'Add your feature')
  4. Push to the branch (git push origin feature/your-feature)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

Made with 💙 for learning backend development and banking system fundamentals