Skip to content

rafaeldias98/python-customer-api

Repository files navigation

Python Customer + Favorite Products REST API

An API for registering Customers and their Favorite Products.

🔖 Summary

  1. Requirements
  2. Stack
  3. Setup and init API
  4. Run Tests
  5. Authentication and Authorization
  6. Documentation
  7. Contribuiting
  8. Author
  9. License

☑️ Requirements

📂 Stack

  • 🐳 Docker
  • 🐙 Docker Compose
  • 🐍 Python 3
  • 🐬 MySQL 8.0
  • 🚀 Django
  • 🎁 Django REST Framework

🚀 Setup and init API

$    cp .env.example .env # you can edit if necessary
$    docker-compose up

💀 Run Tests

Before run, make sure the API container is up
$    ./scripts/tests.sh run

To see coverage report

$    ./scripts/tests.sh coverage
     # After run this command, you can see the tests coverage in htmlcov/ folder

🔒 Authentication and Authorization

  • This API contains authentication and authorization. A default admin user is created using .env credentials, but you can create more users at Django Admin setting their API resource access.

  • To authenticate on API, use /auth/ resource, passing your username and password to retrieve a token.

📚 Documentation

🔧 Contributing

contributions welcome

If you find any problem or have a suggestion, please open an issue.

💻 Author

  • Rafael Dias - Software Developer

📝 License

  • This project is licensed under the MIT License - see the LICENSE file for details.