Skip to content

Thinking About Contributing?

JDX50S edited this page May 8, 2024 · 3 revisions

This is where you start.

Our package manager has been functional for over a year due to diligent work and maintenance.

LOGIN

subgraph "Start"
    A[Start] --> B{User Authentication} %% Start of the authentication process
end

subgraph "User Authentication"
    B --> C{Check Device Restriction} %% Check if the device is restricted
    C --> D{Login Process} %% Proceed to login process if device is not restricted
    D --> E{Token Check} %% Check if the token is valid
    E --> F[Authentication Successful] %% If token is valid, authentication is successful
    F --> G[End] %% End the process
    E --> H{Authentication Failed} %% If token is invalid, authentication fails
    H --> I{Retry?} %% Check if there are more login attempts allowed
    I --> J{Yes} %% If more attempts are allowed, retry login process
    J --> D %% Retry the login process
    I --> K{No} %% If no more attempts are allowed, end the process
    K --> L[End] %% End the process
end

subgraph "Check Device Restriction"
    C --> M{Device Restricted?} %% Check if the device is restricted
    M --> N{Yes} %% If device is restricted, end the process
    N --> O[End] %% End the process
    M --> P{No} %% If device is not restricted, proceed to login process
    P --> D %% Proceed to login process
end

%% Detailed Comments

%% Check Device Restriction
%% Check if the device is restricted based on its UUID
%% The device's UUID is compared against a list of restricted UUIDs
%% If the UUID is found in the list, the device is restricted
%% Otherwise, the device is not restricted

%% Authentication Successful
%% Token authentication successful
%% The user is allowed to log in

%% Authentication Failed
%% Token authentication failed
%% The user is not allowed to log in

%% Retry?
%% Check if there are more login attempts allowed
%% If yes, the user can retry the login process
%% If no, the user is not allowed to retry and must end the process

%% Device Restricted?
%% Check if the device is restricted
%% If yes, the device is restricted and the user cannot log in
%% If no, the device is not restricted and the user can proceed with login

MODULE IMPORT

subgraph "Start"
    A[Start] --> B{Import Specific Modules} %% Start of the script
end

subgraph "Import Specific Modules"
    B --> C{Check User Settings} %% Check if user settings allow for import
    C --> D{List of Required Libraries} %% Proceed to list of required libraries
    D --> E{Check and Install Libraries} %% Check if each library is installed and install if not
    E --> F{File Operations} %% Proceed to file operations
    F --> G[End] %% End of script
end

%% Detailed Comments

%% Import Specific Modules
%% Attempt to import specific modules required for the script
%% If any module is not found, ImportError is raised and ignored

%% Check User Settings
%% Check if user settings allow for import
%% If UserProfile.Force_Import_Request is False, proceed with import
%% Otherwise, log an event and abort import

%% List of Required Libraries
%% Define a list of libraries required for the script

%% Check and Install Libraries
%% For each library in the list of required libraries:
%% Check if the library is installed
%% If not installed, install the library using fc.importy(lib) function

%% File Operations
%% Define a list of files to copy from 'requ_builders' directory
%% Copy each file to the current working directory

PASSWORD functioning

subgraph "Start"
    A[Start] --> B{Password Authentication} %% Start of the script
end

subgraph "Password Authentication"
    B --> C{Offline Mode?} %% Check if in offline mode
    C --> D{Verify Token} %% If offline, verify token
    D --> E[End] %% End authentication
    C --> F{Hash Password} %% If online, hash the password
    F --> G{Compare Hashes} %% Compare the hashed password with stored hashed password
    G --> H{Correct Password?} %% Check if the password is correct
    H --> I{Yes} %% If correct, continue
    I --> E %% End authentication
    H --> J{No} %% If not correct, exit
    J --> K[End] %% End authentication
end

subgraph "User Identity Validation"
    E --> L{Generate UUID} %% Generate UUID for user
    L --> M{Get User ID} %% Get the user's ID
    M --> N{Generate Salt} %% Generate salt for password hashing
    N --> O{Combine Password, UUID, User ID, and Salt} %% Combine elements for hashing
    O --> P{Hash Password} %% Hash the combined string
    P --> Q{Store Hashed Password} %% Store the hashed password
    Q --> R{Update User Profile} %% Update user profile with hashed password
    R --> S[End] %% End user identity validation
end

subgraph "Decryption of Files"
    E --> T{Decrypt Files} %% Decrypt files using password
    T --> U{Update File Status} %% Update file status after decryption
    U --> V[End] %% End decryption of files
end

%% Detailed Comments

%% Password Authentication
%% Perform password authentication, including offline and online modes
%% Offline mode: Verify token
%% Online mode: Hash password and compare hashes

%% User Identity Validation
%% Generate UUID for user identification
%% Get user ID
%% Generate salt for password hashing
%% Combine password, UUID, user ID, and salt for hashing
%% Hash the combined string and store hashed password
%% Update user profile with hashed password

%% Decryption of Files
%% Decrypt files using password
%% Update file status after decryption

