-
-
Notifications
You must be signed in to change notification settings - Fork 41
Refactor project structure for modularity #944
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
kzndotsh
merged 2 commits into
refactor/architecture
from
cursor/refactor-project-structure-for-modularity-ac27
Jul 12, 2025
Merged
Refactor project structure for modularity #944
kzndotsh
merged 2 commits into
refactor/architecture
from
cursor/refactor-project-structure-for-modularity-ac27
Jul 12, 2025
Conversation
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
Contributor
Reviewer's GuideThis PR refactors the Tux codebase into a clear, modular architecture by reorganizing all sources into six top-level directories (core, infra, modules, custom_modules, cli, assets), consolidating documentation, updating the cog loader to handle the new layout, and mass-updating import paths to match. File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Description
This PR implements a major architectural refactor of the Tux project, addressing the goals outlined in Issue #924. The primary motivation is to enhance clarity, extensibility, scalability, and contributor-friendliness by establishing a clear separation of concerns within the codebase.
The refactor introduces a new, modular directory structure:
core/: Contains essential bot functionality, startup, shared UI, and core utilities.infra/: Houses infrastructure components like the database, logging, external API wrappers, and infrastructure-specific handlers.modules/: Dedicated to official, loadable feature modules (cogs/extensions).custom_modules/: Provides a.gitignoredlocation for self-hosters to add private or server-specific extensions without modifying the main codebase.cli/: For command-line interface tools.assets/: For static files.main.py: The application entry point, now at the root.All internal import statements have been updated to reflect this new structure, and the
core/cog_loader.pyhas been enhanced to dynamically load cogs frominfra/handlers/,modules/, andcustom_modules/in a defined order.This change fixes #924.
Guidelines
How Has This Been Tested?
The refactoring primarily involved moving files and updating import paths. Testing focused on ensuring all modules and components could be imported correctly:
python -c "import core.bot; import core.app; import core.cog_loader"python -c "import infra.database.client; import infra.handlers.error; import infra.wrappers.github"main.pyentry point can correctly initialize the application with the new import structure.Screenshots (if applicable)
N/A
Additional Information
ARCHITECTURE.md.REFACTOR_SUMMARY.md.custom_modules/directory has been added to.gitignoreto prevent accidental commits of user-specific extensions.tux/extensions/README.mdhas been removed as its content is now covered bycustom_modules/README.mdandARCHITECTURE.md.Summary by Sourcery
Implement a major architectural refactor to improve modularity by reorganizing the codebase into dedicated core, infrastructure, feature, and custom directories, updating imports and cog loading logic, and adding comprehensive documentation.
New Features:
Enhancements:
Documentation: