mirror of
https://gitlab.com/ivancmonaco/dept-challenge.git
synced 2026-04-16 03:48:50 -03:00
A Flask API for a DEPT challenge for a back end position
back end
back-end
backend
challenge
coding challenge
coding-challenge
flask
flask-api
python
Python (Flask)
python3
| dept_challenge | ||
| nginx | ||
| .env.example | ||
| .gitignore | ||
| .gitlab-ci.yml | ||
| .pylintrc | ||
| docker-compose.yml | ||
| Dockerfile | ||
| openapi.yaml | ||
| Pipfile | ||
| Pipfile.lock | ||
| Readme.md | ||
| start_server.sh | ||
DEPT Back End Challenge
Hi! This is my solution for the Challenge of DEPT , for the Back End Software Engineer position
Task
Crear una API de gestión de libros y comentarios sobre los mismos. No se requiere implementar usuarios ni permisos y, en lo posible, hacer la implementación usando Flask o fastAPI (aunque no es excluyente).
Para proveedor de la información sobre los libros, se puede usar https://openlibrary.org/dev/docs/api/books Esta API deberá consistir en lo siguiente:
- Obtener información de un libro por ISBN
- Guardar información de un libro
- Obtener una lista de libros
- Permitir operaciones CRUD sobre comentarios en un libro.
- Dejar abierta la posibilidad de intercambiar openlibrary por cualquier otra API (parametrización del proveedor de la info sobre los libros)
Stack
- Docker
- Docker-Compose
- Nginx
- Flask
- Flask-SQLAlchemy
- Gunicorn
- Gevent
- MySQL
API Documentation
Usage
- Install Docker and Docker-Compose
- Copy .env.example into .env and fill the gaps
docker-compose up --build -d- Check app status with
curl http://localhost/api/v1/health - Profit
Testing
- Install pipenv
- Run
pipenv install - Change directory to dept-challenge:
cd dept-challenge - Run tests with
pipenv run python -m pytest -v
To Do / Nice to have
If I had more time , these features would be the next steps:
- Continuous Integration with Terraform
- Integration tests / E2E Tests
- Even more unit tests coverage, and reuse testing code
- Improved pagination, added more filtering and ordering support
- Cache system ( flask-caching + redis )
- Load the book details async with a Celery job