Update

subgraph "Start"
    A[Start] --> B{Remove Cached Update Data} %% Start of the script
end

subgraph "Remove Cached Update Data"
    B --> C{Check Compatibility Information} %% Check compatibility with new version
    C --> D{GET Request for Compatibility} %% Send a GET request for compatibility information
    D --> E{Fetch Current Version} %% Fetch the current version of the application
    E --> F{Compare Versions} %% Compare current version with available version
    F --> G{New Version Available?} %% Check if new version is available
    G --> H{Fetch New Version Information} %% Fetch information about the new version
    H --> I{Display Information Dialog} %% Display an information dialog to notify the user
    I --> J{Confirm Update} %% User confirms to update
    J --> K{Fetch New Version Files} %% Fetch new version and related files
    K --> L{Update Application} %% Update the application files
    L --> M{Change Working Directory} %% Change the working directory to a specific location
    M --> N{Git Clone Update Branch} %% Use git to clone the "UPDATE" branch of the GitHub repository
    N --> O{Open New Terminal Window} %% Open a new Terminal window
    O --> P{Relaunch Application} %% Run a Python script to relaunch the updated application
    P --> Q{Update Successful} %% Display update successful message
    Q --> R[End] %% End of the script
    G --> S{No Updates Available} %% If no updates are available, end the script
    S --> R %% End of the script
end

%% Detailed Comments

%% Remove Cached Update Data
%% Attempt to remove a specific directory related to cached update data

%% Check Compatibility Information
%% Send a GET request to a URL to check for compatibility information

%% GET Request for Compatibility
%% Send a GET request to a specific URL to fetch compatibility information

%% Fetch Current Version
%% Fetch the current version of the application from a local file or API

%% Compare Versions
%% Compare the fetched current version with the available version

%% New Version Available?
%% Check if a new version is available based on the comparison

%% Fetch New Version Information
%% Send a GET request to fetch information about the new version

%% Display Information Dialog
%% Display an information dialog to notify the user about the new version

%% Confirm Update
%% Wait for user confirmation to proceed with the update

%% Fetch New Version Files
%% Fetch the new version and related files

%% Update Application
%% Update the application files

%% Change Working Directory
%% Change the working directory to a specific location where the update will be applied

%% Git Clone Update Branch
%% Use git to clone the "UPDATE" branch of the GitHub repository to update the application's files

%% Open New Terminal Window
%% Open a new Terminal window for further actions

%% Relaunch Application
%% Run a Python script to relaunch the updated application

%% Update Successful
%% Display a message indicating that the update was successful

Render GUI

subgraph "Start"
    A[Start] --> B{Check Forced Login}
end

subgraph "Check Forced Login"
    B --> C{Import System.Drive.Login}
    C --> D{Launch Login Window}
end

subgraph "Main GUI"
    D --> E{Initialize GUI}
    E --> F{Create Toolbar}
    F --> G{Create Main Frame}
    G --> H{Create Git Repository Rows}
    H --> I{Create Bottom Buttons}
    I --> J{Configure Window}
    J --> K{Display GUI}
end

%% Check Forced Login
%% If forced login is required, import the login module and launch the login window for user authentication

%% Initialize GUI
%% Initialize the graphical user interface for the application

%% Create Toolbar
%% Create a toolbar with buttons for various functionalities such as information, settings, install, activate, etc.

%% Create Main Frame
%% Create the main frame for the application content where git repository rows and other content will be displayed

%% Create Git Repository Rows
%% Create rows for each git repository with download buttons for users to download the repository content

%% Create Bottom Buttons
%% Create buttons for additional functionalities at the bottom of the window, such as recommended actions, reviews, etc.

%% Configure Window
%% Configure the window size and position based on the screen resolution and user preferences

%% Display GUI
%% Display the graphical user interface to the user for interaction

subgraph "Functions"
    K --> L{Show Information}
    L --> M{Settings Window}
    M --> N{Show Install}
    N --> O{Activate}
    O --> P{Show List Window}
    P --> Q{Crypt}
    Q --> R{Kill Server}
    R --> S{Update}
    S --> T{Open Update Local}
    T --> U{Start Server}
    U --> V{Start CLI}
end

%% Show Information
%% Display information about the application, such as version, credits, etc.

%% Settings Window
%% Open a settings window for users to configure application settings

%% Show Install
%% Display a window to install additional packages or plugins for the application

%% Activate
%% Activate the application using a license key or authentication mechanism

%% Show List Window
%% Display a list of installed plugins or packages for the user to manage

%% Crypt
%% Execute a cryptographic operation, such as encryption or decryption

%% Kill Server
%% Stop the running server or process associated with the application

%% Update
%% Check for updates to the application and perform the update if available

%% Open Update Local
%% Open a local update file or directory for updating the application

%% Start Server
%% Start the server or process associated with the application

%% Start CLI
%% Start a command-line interface for advanced operations or configuration

First Use

subgraph "Start Execution"
    A[Start Execution] --> B{Check First Use}
