Digital Wallet | Fintech Dashboard Application
π³ Digital Wallet Dashboard
A fullStack fintech wallet application built with Django, HTMX, Celery, Redis, and PostgreSQL oriented settings. The project is designed around strict portal separation, secure wallet operations, fraud review workflows, async PDF statements, and staff analytics.
π Overview
Digital Wallet Dashboard is a multi portal financial operations project with:
- a client portal for wallet usage
- a staff portal for fraud review and operational oversight
- a custom email-based authentication system
- atomic wallet services to protect balances and transaction consistency
- async statement generation for downloadable PDF reports
- analytics dashboards for internal operational visibility
The application itself is complete enough for local use and verification. Deployment is intentionally not completed at this stage to save time and cost.
β¨ What The Project Includes
Client Features
- Email based registration and login
- Wallet dashboard with live balance and recent transactions
- Secure deposit, withdrawal, and transfer flows
- Infinite scroll transaction history
- Profile page and account security page
- Password reset flow
- Password change flow with Django validation
- PDF statement request and download flow
Staff Features
- Staff only operations dashboard
- Review queue for flagged transactions
- Approve or reject suspicious transfers
- Automatic reversal on rejected flagged transfers
- Wallet freeze and unfreeze actions
- Analytics dashboard with Chart.js visualizations
Security & Integrity Features
- Dual portal separation between client and staff access
- Custom
CustomUsermodel withSTAFFandCLIENTuser types StaffOnlyMixinandClientOnlyMixinaccess control- Atomic balance updates using service layer logic
- Fraud detection for large or high frequency transfers
- Session aware security page showing current session metadata
- Password validation using Django auth validators
- Custom 403 handling with role aware redirects
π§© Core Modules
| App | Purpose |
|---|---|
accounts |
Authentication, custom user model, profiles, password reset, security/profile pages |
wallet |
Wallet model, transactions, dashboard, deposits, withdrawals, transfers, statements |
operations |
Staff dashboard, fraud review, wallet freeze/unfreeze |
analytics |
Staff analytics dashboards and Chart.js data endpoints |
core |
Settings, root URLs, environment configuration, Celery bootstrap |
π οΈ Tech Stack
| Layer | Technology |
|---|---|
| Backend | Python 3.12, Django 5.2 |
| Database | SQLite for local development, PostgreSQL ready configuration for production |
| Frontend | Django Templates, HTMX, custom modular CSS, Vanilla JavaScript |
| Auth | Custom email-based CustomUser |
| Async | Celery, Redis |
| Reporting | ReportLab PDF generation |
| Analytics | Chart.js |
| Testing | Pytest, pytest-django, pytest-cov |
| Code Quality | pre-commit, black, flake8, isort |
πΊοΈ Application Routes
| Area | Path |
|---|---|
| Role-aware home redirect | / |
| Django admin | /admin/ |
| Accounts | /accounts/ |
| Client wallet portal | /dashboard/ |
| Staff portal | /staff/ |
| Analytics | /analytics/ |
Important Endpoints
/accounts/login//accounts/register//accounts/profile//accounts/security//dashboard//dashboard/deposit//dashboard/withdraw//dashboard/transfer//dashboard/transactions//dashboard/statement/request//staff/dashboard//analytics/dashboard/
π Local Development Setup
Prerequisites
- Python
3.12 - Redis
- virtual environment support
Option 1: Use The Project Setup Script
source .env_digital_wallet/bin/activate
./scripts/setup.sh
Option 2: Manual Setup
python -m venv .env_digital_wallet
source .env_digital_wallet/bin/activate
pip install -r requirements.txt
pip install -r requirements-dev.txt
cp .env.example .env
pre-commit install
python manage.py migrate --settings=core.settings.dev
python manage.py createsuperuser --settings=core.settings.dev
python manage.py runserver 8500 --settings=core.settings.dev
Environment Variables
The project reads configuration from .env. Start by copying:
cp .env.example .env
Main variables:
SECRET_KEYDEBUGALLOWED_HOSTSDATABASE_URLCELERY_BROKER_URLCELERY_RESULT_BACKEND- optional email settings for password reset workflows
By default:
- local development uses
SQLite - Celery expects Redis at
redis://localhost:6379/0 - email uses Django console backend in
core.settings.dev
βΆοΈ Running The Project
Web App
source .env_digital_wallet/bin/activate
python manage.py runserver 8500 --settings=core.settings.dev
Open:
http://127.0.0.1:8500/
Redis
redis-server
Celery Worker
Required for async statement generation:
source .env_digital_wallet/bin/activate
celery -A core worker -l info
If Redis/Celery are not running, the main application still works, but async PDF statement generation will not complete.
π Default Development Flow
- Create or activate
.env_digital_wallet - Update
.env - Run migrations
- Create a superuser
- Start Django on port
8500 - Start Redis and Celery if you want statement generation
- Run tests before committing
β Testing & Quality
Run All Tests
pytest
Run By App
pytest accounts/tests/ -v
pytest wallet/tests/ -v
pytest operations/tests/ -v
pytest analytics/tests/ -v
pytest core/tests/ -v
Coverage
pytest --cov
Django System Check
python manage.py check --settings=core.settings.dev
Formatting & Linting
pre-commit run --all-files
black .
flake8
isort .
π Project Structure
DigitalWallet/
βββ accounts/ # Authentication, user model, profiles, security views
βββ analytics/ # Staff analytics dashboard and chart endpoints
βββ core/ # Settings, root URLs, Celery app bootstrap
βββ operations/ # Staff dashboard and fraud review tools
βββ scripts/ # Setup, git workflow, manual helper scripts
βββ static/ # CSS, JS, frontend assets
βββ templates/ # Base templates, snippets, account/wallet/staff pages
βββ wallet/ # Wallet models, services, views, PDF tasks
βββ .env.example # Example environment configuration
βββ manage.py
βββ requirements.txt
βββ requirements-dev.txt
π Business Rules & Technical Notes
Wallet Operations
- deposits, withdrawals, and transfers are handled through service-layer functions
- transfers isolate funds during fraud review to prevent double-spending problems
- rejected flagged transfers automatically reverse funds back to the sender
Fraud Review
The fraud engine currently flags suspicious transfers based on rules such as:
- transfer amounts above the configured high-risk threshold
- unusually high transaction frequency
Flagged transfers are routed to the staff dashboard for manual review.
Statements
- statements are generated asynchronously
- progress is exposed through task status polling
- completed statements can be downloaded after ownership verification
Portal Separation
- superusers are directed to Django admin
- staff users are directed to the staff dashboard
- client users are directed to the wallet dashboard
- unauthorized cross-portal access returns a custom 403 experience
πΏ Git Workflow Used In This Repository
This project uses helper scripts for phase-oriented workflow:
scripts/git-phase-commit.shscripts/git-phase-merge.sh
Role-based commit identities supported by the commit script:
devβ Qwen-Coderconsultβ Gemini-CLIreviewβ OpenAI-Codexmgrβ Ahmad
Example:
./scripts/git-phase-commit.sh 8 "Title" "Description" review
π€ AI Collaboration Model
This repository documents a multi-agent workflow in Constitution_Digital_Wallet.md.
Primary roles:
- Ahmad: manager and final approver
- Qwen: implementation-focused developer AI
- Gem: consultant AI for architecture and planning
- Cod: reviewer AI for regression detection, verification, and support fixes
All AI-generated work is still expected to follow the same branch, testing, and approval rules as any other contribution.
π Current Status
Complete
- application architecture
- authentication and portal separation
- wallet engine and transaction workflows
- HTMX dashboard behavior
- fraud review tooling
- analytics
- async PDF statement generation
- local development workflow
- automated tests and quality tooling
Intentionally Not Finished
- production deployment
- paid hosting rollout
- final infrastructure spend
This repository can still serve as a strong local demonstration, portfolio project, and reference implementation for secure Django wallet workflows.
π¬ Recommended Demo Flow
If you want to present the project locally, the fastest path is:
- Run migrations and create a superuser
- Start Django on port
8500 - Start Redis and Celery
- Create a client account
- Demonstrate deposit, withdrawal, transfer, and transaction history
- Trigger a flagged transfer
- Review it from the staff dashboard
- Open analytics
- Request and download a PDF statement
π Documentation References
- Constitution_Digital_Wallet.md
- .env.example
- scripts/setup.sh
- scripts/git-phase-commit.sh
- scripts/git-phase-merge.sh
π License
This repository is licensed under the terms of the included LICENSE.