Skip to content

Latest commit

Β 

History

51 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Python

PyHub integrates a Flask backend πŸ”§ with an Electron frontend ⚑ to create a seamless, cross-platform application that works both in-browser and as a desktop app. This setup allows you to leverage the power of Python 🐍 for backend processing and JavaScript πŸ’» for a dynamic user interface.

πŸš€ Getting Started

Prerequisites

Before diving in, ensure you have the following installed:

  • Python 3.x - for the backend logic
  • Node.js and npm - for managing the Electron application
  • Yarn (optional) - for faster and reliable dependency management

Download Python

πŸ“₯ Latest Python Download Links (Click to expand) ⬇️
Release Type Version Release Date Download Links
Latest Release Python 3.13.0 Oct. 7, 2024 Installer (64-bit), Installer (32-bit), Installer (ARM64), Embeddable Package (64-bit), Embeddable Package (32-bit), Embeddable Package (ARM64)
Stable Release Python 3.12.7 Oct. 1, 2024 Installer (64-bit), Installer (32-bit), Installer (ARM64), Embeddable Package (64-bit), Embeddable Package (32-bit), Embeddable Package (ARM64)
Pre-release Python 3.14.0a1 Oct. 15, 2024 Installer (64-bit), Installer (32-bit), Installer (ARM64), Embeddable Package (64-bit), Embeddable Package (32-bit), Embeddable Package (ARM64)
🍎 macOS Download Links (Click to expand) ⬇️
Release Type Version Release Date Download Links
Latest Release Python 3.13.0 Oct. 7, 2024 macOS 64-bit universal2 installer
Stable Release Python 3.12.7 Oct. 1, 2024 macOS 64-bit universal2 installer
Pre-release Python 3.14.0a1 Oct. 15, 2024 macOS 64-bit universal2 installer
βš™οΈ Package Manager Commands (Click to expand) ⬇️
Package Manager Command
winget winget install Python.Python.3
Homebrew (macOS) brew install python
apt (Debian/Ubuntu) sudo apt update && sudo apt install python3
pacman (Arch Linux) sudo pacman -S python
πŸ“š Installation Guides (Click to expand) ⬇️
Tool Installation Guide
Python Download and install the latest version of Python.
pip Install pip, the Python package manager.
Node.js & npm Install Node.js and npm.
Yarn (Optional) Install Yarn for a smoother dependency management experience.

πŸ“¦ Installation

Backend (Flask) Setup

  1. Clone the repository and navigate to the project directory.
    git clone https://github.com/rxElectron/PyHub.git
    cd pyhub
  2. Install the required Python dependencies:
    pip install -r requirements.txt

Frontend (Electron) Setup

  1. Navigate to the electron_app directory:
    cd electron_app
  2. Install the necessary Electron dependencies:
    npm install
    # or
    yarn install

▢️ Running the Project

Step 1: Start the Flask Backend

Run the Flask server by executing:

python app.py

Step 2: Choose Your Interface

Once the backend is running, you have two options for the frontend:

  • Browser Mode: Open your browser and navigate to the URL shown in the terminal.
  • Electron App Mode: Run the Electron app by selecting "Yes" when prompted in the dialog or by executing the start command within the electron_app directory:
    npm start
    # or
    yarn start

🌟 Project Features

  • πŸ–₯ Flask Backend: Handles REST API endpoints, data processing, and template serving.
  • πŸ’» Electron Frontend: Wraps the web application in a desktop environment, providing access to native features.
  • πŸ“¦ Modular Architecture: Each feature, such as debugging and exploring, has its own dedicated route and component, making the app more maintainable and scalable.

πŸ›  Debugging Tools

The Debug Module helps you troubleshoot issues effectively, offering:

  • Logging & Error Tracking: View application logs and errors.
  • Performance Profiling: Analyze performance bottlenecks.
  • Variable Inspection & Breakpoint Management: Dive into variable values and control the flow.

To access these features, simply navigate to the Debug section within the app interface.

πŸ™Œ Acknowledgements

Thanks to all the contributors and open-source libraries that made this project possible. Special shoutout to the developers of Flask and Electron for enabling rapid cross-platform development!

πŸ“‘ Node Management Setup

To manage Node.js versions, you can use nvm (Node Version Manager) or fnm (Fast Node Manager). Below are instructions for setting up both tools on different systems.

  1. Install nvm (Node Version Manager):
    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash
  2. Download and install Node.js (you may need to restart the terminal):
    nvm install 22
  3. Verify the installed Node.js and npm versions:
    node -v # should print `v22.11.0`
    npm -v  # should print `10.9.0`

Linux/macOS

  1. Install fnm:
    curl -fsSL https://fnm.vercel.app/install | bash
  2. Activate fnm:
    source ~/.bashrc
  3. Download and install Node.js:
    fnm use --install-if-missing 22
  4. Verify the installed Node.js and npm versions:
    node -v # should print `v22.11.0`
    npm -v  # should print `10.9.0`

Windows

  1. Install fnm via winget:
    winget install Schniz.fnm
  2. Configure fnm environment:
    fnm env --use-on-cd | Out-String | Invoke-Expression
  3. Download and install Node.js:
    fnm use --install-if-missing 22
  4. Verify the installed Node.js and npm versions:
    node -v # should print `v22.11.0`
    npm -v  # should print `10.9.0`

🧢 Yarn Setup

Before using Yarn, ensure it is installed on your system. There are multiple ways to install Yarn:

The recommended way to install Yarn is through npm:

npm install --global yarn
Operating System Installation Method
Arch Linux pacman -S yarn
Windows Use Chocolatey (choco install yarn), Scoop (scoop install yarn), or download the installer.
macOS Use Homebrew (brew install yarn), MacPorts (sudo port install yarn), or installation script.

Verify Yarn Installation

To verify if Yarn is installed correctly, run:

yarn --version

If Yarn is not found in your PATH, add the following to your profile (e.g., .bashrc, .zshrc):

export PATH="$PATH:/opt/yarn-[version]/bin"

For Fish shell users:

set -U fish_user_paths (yarn global bin) $fish_user_paths

🐍 Installing pip in Python Environment

If your Python environment does not have pip installed, you can use one of the following methods:

  • Linux/macOS:
    python -m ensurepip --upgrade
  • Windows:
    py -m ensurepip --upgrade
  1. Download the script from get-pip.py.
  2. Run the script in the terminal:
    • Windows:
      py get-pip.py

Upgrading pip

To upgrade pip, run:

python -m pip install --upgrade pip

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE-MIT file for details.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages