This project is a practical example of using design patterns and SOLID principles in Python, integrating the Stripe API. The goal is to iteratively refactor the code, applying best practices while focusing on clean and maintainable design.
- Demonstrate how to implement design patterns (Singleton, Factory, Strategy, etc.).
- Apply SOLID principles (Single Responsibility, Open/Closed, Liskov Substitution, etc.).
- Integrate a real API, like Stripe, to illustrate a practical use case.
- Gradually improve the code design through refactoring.
- Python 3.10+
- Stripe API: For payment processing.
- Virtual Environments:
venvfor dependency isolation. - Docker: More flexible
git clone [email protected]:guduchango/python-design-patterns-and-solid-principle.git
cd python-design-patterns-and-solid-principle.git
python -m venv venv
source venv/bin/activate # Linux/Mac
venv\Scripts\activate pip install -r app/requirements.txt- Create a new account stripe https://stripe.com/
- Go to https://dashboard.stripe.com/test/apikeys
- Read transacctions on https://dashboard.stripe.com/test/payments
python3.11 app/main.py