Refactor codebase for improved structure and maintainability#15
Open
ll2ym wants to merge 2 commits intospyboy-productions:mainfrom
Open
Refactor codebase for improved structure and maintainability#15ll2ym wants to merge 2 commits intospyboy-productions:mainfrom
ll2ym wants to merge 2 commits intospyboy-productions:mainfrom
Conversation
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 using `render_template` and `send_from_directory`. The confusing `dwebhook.js` file has been renamed to `webhook.txt` and 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.js` file. This new file is more modular and readable, with improved function and variable names. The `index.html` file 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 one `index.html` template that conditionally loads features based on the user's selection. This has eliminated significant code duplication. - **Directory Cleanup**: The redundant `cam`, `gps`, and `ip` directories have been removed, resulting in a much cleaner and more intuitive project structure.
Author
|
g |
This commit introduces a major refactoring of the R4ven codebase to improve its structure, maintainability, and robustness. It also includes a basic startup test to ensure the application is working correctly. The key changes are: - **Backend Refactoring**: The backend has been overhauled to remove fragile `os.chdir()` calls and implement proper Flask file-serving methods using `render_template` and `send_from_directory`. The confusing `dwebhook.js` file has been renamed to `webhook.txt` and 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.js` file. This new file is more modular and readable, with improved function and variable names. The `index.html` file 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 one `index.html` template that conditionally loads features based on the user's selection. This has eliminated significant code duplication. - **Directory Cleanup**: The redundant `cam`, `gps`, `ip`, and `image` directories have been removed, resulting in a much cleaner and more intuitive project structure. - **Testing**: A basic startup test has been added to the workflow to ensure the application starts without errors.
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.
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.