end

subgraph "Check First Use"
    B --> C{First Use Exists?}
    C -->|Yes| D[Already Used]
    C -->|No| E[First Use]
end

subgraph "First Use"
    E --> F[Initialize Configuration Interface]
    F --> G[Collect User Data]
    G --> H[Create User Profile]
    H --> I[Generate Hashed Password]
    I --> J[Write GHPM System]
    J --> K[Remove Token File]
    K --> L[Terminate Execution]
end

subgraph "Already Used"
    D --> L[Terminate Execution]
end

%% Check First Use
%% If it is the first use of the system, initialize the configuration interface
%% to collect user data and create a user profile

%% Initialize Configuration Interface
%% Initialize a graphical user interface for collecting user data (username, password, email, etc.)

%% Collect User Data
%% Collect the user's data entered in the configuration interface

%% Create User Profile
%% Create a user profile file with the collected data

%% Generate Hashed Password
%% Hash the user's password for security

%% Write GHPM System
%% Write the GHPM system file with the user profile data

%% Remove Token File
%% Remove the token file indicating the first use of the system

%% Terminate Execution
%% End the script execution

GHC function

A[Start Execution] --> B{Check First Use}
B --> C[Check if 'ghc.py' exists in top-level directory]
C --> D[Create 'ghc.py' with preset data]
D --> E{Check if subdir is already connected}
E --> F[Check if 'ghc.py' exists in the subdir]
F --> G{Is 'ghc.py' already connected in subdir?}
G --> H[Print 'Subdir is already connected']
H --> I[End]
G --> I[Update 'ghc.py' connection in subdir]
I --> J{Are all subdirs processed?}
J --> K[Print 'All subdirs processed']
K --> L[End]
J --> M[Process next subdir]
M --> N{Get list of all items in directory}
N --> O{Filter out only directories}
O --> P{Iterate over each subdir}
P --> Q[Check if 'ghc.py' exists in the current subdir]
Q --> R{Is 'ghc.py' already connected in the current subdir?}
R --> S[Print 'Subdir is already connected']
S --> T[Continue to next subdir]
R --> T[Update 'ghc.py' connection in current subdir]
T --> U{Are all subdirs processed?}
U --> V[Print 'All subdirs processed']
V --> W[End]
U --> M[Process next subdir]

Details:

- A: Start of the execution process.
- B: Check if this is the first use of the program.
- C: Create the 'ghc.py' file with preset data (username, token).
- D: Check if the current subdir is already connected.
- E: Check if the 'ghc.py' file exists in the current subdir.
- F: Determine if 'ghc.py' is already connected in the current subdir.
- G: If 'ghc.py' is already connected, print a message and end the process for this subdir.
- H: If 'ghc.py' is not connected, update the connection in the current subdir.
- I: Check if all subdirs have been processed.
- J: If all subdirs have been processed, print a message and end the process.
- K: If not all subdirs have been processed, move to the next subdir.
- M: Process the next subdir.
- N: Get a list of all items (files and directories) in the specified directory.
- O: Filter out only directories from the items list.
- P: Iterate over each subdir.
- Q: Check if the 'ghc.py' file exists in the current subdir.
- R: Determine if 'ghc.py' is already connected in the current subdir.
- S: If 'ghc.py' is already connected, print a message and continue to the next subdir.
- T: If 'ghc.py' is not connected, update the connection in the current subdir.
- U: Check if all subdirs have been processed.
- V: If all subdirs have been processed, print a message and end the process.
- W: End of the process.

Connect Server for ui

subgraph "Start"
    A[Start] --> B{Push Analytics}
end

subgraph "Push Analytics"
    B --> C{Generate UUID}
    C --> D{Push Analytics Data}
end

subgraph "Generate UUID"
    C --> E[Generate UUID]
end

subgraph "Push Analytics Data"
    D --> F[Check Internet Connection]
    F --> G{Import System.Drive.Errors_Events.EventMan}
    G --> H{GUI Event}
end

subgraph "Check Internet Connection"
    F --> I[Check Internet Connection]
end

subgraph "GUI Event"
    H --> J[Check for Current Function]
    J --> K[Start Server]
    K --> L[Change Directory]
    L --> M[Start Node Process]
    M --> N[Show Success Message]
end

%% Start
%% Start the process by pushing analytics data

%% Push Analytics
%% Generate UUID and push analytics data

%% Generate UUID
%% Generate a unique identifier for analytics tracking

%% Push Analytics Data
%% Check internet connection, import required module, and trigger GUI event

%% Check Internet Connection
%% Check if the device has an active internet connection

%% GUI Event
%% Check for the current function, start the server, change directory, start the node process, and show success message

subgraph "Functions"
    N --> O{Handle Exceptions}
    O --> P{Show Error Message}
end

%% Handle Exceptions
%% Handle any exceptions that occur during the process

%% Show Error Message
%% Display an error message to the user if an exception occurs

Activating Installed modules

More info on this can be found at the following link: here