Refactoring Tsugis Admin Console with AI – Moving Legacy PHP to Controllers @ChuckSeverance
Refactoring Tsugis Admin Console with AI – Moving Legacy PHP to Controllers  @ChuckSeverance
Uploaded October 2026 | Updated November 2026, 2 hours ago
In this episode of AI Coding with Dr. Chuck, I work with Cursor to refactor the administrative console in Tsugi, moving a collection of legacy PHP scripts toward a more structured controller-based architecture.

The Tsugi admin interface has grown organically over more than a decade. While functional, much of the code was written as standalone PHP pages rather than following the controller and service patterns used elsewhere in the application.

We explore how to reorganize the administration code into a hierarchy of smaller controllers, preserve existing behavior, move presentation code into templates, and extract shared utility functions into an admin service.

Topics include:
- Refactoring legacy PHP into controllers and routes
- Organizing administration features into smaller subcontrollers
- Separating controllers, templates, and services
- Preserving existing administrator authentication
- Preparing the architecture for future tenant and organization administrators
- Using Cursor AI to perform large-scale code restructuring
- Reviewing generated code and identifying remaining technical debt

This is an incremental refactoring session rather than a complete rewrite. The goal is to improve the structure of Tsugi while keeping the existing administrative console working.

Tsugi: tsugi.org
Python for Everybody: py4e.com

In January 2027, I'll be teaching Python for Everybody with AI. Visit py4e.com for more information.

#Tsugi #PHP #CursorAI #SoftwareEngineering #Refactoring #AICoding
Refactoring Tsugis Admin Console with AI – Moving Legacy PHP to ControllersRequired Viewing Django Week 3: SQL, Models, ORM, and SQLiteDeleting Courses Safely in Tsugi — Cascades, Badges, and “Are You Sure?”DJ 31.03 Django Many-to-Many Favorites with AJAX Implementation (34:18)Taking the New Tsugi Organization and LTI Model Into ProductionI Broke Production While Reviewing My AI-Generated CodeIt is that time of year where you tease an Australian shepherd with a water hoseSakai Racing: Kenwood race radio - PTT - IMSA Helmet Connector - talk to the driver from the pitsAI Coding with Dr. Chuck: It’s My Birthday 🎂Mid Ohio - Chuck Track Day - 2026-04-10Building Common Cartridge Import in Tsugi — Start With the Data ModelBuilding LTI 1.3 Launches with AI – Privacy, Deep Linking, and Resource Links
Chuck Severance |

Refactoring Tsugi's Admin Console with AI – Moving Legacy PHP to Controllers

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER