A web application for managing virtual wallets: creating, depositing, withdrawing funds, and checking balances. Implemented in Django with a REST API and a UI interface.
- ✅ Create a new wallet
- 💰 Deposit or withdraw funds
- 📊 View current balance by UUID
- 🌐 API documentation (Swagger, ReDoc)
- 🧪 Test coverage using
pytest - 🐳 Docker and docker-compose support
- 🎨 UI built with Django templates and Bootstrap 5
git clone https://github.com/Kari230996/wallet_project.git
cd wallet_project- Before starting, rename
.env.exampleto.env - Open
.envand replaceSECRET_KEYwith your own:
SECRET_KEY=django-insecure-replace-with-unique-key- Generate a new key (Windows example):
python -c "from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())"- Start the project:
docker-compose up --builddocker-compose exec web python manage.py migratedocker-compose exec web python manage.py createsuperuser- Swagger: http://localhost:8000/swagger/
- ReDoc: http://localhost:8000/redoc/
/api/v1/.
Example request: POST http://localhost:8000/api/v1/wallets/
docker-compose exec web pytest| Test | What it checks |
|---|---|
test_wallet_create |
Wallet creation, UUID format, initial balance |
test_wallet_balance_success |
Get balance of existing wallet |
test_wallet_balance_not_found |
Response for non-existent UUID |
test_wallet_operation_deposit |
Successful deposit |
test_wallet_operation_withdraw_success |
Successful withdrawal |
test_wallet_operation_withdraw_insufficient_funds |
Error when withdrawing more than available |
Main UI page: http://localhost:8000/wallets-ui/
wallet_project/
├── wallets/ # Core API app
├── wallet_ui/ # UI app with templates
├── config/ # Django settings
├── templates/ # HTML templates
├── tests/ # Pytest tests
├── docker-compose.yml
...
- Python 3.11
- Django 5.x
- Django REST Framework
- PostgreSQL
- Bootstrap 5
- Docker, docker-compose
- Pytest + pytest-django
- drf-yasg (Swagger)
Developer: karina.apaeva96@gmail.com