No description
  • Python 50.7%
  • TypeScript 49.3%
Find a file
2026-04-15 14:02:29 +02:00
configs Add python version 2026-04-15 13:59:59 +02:00
python Add python version 2026-04-15 13:59:59 +02:00
ts Add python version 2026-04-15 13:59:59 +02:00
.gitignore starting point 2025-05-31 12:46:31 +02:00
README.md Improve README 2026-04-15 14:02:29 +02:00

12 Factor App Kata

Part 1 : centralized configuration

Introduction

Read the code, and notice how we can switch the Mailer API URL and the database URL form the JSON config files by setting the 'APP_ENVIRONMENT' environment variable.

Changes we want to make

  • Add a "use_tls" boolean to the database configuration
  • Introduce a pre-production environment in addition to the production env
  • Encrypt the password databse and the secret token for the mailer

Relect on how big this changes would be in the state of the current code.

Part 2 : configuration as environment variables

Instructions

Go read the 12 Factor App documentation, especially the part about configuration:

=> https://12factor.net/config

Then refactor the code, getting rid of the 'configuration.ts' module completly.

Then, try and apply the changes listed in part 1.

Finally, try and run the code using the 'local' database and the "pre-production" mailer API.

Conclusion

List the pros and cons of having a centralized Configuration class.