Refactor codebase for improved structure and maintainability #15
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.
This commit introduces a major refactoring of the R4ven codebase to improve its structure, maintainability, and robustness.
The key changes are:
Backend Refactoring: The backend has been overhauled to remove fragile
os.chdir()calls and implement proper Flask file-serving methods usingrender_templateandsend_from_directory. The confusingdwebhook.jsfile has been renamed towebhook.txtand its handling has been centralized, simplifying the logic.Frontend Refactoring: All inline JavaScript has been moved from the HTML files into a separate
static/app.jsfile. This new file is more modular and readable, with improved function and variable names. Theindex.htmlfile has been cleaned up accordingly.Consolidated Tracking Modes: The different tracking modes (
all,cam,gps,ip) have been consolidated into a single, dynamic system. The application now uses oneindex.htmltemplate that conditionally loads features based on the user's selection. This has eliminated significant code duplication.Directory Cleanup: The redundant
cam,gps, andipdirectories have been removed, resulting in a much cleaner and more intuitive project structure.