Refactor: modularize authentication, utilities, kaomoji data, and HTML templates#20
Merged
cto-new[bot] merged 1 commit intoNov 4, 2025
Conversation
Improve code maintainability and reusability by splitting large code files into dedicated, focused modules. Admin and board logic now delegate authentication, utility functions, and kaomoji data to their respective new modules. Reduces code duplication and clarifies module responsibilities. - Extract auth, session, and cookie logic from admin.c to auth.c/h and utils.c/h - Move URL decoding and token generation into utils.c/h - Separate kaomoji data from board.c into kaomoji.c/h - Add html_template.c/h for common CSS and HTML helpers - Adjust main handlers to use new APIs, reducing board.c and admin.c size No breaking changes; functionality is preserved. Build system remains unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR improves maintainability and reusability by extracting shared utility, authentication, kaomoji, and template code into dedicated modules, significantly reducing file sizes and duplication without changing functionality.
Details
auth.c/handutils.c/h.utils.c/h.kaomoji.c/h.html_template.c/hfor standardized CSS and reusable HTML helpers.Warning: Task VM test is not passing, cto.new will perform much better if you fix the setup