Skip to content

asadullahbro/SimpleBanking

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SimpleBanking

A modern, secure banking web app built with FastAPI + Vanilla JavaScript, wrapped in smooth glassmorphism goodness and backed by real security features. Think mini bank in your browser. Yes, it slaps.


🚀 Tech Stack

SimpleBanking FastAPI Python JavaScript Security


✨ Features

🔐 User Features

  • JWT Login and Signup
  • Strong password rules
  • Optional 2FA (TOTP)
  • Check balance
  • Deposit / Withdraw / Transfer
  • Transaction history
  • Change password

⚙️ Admin Features

  • Dashboard with live stats
  • Manage users
  • Monitor transactions
  • Security logs & config
  • Admin account management

🎨 UI Features

  • Glassmorphism + gradients
  • Responsive
  • Smooth modals
  • Live updates

🧩 Project Structure

simplebanking/
├── app/
│   ├── main.py
|   ├── requirements.txt
│   ├── simple_banking.db
│   ├── static/
│   │   ├── login.css
│   │   ├── login.js
│   │   ├── signup.js
|   |   ├── signup.css
│   │   ├── index.css
│   │   ├── index.js
│   │   ├── admin-panel.css
│   │   ├── admin-panel.js
│   │   ├── admin-login.css
│   │   └── admin-login.js
│   └── templates/
│       ├── index.html
│       ├── login.html
│       ├── signup.html
│       ├── admin-login.html
│       └── admin-panel.html
├── README.md
└── .env.example

🔒 Security Features

  • Password Hashing: bcrypt for secure password storage

  • JWT Tokens: Secure authentication with expiration (30 minutes)

  • Account Lockout: Automatic lockout after multiple failed attempts

  • 2FA Support: Optional Time-based One-Time Passwords via authenticator apps

  • SQL Injection Prevention: Parameterized queries throughout

  • CORS Protection: Configured for security

  • Input Validation: Comprehensive data validation on all endpoints

  • Session Management: Secure token-based sessions

  • Password Complexity: Enforced strong passwords

  • Admin-only Endpoints: Protected routes for administrative functions

🛠️ API Endpoints

User Endpoints

GET / - Home page

GET /login - Login page

GET /signup - Signup page

POST /signup - Register new user

POST /token - User login

POST /token_2fa - 2FA verification

GET /balance - Get account balance

POST /deposit - Deposit funds

POST /withdraw - Withdraw funds

POST /transfer - Transfer to another account

GET /transactions - View transaction history

GET /users/me - Get current user info

POST /enable_2fa - Enable 2FA

POST /setup_2fa - Complete 2FA setup

POST /disable_2fa - Disable 2FA

POST /change_password - Change password

GET /2fa/status - Check 2FA status

GET /health - Health check endpoint

Admin Endpoints

GET /admin/login - Admin login page

POST /admin/login - Admin authentication

GET /admin/dashboard - Dashboard statistics

GET /admin/users - List all users

GET /admin/users/recent - Get recent users

GET /admin/users/{user_id} - Get user details

POST /admin/users/{user_id}/lock - Lock/unlock user

POST /admin/users/{user_id}/reset-password - Reset user password

GET /admin/transactions - View all transactions

GET /admin/transactions/recent - Get recent transactions

POST /admin/transactions/{tx_id}/flag - Flag/unflag transaction

GET /admin/security/logs - Security audit logs

GET /admin/settings - Get system settings

POST /admin/settings - Update system settings

POST /admin/logs/clear - Clear old logs

POST /admin/sessions/lock-all - Invalidate all sessions

POST /admin/system/reset-test - Reset test data

POST /admin/admin/create - Create new admin (superadmin only)

GET /admin/admin/list - List all admins

🐛 Troubleshooting

Common Issues

  1. Port already in use
    # Kill process on port 8000
    # Windows
    netstat -ano | findstr :8000
    taskkill /PID <PID> /F
    
    # Mac/Linux
    lsof -ti:8000 | xargs kill -9
  2. Database errors
    # Delete and recreate database
    rm simple_banking.db
    python main.py
  3. Missing dependencies
    pip install -r requirements.txt --upgrade
  4. Environment variables not loading
    # Make sure .env file exists in app/ directory
    # Check file contains valid key-value pairs

🙏 Acknowledgments

This project stands on the shoulders of incredible open-source projects and tools. Special thanks to:

🐍 Core Technologies

  • FastAPI - For the lightning-fast, modern web framework that made this project possible
  • Uvicorn - For the ASGI server that powers our async Python backend
  • SQLite - For the lightweight, file-based database that keeps our data persistent
  • Python - For being the versatile language that ties everything together

🔒 Security & Authentication

  • Passlib - For secure password hashing with bcrypt
  • Python-JOSE - For JWT token implementation and validation
  • PyOTP - For two-factor authentication implementation
  • Cryptography - For underlying cryptographic functions

🎨 UI & Design

🛠️ Development Tools

📖 Quote of Inspiration

"The only way to learn a new programming language is by writing programs in it."
– Dennis Ritchie, Creator of C


Made with ❤️ and ☕ by Asadullah

"If you want to go fast, go alone. If you want to go far, go together." – African Proverb EOF

About

Modern banking app with FastAPI backend. Features user accounts, transactions, 2FA, admin dashboard, and glassmorphism design. Secure and responsive.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages