Notes on implementation, requirements and running the app
This application uses the following technologies:
- Python3.8 version
- Flask REST framework
- SQLAlchemy and SQLite3 for db solution
- Redis for caching
Rationale for using these technologies are that Flask-RESTful is the standard and a requirement of the task. SQLAlchemy allows you to swap out db implementations easily. SQLite is simple db solution but better than using in-memory store. And Redis is the latest caching option of choice for modern apps.
Basic structure was inspired from here:
https://www.udemy.com/course/rest-api-flask-and-python/
Installing dependencies:
pip install -r requirements.txt
Run redis server:
[__dir__]/Redis/redis-server.exe
'localhost', 6379
Run app:
[__dir__]/git-projects/flask-app
python app.py
(creates data.db) in your root directory
URI:
http://127.0.0.1:5000/
Resources
(Dog, '/dog/<string:name>')
(DogList, '/dogs')
Implemented:
- Create - new dog with id, name, breed and age
- Read - return list of dogs and get individual dog by name (not id)
- Update - existing dog or create new one if not found
- Delete - remove a given individual dog
- Datastore - SQLite db
Implemented:
- Simple validation using reqparse
Implemented:
- Simple caching using Redis
Not Implemented:
- No (bonus) config
- No unit tests