SI-Encoding / amazon-clone-flask

Co-developed containerized Flask and React eCommerce store with payment processor and 2FA verification
1 stars 0 forks source link

Dev prod env switch #40

Closed darren277 closed 2 years ago

darren277 commented 2 years ago

Code Review Checklist

Description

Refactored backend Flask server to follow more production ready patterns:

  1. Converted to App Factory pattern.
  2. Created a Settings class for instantiation via CLI arguments including environment type (i.e. 'dev' vs 'production').
  3. Created a Makefile with several frequently used commands.
  4. Changed SQLAlchemy pattern to use deferred reflection for ORM mapping inside of app factory function.
  5. Split routes into separate view files with unique Blueprints.
  6. Changed from Flask-CLI to Flask-Scripts.
  7. Added DEBUG mode for dev environment, including 2FA bypass.
  8. Added some global settings and third party API clients (i.e. Twilio client) to Flask g context.

Type of change

How was it tested?