DIMMiN Notes
My working notes related to the development of dimmin.com.
2026-06-30-Tuesday
- Implemented a fix using a Django Management Command to de-dupe / merge
TwitchUserobjects that had the sameuser_id - Included the psql installation in my Dockerfile so I can use Django DBShell to log into the PostgreSQL database directly for each user with their respective scoped permissions (i.e the dev account can only access the dev database, the test account can only access and alter the test database, etc.)
- Integrated
TwitchFollow,TwitchChannelPointsRedemption,TwitchShoutOut, andTwitchAdBreak - Pushed changes to Production, specifically including integration tests into the workflow as a final check.
2026-06-29-Monday
- Implemented caching for broadcaster
TwitchUsermodel so I don't have to get it from the database each time - Started parsing twitchbot logs in Integration Tests allowing me to automatically catch twitchbot errors during testing
- Began storing logs for each app in the
/app/logs/APP_NAME.logdirectory. - Attempted to push through to Production but realized I needed to correct the duplicate User IDs before migrating.
- Accidentally attempted to merge a failed test deployment into the master branch, but thankfully my CICD Pipeline blocked it since test failed deployment. Cool!
2026-06-28-Sunday
- Woke up this morning to see that OAuth tokens were rotated and seem to be properly handled in
testandproductionenvironments now. - Used this ErrorComponent from the twitchio docs to handle the command errors regardless of
HOST_TYPE(so that thetestenvironment could also handle errors in the same way) - Installed the Twitch CLI and managed to create and send test events directly to the application (which can be picked up by the dev bot) so I can test data extraction from data payload objects
- Worked on updating Unit Tests and developing Integration Tests to test data collection before it goes to Production
- Saved my first event (a
TwitchRaid) using Django's Asynchronous save (asave) command instead ofsync_to_async
2026-06-27-Saturday
- Completed OAuth flow setup
- Realized that a single twitch application can support and monitor many different users
- Pushed updated code through to Production
- Reached out to
catalixiato ask her to authorize the apps for thetestand Production environments catalixiaauthorized both test and production apps, bot worked in production- Identified and fixed a bug when extracting from a Token payload during auto-refresh, now this bot should handle any necessary
- Created utility functions that can check the validity of access tokens and also revoke them
2026-06-26-Friday
- Created a script to automate the database migration process from SQLlite to PostgreSQL from the running Portainer server (including wiping existing database and authorizing scoped users)
- Updated
TwitchCredentialsso that all information required for an app is associated with the same object - Updated the OAuth flow so that refresh tokens and access tokens wait for user to authenticate before starting the bot
- Pushed new OAuth flow through to production, set up
catalixia's credentials so we can start testing data there.
2026-06-25-Thursday
- Fixed the Python django-axes lock out issue by using Python django-ipware and forwarding the real user IP Address through the Cloudflare Tunnel
- Routed true IP Address from the Cloudflare Tunnel to Python django-axes so that I don't keep getting locked out of the account.
- Figured out OAuth token collection for
testandproductionsites, successfully deployed to both environments - Updated OAuth token so that oauth flow goes through the
/twitchbot/Django Route (keeping it separate from any future oauth processes) - Updated GitHub Actions so that migrations and collecting staticfiles only spins up the docker's web (Django) process instead of spinning up all services to speed up deployment
2026-06-24-Wednesday
- Pushed code through CICD Pipeline to Production
- Deployed
testandprodenvironments to the appropriate Web Domain and configured each with its own respective Cloudflare Tunnel - Fixed Static Files not rendering by applying collectstatic and migrations before officially spinning up the Docker Container
2026-06-23-Tuesday
- Completed OAuth token handling so that tokens are stored in the actual PostgreSQL database (not a separate
tokens.dbfile) - Created the
streameruser group - Implemented an admin Mixin so that only users who are logged in can access the actual dashboard
- Installed Python django-extensions for some useful Django tools that make development easier
- Installed Python django-axes to track and apply Rate Limits to user login attempts
- Pushed the new code through to
testbut hit some errors with the Static Files before pushing to prod - Fixed the
EACCESSerror by re-assigning permissions to all Docker created files to files that the GitHub Runner can alter
2026-06-21-Sunday
- Created databases and roles on the PostgreSQL server that could programattically access their respective databases, preparing for the migration from SQLlite