This project simulate a virtual wallet to use Django atomic transactions.
Staff users could do almost any type of action while regular users only could do things with their own wallets.
Only superusers could change wallet balance.
- docker engine >= 19.03.
- docker-compose >= 1.27.
- Ubuntu 18.04 (Bionic).
- docker engine == 20.10.9.
- docker-compose == 1.28.4.
If you can run a Makefile command, you can use a "fast init" with: make loaddata.
Build docker image:
make buildApply django migrations:
make migrateRun django runserver command:
make devRun uvicorn server:
make uvicornApply initial_data.json fixture. This action will erase all previous data:
make loaddatamake testsdocker-compose -p django_atomic_transactions -f environment/docker-compose.yml buildApply django migrations:
docker-compose -p django_atomic_transactions -f environment/docker-compose.yml run --rm --service-ports web migrate- Runserver
Run django runserver command:
docker-compose -p django_atomic_transactions -f environment/docker-compose.yml run --rm --service-ports web dev- Uvicorn
Run uvicorn server:
docker-compose -p django_atomic_transactions -f environment/docker-compose.yml run --rm --service-ports web uvicornApply initial_data.json fixture. This action will erase all previous data:
docker-compose -p django_atomic_transactions -f environment/docker-compose.yml run --rm --service-ports web loaddatadocker-compose -p django_atomic_transactions -f environment/docker-compose.yml run --rm --service-ports web python manage.py test --failfast apiSometimes when try to migrate it gets an error message like that. The IP is an example:
Is the server running on host "db" (<192.168.1.25>) and accepting
TCP/IP connections on port 5432?When web is up and running and db is not ready yet, we could have this type of error.
In this situation try to execute it again.
- Auto create a transaction error on atomic
IntegrityError. - Use
amountfloat instead of decimal because of performance. We only use two decimals and 5 digits, precision should not be a problem with float. Example article. - Add
flake8to testing stage. - Create a view using django templates and css grid to show
GetNumClientAccounts. - Create a business flow:
- Create business account.
- Create business wallet.
- Create business transactions.
- Allow business to manage their our client accounts.
- Enable django admin login with created users.
- Enable django password validations on user creation.
- Finish Dockerfile production stage.
- Improve
pg_readyin containerhealthcheck.
...
Are you here yet? OK, nice one. I should invite you to a cup of coffee. Just give me your wallet username and password to get in touch hehehe (yep, a simple joke).