Thank you for using the coin match api. This api can be used to compare prices for various cryptocurrencies across several platforms for the purposes of price analysis, research, and logging. Coin match can also be used to compare one exchange to another, and display whatever currencies are available on those exchanges.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
What things you need to install the software and how to install them
python3+
virtualenv
pip
A step by step series of examples that tell you how to get a development env running
Clone the respository to your local environment
git clone https://github.com/htmercury/coin_match_api.git
Move into the git directory
cd coin_match_api
Initialize a virtual environment
virtualenv djangoPy3Env
Activate the virtual environment
Windows: call djangoPy3Env/Scripts/activat
Mac/Linux: source djangoPy3Env/bin/activate
Install the required packages
pip install -r requirements.txt
Move into the project directory
cd coin_match
Start the django server
python manage.py runserver
Final Output:
Performing system checks...
System check identified no issues (0 silenced).
July 26, 2018 - 14:43:49
Django version 1.10, using settings 'coin_match.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
In the project folder coin_match_api/coin_match
,
run python manage.py test
to run the given unit tests
Two Categories of Unit Tests
These tests if the model is functioning correctly by checking if objects can be created and deleted. Example:
def test_model_can_create_an_exchange(self):
"""Test the exchange model can create an exchange"""
old_count = Exchange.objects.count()
self.exchange.save()
new_count = Exchange.objects.count()
self.assertNotEqual(old_count, new_count)
This test checks if a new exchange object can be instantiated in the database.
These tests if the API responds to different REST methods made to the API endpoints.
def test_api_can_update_an_exchange(self):
"""Test api can delete a given exchange"""
exchange = Exchange.objects.get(id=1)
change_exchange = {
"name": "apples",
"owner": "admin",
"buy_fee": "0.25%",
"sell_fee": "0.16%",
"desc": "good stuff",
"products": [1],
"created_at": "2018-07-24T16:43:16.699539Z",
"updated_at": "2018-07-24T17:14:27.916056Z",
"past_trades": []
}
url = '/exchange/' + str(exchange.id)
res = self.client.put(
url,
change_exchange
)
self.assertEqual(res.status_code, status.HTTP_200_OK)
This test checks if the API can update an existing exchange that was made by a PUT request.
This app will be deployed using AWS beanstalk and docker. TBD
- Django - The web framework used
- Django REST Framework - The api framework used
- Python - Used to write logic code
- jQuery - Used for diaplsy functions
- JavaScript - Assists in frontend display
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
We use SemVer for versioning. For the versions available, see the tags on this repository.
- Ka Wong - Unit testing, serializers, database design - django models. - HTMercury
- Zach Verghese - Logical data operations and validation - django views. - ZachVerghese
- Tom Kane - Front and back end integration, documentation - django templates. - Tsk339
See also the list of contributors who participated in this project.
This project is licensed under the MIT License.
- Hat tip to slate API documentation boiler plate