amirshnll / exchange

technical task - code challenge

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

exchange

this is a code challenge. (technical task)

Package Used list

Django==4.2
djangorestframework==3.14.0
django-environ==0.10.0
django-cors-headers==3.13.0
djangorestframework-recursive==0.1.2
djangorestframework-simplejwt==5.2.0
decorator==5.1.1
redis==4.5.4
gunicorn==20.1.0

env variables

SECRET_KEY=abcdefghijklmnopqrstuvwxyz
MINIMUM_PER_PURCHASE=10
DEBUG=true
ADMIN_ENABLED=true
REDIS_HOST=localhost
REDIS_DB=0
REDIS_PORT=6379
AUTH_PREFIX=Bearer
AUTH_HEADER_TYPES=Bearer

Test

  1. test all
python manage.py test
  1. user authentication
python manage.py test user.tests.UserTestCases.test_UserAuth
  1. user balance
python manage.py test balance.tests.BalanceTestCases.test_UserBalance
  1. user order
python manage.py test order.tests.OrderTestCases.test_UserOrder
python manage.py test order.tests.OrderTestCases.test_MultipleUserOrder

Run

  1. build project
docker-compose build
  1. start project
docker-compose up -d
  1. check health
curl http://localhost:8000/api/v1/healthcheck/
  1. import coin data from fixtures
python manage.py loaddata fixtures/*

endpoint documentation (postman)

Exchange.postman_collection.json

About

technical task - code challenge

License:MIT License


Languages

Language:Python 99.7%Language:Dockerfile 0.3%