This Quick Kart API interfaces with the front end of the Android application made by another contributor. To test the API, you may use curl or Postman to send requests to the end points.
Original repository: https://github.com/envaleed/quick-kart
Live version: https://quickkart-api.herokuapp.com/
This API was developed using the Python microframework, Flask and tested using Postman and the curl command line tool. The libraries I used are as follows:
- Flask-SQLAlchemy to connect to the cloud Postgresql database
- Flask-Bcrypt to hash and salt the passwords
- Flask-JWT for authorization using JWT tokens
- Flask-Marshmallow for JSON serialization
curl -d '{"username":"<YOUR NAME>","password":"<YOUR PASSWORD>","email":"<YOUR EMAIL>"}' -H "Content-Type: application/json" -X POST https://quickkart-api.herokuapp.com/api/registration/
curl -d '{"username":"<YOUR NAME>","password":"<YOUR PASSWORD>"}' -H "Content-Type: application/json" -X POST https://quickkart-api.herokuapp.com/auth
curl -XPOST -H 'Authorization: jwt <TOKEN FROM /auth>' -H "Content-type: application/json" -d '{"keyword":"fruit"}' 'https://quickkart-api.herokuapp.com/api/search/'
curl -XPOST -H 'Authorization: jwt <TOKEN FROM /auth>' -H "Content-type: application/json" -d '[{"title":"Bananas","quantity":12},{"title":"Apples","quantity":10},{"title":"Oranges","quantity":20 },{"title":"Blueberries","quantity":18}]' 'https://quickkart-api.herokuapp.com/api/postorder/'
curl -XGET -H "Content-type: application/json" 'https://quickkart-api.herokuapp.com/api/findorder/<id>/<title>'
curl -XGET -H "Content-type: application/json" 'https://quickkart-api.herokuapp.com/api/findorders/<id>/'