Skip to content

CodeJam-by-CSE/University-Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Banking API - Coding Competition

A Flask-based REST API for a simple banking application.

Setup Instructions (Windows)

  1. Clone the repository
  2. Ensure you have Python 3.12 or above installed. You can check your Python version with:
python --version
  1. Create a virtual environment:
python -m venv venv
venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Initialize the database:
flask init-db
  1. Run the application:
flask run
  1. Open swagger UI:
http://localhost:5000/apidocs/

Testing

Run the test suite using pytest:

python -m pytest -v --disable-warnings

API Endpoints

API Endpoints

Authentication

  • POST /api/auth/register - Register a new user
  • POST /api/auth/login - Login and get JWT token
  • POST /api/auth/refresh - Refresh access token using refresh token
  • POST /api/auth/logout - Logout and revoke JWT token
  • POST /api/auth/verify - Verify if a token is valid and not expired
  • POST /api/auth/change-password - Change the user's password
  • GET /api/auth/profile - Get the authenticated user's profile

Admin

  • GET /api/auth/users - Retrieve a list of all users (Admin-only)
  • DELETE /api/auth/user/{user_id} - Delete a user by ID (Admin-only)

Accounts

  • GET /api/accounts - List all accounts for the authenticated user
  • POST /api/accounts - Create a new account
  • GET /api/accounts/{account_id} - Get details of a specific account
  • PUT /api/accounts/{account_id} - Update details of a specific account
  • DELETE /api/accounts/{account_id} - Delete a specific account
  • GET /api/accounts/{account_id}/transactions - Get transactions for a specific account

Transactions

  • GET /api/transactions - Get transaction history for all user accounts
  • GET /api/transactions/accounts/{account_id}/transactions - Get transactions for a specific account
  • POST /api/transactions/accounts/{account_id}/transactions - Create a transaction for a specific account
  • POST /api/transactions/deposit - Deposit funds into an account
  • POST /api/transactions/withdraw - Withdraw funds from an account
  • POST /api/transactions/transfer - Transfer funds between accounts
  • POST /api/transactions/transfer-advanced - Advanced transfer between accounts

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages