Banky is a Django-powered budgeting and current-account API designed to help teams prototype financial workflows such as deposits, withdrawals, and balance limits. The project exposes a REST API backed by Django REST Framework and includes auto-generated documentation via drf-spectacular.
- Features
- Project structure
- Requirements
- Quick start
- Running the tests
- API documentation
- Management commands
- Static assets
- Account lifecycle operations with strict limits on deposits, withdrawals, and aggregated balances.
- Server-side validation for invalid amounts, exceeded limits, and insufficient funds.
- Token, session, and basic authentication out of the box via Django REST Framework.
- Interactive API documentation powered by drf-spectacular (Swagger UI and ReDoc).
- Production-friendly defaults including WhiteNoise for static files, CORS headers, and security-focused settings sourced from environment variables.
banky/
├── api/ # REST API application (models, views, serializers, errors, custom commands)
├── config/ # Django settings, URL routing, and WSGI entrypoint
├── docs/ # Design references and research notes
├── static/ & templates/ # Front-end assets served by Django
├── tests/ # Django test cases for the account domain
├── manage.py # Django management utility
└── swagger_.png # Screenshot of the generated Swagger UI
- Python 3.13 (see
runtime.txt) pip23.0+- SQLite (bundled with Python) or another Django-supported database
All configuration values (e.g., SECRET_KEY, DEBUG, and ALLOWED_HOSTS) are loaded through python-decouple. Create a .env file at the project root or export the variables in your shell before running the application.
# Clone the repository
$ git clone https://github.com/delitamakanda/banky.git
$ cd banky
# (Optional) create and activate a virtual environment
$ python3 -m venv .venv
$ source .venv/bin/activate
# Install dependencies
(.venv) $ python -m pip install --upgrade pip
(.venv) $ pip install -r requirements.txt(.venv) $ python manage.py migrateYou can create a superuser manually:
(.venv) $ python manage.py createsuperuserAlternatively, run the bundled helper which generates credentials when none exist:
(.venv) $ python manage.py makesuperuser(.venv) $ python manage.py runserverThe site will be available at http://127.0.0.1:8000/.
Use Django's test runner to execute the suite located in the tests/ package:
(.venv) $ python manage.py testOnce the server is running you can explore the API contract through the automatically generated UIs:
- Swagger UI:
/swagger/ - ReDoc:
/redoc/ - Raw OpenAPI schema:
/swagger/schema/
A preview of the Swagger documentation is included below.
In addition to the default Django commands, the project ships with:
makesuperuser– creates a superuser with a random password when none exist.
List the available commands with python manage.py help.
Static files are collected into staticfiles/ via WhiteNoise. To rebuild assets for deployment run:
(.venv) $ python manage.py collectstaticThis command is typically executed automatically by hosting providers such as Heroku or Render when deploying the application.