Code provide "Home Banking solution" as a service that runs in a docker container.
There are total 3 services/entites
- Customer service will let you perform create/retrieve/update & delete customer
- Account service will let you perform create/retrieve/update & delete customer's account
- Credit Tranfer service will let you perform initiate payments and retrieve/update/delete existing payments
- Django Rest Framework for writing Rest API
- PyCharm for code development
- In build sqllite database for storing data
- pip for dependency management
- Docker for containring the solution
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment notes on how to deploy the project in your system
Docker machine should be up and running. Docker compose should be installed
- In Conatiner
- git clone https://Manishmbm2010@bitbucket.org/Manishmbm2010/home_banking_service_django_poc.git
- cd home_banking_service_django_poc/
- sudo docker-compose -f docker-compose-test.yml up --build
- Without Conatiner
- git clone https://Manishmbm2010@bitbucket.org/Manishmbm2010/home_banking_service_django_poc.git
- cd home_banking_service_django_poc/
- pip install -r requirements.txt
- python manage.py makemigrations customer
- python manage.py makemigrations account
- python manage.py makemigrations payments
- python manage.py migrate
- python manage.py test
- python manage.py shell
- from django.contrib.auth.models import User
- User.objects.get(username="admin", is_superuser=True).delete()
- In Conatiner
- git clone https://Manishmbm2010@bitbucket.org/Manishmbm2010/home_banking_service_django_poc.git
- cd home_banking_service_django_poc/
- sudo docker-compose -f docker-compose.yml up --build
- Without Conatiner
- git clone https://Manishmbm2010@bitbucket.org/Manishmbm2010/home_banking_service_django_poc.git
- cd home_banking_service_django_poc/
- pip install -r requirements.txt
- python manage.py makemigrations customer
- python manage.py makemigrations account
- python manage.py makemigrations payments
- python manage.py migrate
- python manage.py runserver
- user : admin
- pass : password
-
http://localhost:8000/customer/create (method=POST)
-
request body : {"first_name":"Test_manish" ,"last_name":"Jain", "address":"Jain Temple","birth_date":"1993-10-28"}
-
http://localhost:8000/customer/{id} (method=GET)
-
http://localhost:8000/customer/{id} (method=PUT)
-
request body : {"first_name":"Test_manish" ,"last_name":"Jain", "address":"Jain Temple","birth_date":"2000-10-28"}
-
http://localhost:8000/customer/{id} (method=DELETE)
-
http://localhost:8000/account/create (method=POST)
-
request body : {"customer_id":"1" ,"acc_type":"Credit_Card","acc_balance":"34.5"}
-
http://localhost:8000/account/{id} (method=GET)
-
http://localhost:8000/account/{id} (method=PUT)
-
request body : {"customer_id":"1", "acc_type":"Credit_Card","acc_balance":"50"}
-
http://localhost:8000/account/{id} (method=DELETE)
-
http://localhost:8000/account/getCustomerAccount/{customer_id}(method=GET)
-
http://localhost:8000/payment/create (method=POST)
-
request body : {"originator_customer_id":1 ,"originator_acc_number":1, "transfer_amount":20,"beneficary_acc_number":5}
-
http://localhost:8000/payment/{id} (method=GET)
-
http://localhost:8000/payment/{id} (method=PUT)
-
request body : {"originator_customer_id":1 ,"originator_acc_number":1, "transfer_amount":30,"beneficary_acc_number":20}
-
http://localhost:8000/payment/{id} (method=DELETE)
Django has good documentation
- This solution can be extended with the usage of persistent storage.
- Exception handling can be improved.
- Logging can be enhanced.
- Comments can be added at many places to make the maintenace of code much simpler.
##Author
- Manish Jain