From 979f859aad57ff4b80fd32c9c71f0f5b3813d21a Mon Sep 17 00:00:00 2001 From: rahulharpal1603 Date: Sat, 5 Jul 2025 16:55:15 +0530 Subject: [PATCH 01/12] Rename workflows --- .github/workflows/{app-build.yml => build-and-release.yml} | 3 +-- .github/workflows/{ci.yml => docs-deploy.yml} | 2 +- .github/workflows/{merge.yml => pr-check-build.yml} | 2 +- .github/workflows/{pr-tests.yml => pr-check-tests.yml} | 2 +- frontend/src-tauri/tauri.conf.json | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) rename .github/workflows/{app-build.yml => build-and-release.yml} (99%) rename .github/workflows/{ci.yml => docs-deploy.yml} (97%) rename .github/workflows/{merge.yml => pr-check-build.yml} (98%) rename .github/workflows/{pr-tests.yml => pr-check-tests.yml} (99%) diff --git a/.github/workflows/app-build.yml b/.github/workflows/build-and-release.yml similarity index 99% rename from .github/workflows/app-build.yml rename to .github/workflows/build-and-release.yml index ed16cbb95..f002068e9 100644 --- a/.github/workflows/app-build.yml +++ b/.github/workflows/build-and-release.yml @@ -1,5 +1,4 @@ -name: Build and Release - +name: Build and Release App on: workflow_dispatch: # Ability to manually trigger the workflow diff --git a/.github/workflows/ci.yml b/.github/workflows/docs-deploy.yml similarity index 97% rename from .github/workflows/ci.yml rename to .github/workflows/docs-deploy.yml index 068eac79b..c3a0ee5bb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/docs-deploy.yml @@ -1,4 +1,4 @@ -name: ci +name: Docs Deploy on: push: branches: diff --git a/.github/workflows/merge.yml b/.github/workflows/pr-check-build.yml similarity index 98% rename from .github/workflows/merge.yml rename to .github/workflows/pr-check-build.yml index d35a50569..feea90b1f 100644 --- a/.github/workflows/merge.yml +++ b/.github/workflows/pr-check-build.yml @@ -1,4 +1,4 @@ -name: "PR Check for PictoPy" +name: Tauri and Server Build Check on: pull_request_review: types: [submitted] diff --git a/.github/workflows/pr-tests.yml b/.github/workflows/pr-check-tests.yml similarity index 99% rename from .github/workflows/pr-tests.yml rename to .github/workflows/pr-check-tests.yml index fd5454a1f..bd53ece8a 100644 --- a/.github/workflows/pr-tests.yml +++ b/.github/workflows/pr-check-tests.yml @@ -1,4 +1,4 @@ -name: CI for PictoPy +name: Linting and Tests on: pull_request: diff --git a/frontend/src-tauri/tauri.conf.json b/frontend/src-tauri/tauri.conf.json index 914cf3960..b180d4357 100644 --- a/frontend/src-tauri/tauri.conf.json +++ b/frontend/src-tauri/tauri.conf.json @@ -29,7 +29,7 @@ } }, "productName": "PictoPy", - "version": "0.0.1", + "version": "0.0.3", "identifier": "com.yourcompany.pictopy", "plugins": { "fs": { From 63d24a323e6c0898cd1af13356c10fe80781715e Mon Sep 17 00:00:00 2001 From: rahulharpal1603 Date: Sat, 5 Jul 2025 17:13:31 +0530 Subject: [PATCH 02/12] Change names --- .github/workflows/pr-check-build.yml | 5 ++--- .github/workflows/pr-check-tests.yml | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr-check-build.yml b/.github/workflows/pr-check-build.yml index feea90b1f..db7090b8d 100644 --- a/.github/workflows/pr-check-build.yml +++ b/.github/workflows/pr-check-build.yml @@ -1,13 +1,12 @@ -name: Tauri and Server Build Check +name: PR Check on: - pull_request_review: - types: [submitted] pull_request: paths: - "frontend/**" jobs: tauri-build-check: + name: Tauri Build Check strategy: fail-fast: false matrix: diff --git a/.github/workflows/pr-check-tests.yml b/.github/workflows/pr-check-tests.yml index bd53ece8a..86035076f 100644 --- a/.github/workflows/pr-check-tests.yml +++ b/.github/workflows/pr-check-tests.yml @@ -1,4 +1,4 @@ -name: Linting and Tests +name: PR Check on: pull_request: From 6ba843c951a97b9ba7ce82e4998148c785dfc05b Mon Sep 17 00:00:00 2001 From: rahulharpal1603 Date: Sat, 5 Jul 2025 18:39:56 +0530 Subject: [PATCH 03/12] Update public key and latest.json path --- .github/workflows/build-and-release.yml | 4 ++-- .github/workflows/pr-check-build.yml | 4 ++-- README.md | 2 +- frontend/src-tauri/tauri.conf.json | 18 ++++++++++++------ 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index f002068e9..4a8e6e00e 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -186,8 +186,8 @@ jobs: - uses: tauri-apps/tauri-action@v0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - TAURI_SIGNING_PRIVATE_KEY: dW50cnVzdGVkIGNvbW1lbnQ6IHJzaWduIGVuY3J5cHRlZCBzZWNyZXQga2V5ClJXUlRZMEl5YzZCUHNpNjQzalN3SllaeGI0TUU1Ky9VQjZOZjI0aklxdXJ6WVhrTEVVUUFBQkFBQUFBQUFBQUFBQUlBQUFBQWxRSUV5LzJkSXlMWUZrWE44MC9HQXFKQ1piYkhDUmJvTDlIVnlPQXpKeFJTWVBDdGZCcHp6RGpJMTlTWkp0RGhCNzRyT2lHc0JsYWFBTTdzcEN0ZnNuaE1EcjZxYWlEOHArbU9hcnFIUjUvQ1VpOERGeU55M2ttZE5xNnBvSE5ONllGOWN0YmkvS289Cg== - TAURI_SIGNING_PRIVATE_KEY_PASSWORD: 123456 + TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY}} + TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} with: projectPath: ./frontend tagName: app-v__VERSION__ diff --git a/.github/workflows/pr-check-build.yml b/.github/workflows/pr-check-build.yml index db7090b8d..78af87f22 100644 --- a/.github/workflows/pr-check-build.yml +++ b/.github/workflows/pr-check-build.yml @@ -56,8 +56,8 @@ jobs: - uses: tauri-apps/tauri-action@v0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - TAURI_SIGNING_PRIVATE_KEY: dW50cnVzdGVkIGNvbW1lbnQ6IHJzaWduIGVuY3J5cHRlZCBzZWNyZXQga2V5ClJXUlRZMEl5NlF2SjE3cWNXOVlQQ0JBTlNITEpOUVoyQ3ZuNTdOSkwyNE1NN2RmVWQ1a0FBQkFBQUFBQUFBQUFBQUlBQUFBQU9XOGpTSFNRd0Q4SjNSbm5Oc1E0OThIUGx6SS9lWXI3ZjJxN3BESEh1QTRiQXlkR2E5aG1oK1g0Tk5kcmFzc0IvZFZScEpubnptRkxlbDlUR2R1d1Y5OGRSYUVmUGoxNTFBcHpQZ1dSS2lHWklZVHNkV1Byd1VQSnZCdTZFWlVGOUFNVENBRlgweUU9Cg== - TAURI_SIGNING_PRIVATE_KEY_PASSWORD: pass + TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY}} + TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} with: projectPath: ./frontend args: ${{ matrix.args }} diff --git a/README.md b/README.md index 35a4c6bc1..5910dbc34 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,7 @@ npm run tauri signer generate Set the public key in tauri.conf.json as pubkey and private key and password in Environment Variables as TAURI_SIGNING_PRIVATE_KEY and TAURI_SIGNING_PRIVATE_KEY_PASSWORD -There is a preset pubkey in tauri.conf.json ; private key and password for it is: +This is just an example of what a private key and its password would look like: ```bash TAURI_SIGNING_PRIVATE_KEY=dW50cnVzdGVkIGNvbW1lbnQ6IHJzaWduIGVuY3J5cHRlZCBzZWNyZXQga2V5ClJXUlRZMEl5NlF2SjE3cWNXOVlQQ0JBTlNITEpOUVoyQ3ZuNTdOSkwyNE1NN2RmVWQ1a0FBQkFBQUFBQUFBQUFBQUlBQUFBQU9XOGpTSFNRd0Q4SjNSbm5Oc1E0OThIUGx6SS9lWXI3ZjJxN3BESEh1QTRiQXlkR2E5aG1oK1g0Tk5kcmFzc0IvZFZScEpubnptRkxlbDlUR2R1d1Y5OGRSYUVmUGoxNTFBcHpQZ1dSS2lHWklZVHNkV1Byd1VQSnZCdTZFWlVGOUFNVENBRlgweUU9Cg== diff --git a/frontend/src-tauri/tauri.conf.json b/frontend/src-tauri/tauri.conf.json index b180d4357..22eeb18a9 100644 --- a/frontend/src-tauri/tauri.conf.json +++ b/frontend/src-tauri/tauri.conf.json @@ -7,7 +7,11 @@ }, "bundle": { "active": true, - "targets": ["nsis", "deb", "dmg", "app"], + "targets": [ + "nsis", + "deb", + "app" + ], "createUpdaterArtifacts": true, "linux": { "deb": { @@ -29,16 +33,16 @@ } }, "productName": "PictoPy", - "version": "0.0.3", + "version": "0.1.0", "identifier": "com.yourcompany.pictopy", "plugins": { "fs": { "requireLiteralLeadingDot": true }, "updater": { - "pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IEM5REMxNjMwRjgyRjM2OUIKUldTYk5pLzRNQmJjeWVWMTdLWkNxazNiQTY3YkNVKzZva1U3c2taM3lSOGZvTzJzdnJtNVRvakMK", + "pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDhGNzZCQTA5NDE3MzYzOUEKUldTYVkzTkJDYnAyaitmMzAzWFMreHpPd1NzWTNXUEVjQnlVRmcrNWp5Rnk2WHRScVZGQlBLTk4K", "endpoints": [ - "https://github.com/rahulharpal1603/PictoPy/releases/latest/download/latest.json" + "https://github.com/AOSSIE-Org/PictoPy/releases/latest/download/latest.json" ] } }, @@ -57,10 +61,12 @@ ], "security": { "assetProtocol": { - "scope": ["**"], + "scope": [ + "**" + ], "enable": true }, "csp": null } } -} +} \ No newline at end of file From 500c3638f2da47c5d963bd76155d3ede9dbf770b Mon Sep 17 00:00:00 2001 From: rahulharpal1603 Date: Sat, 5 Jul 2025 18:41:07 +0530 Subject: [PATCH 04/12] fix lint errors --- frontend/src-tauri/tauri.conf.json | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/frontend/src-tauri/tauri.conf.json b/frontend/src-tauri/tauri.conf.json index 22eeb18a9..5bb482d3f 100644 --- a/frontend/src-tauri/tauri.conf.json +++ b/frontend/src-tauri/tauri.conf.json @@ -7,11 +7,7 @@ }, "bundle": { "active": true, - "targets": [ - "nsis", - "deb", - "app" - ], + "targets": ["nsis", "deb", "app"], "createUpdaterArtifacts": true, "linux": { "deb": { @@ -61,12 +57,10 @@ ], "security": { "assetProtocol": { - "scope": [ - "**" - ], + "scope": ["**"], "enable": true }, "csp": null } } -} \ No newline at end of file +} From 32653abe593b2b5323db12c53be06f704e04ac95 Mon Sep 17 00:00:00 2001 From: rahulharpal1603 Date: Sat, 5 Jul 2025 23:16:37 +0530 Subject: [PATCH 05/12] Delete old actions runs --- .github/workflows/del.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .github/workflows/del.yml diff --git a/.github/workflows/del.yml b/.github/workflows/del.yml new file mode 100644 index 000000000..c321904d2 --- /dev/null +++ b/.github/workflows/del.yml @@ -0,0 +1,12 @@ +on: + pull_request: + +jobs: + delete-old-actions: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: yanovation/delete-old-actions@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + days-ago: 30 From 7a4fc8f2969e345131f5ea76cf29e0d0a61d885c Mon Sep 17 00:00:00 2001 From: rahulharpal1603 Date: Sat, 5 Jul 2025 23:24:58 +0530 Subject: [PATCH 06/12] remove workflow --- .github/workflows/del.yml | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 .github/workflows/del.yml diff --git a/.github/workflows/del.yml b/.github/workflows/del.yml deleted file mode 100644 index c321904d2..000000000 --- a/.github/workflows/del.yml +++ /dev/null @@ -1,12 +0,0 @@ -on: - pull_request: - -jobs: - delete-old-actions: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: yanovation/delete-old-actions@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - days-ago: 30 From f1d02860bf750a2164040ebf7a02c9e71c9f89ea Mon Sep 17 00:00:00 2001 From: rahulharpal1603 Date: Sun, 6 Jul 2025 00:06:23 +0530 Subject: [PATCH 07/12] Add missing setup files --- .github/workflows/pr-check-build.yml | 2 +- docs/Manual_Setup_Guide.md | 131 +++++++++++++++++++++++++++ docs/Script_Setup_Guide.md | 80 ++++++++++++++++ docs/backend/docker-setup.md | 107 ++++++++++++++++++++++ docs/frontend/docker-setup.md | 129 ++++++++++++++++++++++++++ frontend/src-tauri/tauri.conf.json | 14 ++- 6 files changed, 458 insertions(+), 5 deletions(-) create mode 100644 docs/Manual_Setup_Guide.md create mode 100644 docs/Script_Setup_Guide.md create mode 100644 docs/backend/docker-setup.md create mode 100644 docs/frontend/docker-setup.md diff --git a/.github/workflows/pr-check-build.yml b/.github/workflows/pr-check-build.yml index 78af87f22..7d2765479 100644 --- a/.github/workflows/pr-check-build.yml +++ b/.github/workflows/pr-check-build.yml @@ -1,4 +1,4 @@ -name: PR Check +name: PR Check Build on: pull_request: paths: diff --git a/docs/Manual_Setup_Guide.md b/docs/Manual_Setup_Guide.md new file mode 100644 index 000000000..dc3b5d917 --- /dev/null +++ b/docs/Manual_Setup_Guide.md @@ -0,0 +1,131 @@ +## Manual Setup Guide + +### Initial Steps: + +#### 1. Fork the PictoPy repository: https://github.com/AOSSIE-Org/PictoPy + +#### 2. Open your Terminal (Linux/MacOS) or Powershell (Windows) + +#### 3. Clone your forked repository: + +```bash +git clone https://github.com/yourUsername/PictoPy +``` + +#### 4. Change to the repository directory: + +```bash +cd PictoPy +``` + +#### 5. Add the main repository as "upstream": + +```bash +git remote add upstream https://github.com/AOSSIE-Org/PictoPy +``` + +### Tauri Frontend Setup: + +1. **Install Tauri prerequisites based on your OS using this** [guide](https://tauri.app/start/prerequisites/). + +2. **Navigate to the Frontend Directory:** Open your terminal and use `cd` to change directories: + ``` + cd frontend + ``` +3. **Install Dependencies**: + ``` + npm install + ``` +4. **Start the Tauri desktop app in development mode** + ``` + npm run tauri dev + ``` + +### Python (FastAPI) Backend Setup Steps: + +> **Note:** For backend setup make sure that you have **Python version 3.12**. Additionally, for Windows, make sure that you are using Powershell for the setup, not command prompt. + +1. **Navigate to the Backend Directory:** Open your terminal and use `cd` to change directories: + + Bash + + ``` + cd backend + ``` + +2. **Set Up a Virtual Environment (Highly Recommended):** Virtual environments isolate project dependencies. Create one using: + + Bash(Linux/MacOS) + + ``` + python3 -m venv .env + ``` + + Powershell(Windows) + + ``` + python -m venv .env + ``` + +3. **Activate the Virtual Environment:** + + Bash(Linux/MacOS) + + ``` + source .env/bin/activate + ``` + + Powershell(Windows) + + ``` + .env\Scripts\activate.ps1 + ``` + + After activating, you should be able to see the virtual environment's name before the current path. Something like this: + + ![alt text](/docs/assets/screenshots/virtualEnv.png) + +4. **Install Dependencies:** The `requirements.txt` file lists required packages. Install them using pip: + + Bash + + ``` + pip install -r requirements.txt + ``` + +5. **Running the backend:**: To start the backend in development mode, run this command while being in the backend folder and the virtual environment activated: + + Bash/Powershell + + ``` + fastapi dev + ``` + + The server will start on `http://localhost:8000` by default. In test mode, the server will automatically restart if any errors are detected or if source files are modified. + + ![alt text](/docs/assets/screenshots/serverRunning.png) + +6. **Missing System Dependencies:** Some dependencies might need system-level libraries like `libGL.so.1` (often needed by OpenCV). Install the appropriate packages based on your distribution: + + **Debian/Ubuntu:** + + Bash + + ``` + sudo apt update + sudo apt install -y libglib2.0-dev libgl1-mesa-glx + + ``` + + **Other Systems:** Consult your distribution's documentation for installation instructions. + +7. **`gobject-2.0` Not Found Error:** Resolve this error by installing `libglib2.0-dev` (Debian/Ubuntu): + + Bash + + ``` + sudo apt install -y libglib2.0-dev pkg-config + + ``` + + For other systems, consult your distribution's documentation. diff --git a/docs/Script_Setup_Guide.md b/docs/Script_Setup_Guide.md new file mode 100644 index 000000000..f2e08f73f --- /dev/null +++ b/docs/Script_Setup_Guide.md @@ -0,0 +1,80 @@ +## Setting Up using Script + +### Video Setup Guide: + +- [Windows](https://youtu.be/nNVAE4or280?si=j_y9Xn8Kra6tPHjw) +- [Ubuntu (Debian)](https://www.youtube.com/watch?v=a7I0ZRE-SHk) + +### Prerequisites: + +- [NodeJS](https://nodejs.org/en) (LTS Version Recommended) +- [Git](https://git-scm.com/downloads) version control system + +### Steps Performed in the Video: + +1. Fork the PictoPy repository: https://github.com/AOSSIE-Org/PictoPy + +2. Open your terminal (or Powershell with administrator privileges on Windows) + +3. Clone your forked repository: + + ```bash + git clone https://github.com/yourUsername/PictoPy + ``` + +4. Change to the repository directory: + + ```bash + cd PictoPy + ``` + +5. Add the main repository as "upstream": + + ```bash + git remote add upstream https://github.com/AOSSIE-Org/PictoPy + ``` + +6. Run the Automatic Setup + + ```bash + npm run setup + ``` + + > **Note:** This step can take a long time depending on your internet connection and system specifications. If the script seems to stop progressing after waiting for more than 10 minutes, press Enter in your terminal window to continue. + +7. Start the Backend Server + + #### Windows + + ```powershell + cd .\backend + .env\Scripts\activate.ps1 + fastapi dev + ``` + + #### Linux + + ```bash + cd ./backend + source .env/bin/activate + fastapi dev + ``` + +8. Start the Frontend Desktop App + + Open a new terminal window, navigate to the project directory, and run: + + ```bash + cd frontend + npm run tauri dev + ``` + +9. Pre-commit Setup + + Before running the `git commit` command, ensure you have the following Python packages installed globally: + + ```bash + pip install ruff black mypy pre-commit + ``` + + > **Note:** If you are committing from a virtual environment, these packages should already be installed as they are included in the requirements.txt file. diff --git a/docs/backend/docker-setup.md b/docs/backend/docker-setup.md new file mode 100644 index 000000000..d06cb7d46 --- /dev/null +++ b/docs/backend/docker-setup.md @@ -0,0 +1,107 @@ +# Backend Docker Setup for PictoPy + +This guide provides step-by-step instructions for building and running the PictoPy backend using Docker. + +## Table of Contents + +1. [Prerequisites](#prerequisites) +2. [Building the Docker Image](#building-the-docker-image) +3. [Running the Docker Container](#running-the-docker-container) +4. [Verifying the Container](#verifying-the-container) +5. [Accessing the Application](#accessing-the-application) +6. [Stopping the Container](#stopping-the-container) +7. [Troubleshooting](#troubleshooting) + +## Prerequisites + +Before you begin, ensure you have the Docker installed on your machine + +- Verify the installation by running: + ```bash + docker --version + ``` + +## Building the Docker Image + +1. Open a terminal and navigate to your project's root directory. + +2. Go to Backend directory + + ```bash + cd backend + ``` + +3. Run the following command to build the Docker image, replacing `` with your desired image name: + + ```bash + docker build -t . + ``` + +4. Wait for the build process to complete. This may take a few minutes depending on your internet speed and system performance. + +## Running the Docker Container + +Once the image is built, you can run a container using the following command: + +```bash +docker run -it --name backend-container -p 8000:8000 \ +-v images-data:/app/images \ +-v /:/host \ + +``` + +- `-it`: Runs the container interactively, attaching to the terminal for input/output. +- `-p 8000:8000`: Maps port 8000 on the host to port 8000 in the container. +- `-v`: Mounts a volume to share data between the host and container. +- ``: Specifies the image to use (the one we just built). + +## Verifying the Container + +To check if the container is running: + +```bash +docker ps +``` + +You should see an entry for `` with the status `Up`. + +## Accessing the Application + +Open a web browser or frontend to access the application at: + +``` +http://localhost:8000 +``` + +## Stopping the Container + +If you need to stop the container: + +```bash +docker kill +``` + +## Troubleshooting + +1. **Port already in use**: If you get an error saying the port is already in use, you can either: + + - Stop the process using port 8000, or + - Change the port mapping in the `docker run` command (e.g., `-p 8001:8000`) + +2. **Container exits immediately**: Check the container logs: + + ```bash + docker logs + ``` + +3. **Permission issues**: Ensure that `run.sh` has execute permissions(for linux only): + + ```bash + chmod +x run.sh + ``` + + Then rebuild the Docker image. + +Remember to rebuild your Docker image (`docker build -t .`) after making any changes to your application or Dockerfile. + +For more advanced Docker usage , view the [Docker documentation](https://docs.docker.com/get-started/). diff --git a/docs/frontend/docker-setup.md b/docs/frontend/docker-setup.md new file mode 100644 index 000000000..d1c9c23bb --- /dev/null +++ b/docs/frontend/docker-setup.md @@ -0,0 +1,129 @@ +# Docker Setup for PictoPy Frontend + +This guide provides instructions for building and running the PictoPy frontend using Docker. + +## Table of Contents + +1. [Prerequisites](#prerequisites) +2. [Building the Docker Image](#building-the-docker-image) +3. [Running the Container](#running-the-container) + - [Linux](#linux) + - [Windows](#windows) +4. [Accessing the GUI App](#accessing-the-gui-app) +5. [Common Troubleshooting](#common-troubleshooting) +6. [Notes on Cross-Platform Compatibility](#notes-on-cross-platform-compatibility) + +## Prerequisites + +- Docker installed on your system +- For Windows: An X Server (e.g., VcXsrv or Xming) +- For Linux : An X server also installed + ```bash + sudo apt install x + ``` + +## Building the Docker Image + +1. Open a terminal and navigate to your project's root directory. + +2. Go to Frontend directory + + ```bash + cd frontend + ``` + +3. Run the following command to build the Docker image, replacing `` with your desired image name: + + ```bash + docker build --build-arg TAURI_SIGNING_PRIVATE_KEY= --build-arg TAURI_SIGNING_PRIVATE_KEY_PASSWORD= -t . + ``` + + Replace and with your actual Tauri signing private key and password and with the image name. If you are using the default key, you can use the following command: + + ```bash + docker build --build-arg TAURI_SIGNING_PRIVATE_KEY=dW50cnVzdGVkIGNvbW1lbnQ6IHJzaWduIGVuY3J5cHRlZCBzZWNyZXQga2V5ClJXUlRZMEl5NlF2SjE3cWNXOVlQQ0JBTlNITEpOUVoyQ3ZuNTdOSkwyNE1NN2RmVWQ1a0FBQkFBQUFBQUFBQUFBQUlBQUFBQU9XOGpTSFNRd0Q4SjNSbm5Oc1E0OThIUGx6SS9lWXI3ZjJxN3BESEh1QTRiQXlkR2E5aG1oK1g0Tk5kcmFzc0IvZFZScEpubnptRkxlbDlUR2R1d1Y5OGRSYUVmUGoxNTFBcHpQZ1dSS2lHWklZVHNkV1Byd1VQSnZCdTZFWlVGOUFNVENBRlgweUU9Cg== --build-arg TAURI_SIGNING_PRIVATE_KEY_PASSWORD=pass -t . + ``` + +## Running the Container + +### Linux + +1. Allow X11 forwarding: + + ```bash + xhost +local:docker + ``` + +2. Run the container: + + ```bash + docker run -it --name frontend-container --network host -p 1420:1420 -e DISPLAY=${DISPLAY} \ + -v /tmp/.X11-unix:/tmp/.X11-unix \ + -v images-data:/app/images \ + -v /:/host \ + + ``` + +### Windows + +1. Start an X Server: + + - Launch VcXsrv or Xming. + - Configure it to allow connections from any host. + +2. Find your host machine's IP address: + + - Open Command Prompt and run `ipconfig`. + - Look for the IPv4 Address under your active network adapter. + +3. Run the container: + + ```bash + docker run -it -p 1420:1420 -e DISPLAY=:0.0 + ``` + +Replace `` with your actual IP address. + +4. Run the tauri application + ```bash + npm run tauri dev + ``` + +## Building the Tauri App + +### Linux + +```bash + npm run tauri build +``` + +### Windows + +```bash + npm run tauri build -- --runner cargo-xwin --target x86_64-pc-windows-msvc +``` + +## Accessing the GUI App + +If everything is configured correctly, the Tauri GUI app should display on your screen after running the container. + +## Common Troubleshooting + +### 1. GUI Not Displaying (X Server Issues) + +- **Windows**: + + - Ensure the X server (VcXsrv or Xming) is running. + - Check that it's configured to allow connections from any host. + +- **Linux**: + - Verify X11 forwarding is allowed: `xhost +local:docker` + +### 2. Network Issues + +If the container can't connect to the X server: + +1. Check your firewall settings and ensure it's not blocking the connection. +2. On Windows, try using the host's IP address instead of localhost. + +By following this guide and keeping these notes in mind, you should be able to successfully set up and run the PictoPy frontend using Docker across different platforms. If you encounter any persistent issues, please refer to the project's issue tracker or seek assistance from the development team. diff --git a/frontend/src-tauri/tauri.conf.json b/frontend/src-tauri/tauri.conf.json index 5bb482d3f..99692e1b4 100644 --- a/frontend/src-tauri/tauri.conf.json +++ b/frontend/src-tauri/tauri.conf.json @@ -7,7 +7,11 @@ }, "bundle": { "active": true, - "targets": ["nsis", "deb", "app"], + "targets": [ + "nsis", + "deb", + "app" + ], "createUpdaterArtifacts": true, "linux": { "deb": { @@ -36,7 +40,7 @@ "requireLiteralLeadingDot": true }, "updater": { - "pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDhGNzZCQTA5NDE3MzYzOUEKUldTYVkzTkJDYnAyaitmMzAzWFMreHpPd1NzWTNXUEVjQnlVRmcrNWp5Rnk2WHRScVZGQlBLTk4K", + "pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDEzOTBGRjhEM0E3M0U0OUMKUldTYzVITTZqZitRRXdDVmhhMFVhaXkxa0tVUHluZzB6Y0dnRXg0cHMzZHZkMy85MnFKYmFuRzkK", "endpoints": [ "https://github.com/AOSSIE-Org/PictoPy/releases/latest/download/latest.json" ] @@ -57,10 +61,12 @@ ], "security": { "assetProtocol": { - "scope": ["**"], + "scope": [ + "**" + ], "enable": true }, "csp": null } } -} +} \ No newline at end of file From ef5904f95cc953a045a2f52fc088e24218194a89 Mon Sep 17 00:00:00 2001 From: rahulharpal1603 Date: Sun, 6 Jul 2025 00:10:11 +0530 Subject: [PATCH 08/12] fix lint errors --- frontend/src-tauri/tauri.conf.json | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/frontend/src-tauri/tauri.conf.json b/frontend/src-tauri/tauri.conf.json index 99692e1b4..c74e6e165 100644 --- a/frontend/src-tauri/tauri.conf.json +++ b/frontend/src-tauri/tauri.conf.json @@ -7,11 +7,7 @@ }, "bundle": { "active": true, - "targets": [ - "nsis", - "deb", - "app" - ], + "targets": ["nsis", "deb", "app"], "createUpdaterArtifacts": true, "linux": { "deb": { @@ -61,12 +57,10 @@ ], "security": { "assetProtocol": { - "scope": [ - "**" - ], + "scope": ["**"], "enable": true }, "csp": null } } -} \ No newline at end of file +} From 8898ec654cfa522d435762b7bdac225aee88a720 Mon Sep 17 00:00:00 2001 From: rahulharpal1603 Date: Sun, 6 Jul 2025 00:26:44 +0530 Subject: [PATCH 09/12] use sample key for pr-checks --- .github/workflows/pr-check-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-check-build.yml b/.github/workflows/pr-check-build.yml index 7d2765479..51307f8f2 100644 --- a/.github/workflows/pr-check-build.yml +++ b/.github/workflows/pr-check-build.yml @@ -56,8 +56,8 @@ jobs: - uses: tauri-apps/tauri-action@v0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY}} - TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} + TAURI_SIGNING_PRIVATE_KEY: ${{ vars.TAURI_SAMPLE_KEY}} + TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ vars.TAURI_SAMPLE_KEY_PASS }} with: projectPath: ./frontend args: ${{ matrix.args }} From e0808e67929e95dc02368629e3da0c73a72b06a6 Mon Sep 17 00:00:00 2001 From: rahulharpal1603 Date: Sun, 6 Jul 2025 00:33:45 +0530 Subject: [PATCH 10/12] debug key error --- .github/workflows/pr-check-build.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-check-build.yml b/.github/workflows/pr-check-build.yml index 51307f8f2..972607df9 100644 --- a/.github/workflows/pr-check-build.yml +++ b/.github/workflows/pr-check-build.yml @@ -41,6 +41,8 @@ jobs: run: | cd frontend npm install + echo ${{vars.TAURI_SAMPLE_KEY}} + echo ${{vars.TAURI_SAMPLE_KEY_PASS}} - name: cache cargo registry and build uses: actions/cache@v3 @@ -56,8 +58,8 @@ jobs: - uses: tauri-apps/tauri-action@v0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - TAURI_SIGNING_PRIVATE_KEY: ${{ vars.TAURI_SAMPLE_KEY}} - TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ vars.TAURI_SAMPLE_KEY_PASS }} + TAURI_SIGNING_PRIVATE_KEY: ${{vars.TAURI_SAMPLE_KEY}} + TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{vars.TAURI_SAMPLE_KEY_PASS}} with: projectPath: ./frontend args: ${{ matrix.args }} From 62995a3ac25b237b3d1a31aa56e5e2cf68dd2fa4 Mon Sep 17 00:00:00 2001 From: rahulharpal1603 Date: Sun, 6 Jul 2025 00:42:20 +0530 Subject: [PATCH 11/12] add sample key --- .github/workflows/pr-check-build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-check-build.yml b/.github/workflows/pr-check-build.yml index 972607df9..d56ceafb8 100644 --- a/.github/workflows/pr-check-build.yml +++ b/.github/workflows/pr-check-build.yml @@ -58,8 +58,9 @@ jobs: - uses: tauri-apps/tauri-action@v0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - TAURI_SIGNING_PRIVATE_KEY: ${{vars.TAURI_SAMPLE_KEY}} - TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{vars.TAURI_SAMPLE_KEY_PASS}} + # Don't worry, the below key is just a sample key for PR-Checks. Actual app build workflow uses a secret private key :) + TAURI_SIGNING_PRIVATE_KEY: dW50cnVzdGVkIGNvbW1lbnQ6IHJzaWduIGVuY3J5cHRlZCBzZWNyZXQga2V5ClJXUlRZMEl5TzhIVE9SbEtZZThpM2RvQWpvV09wZXlEOXR0cVRsVUs3NlR2NXhRTUJsSUFBQkFBQUFBQUFBQUFBQUlBQUFBQTBVZE5kNmR4ZHdScUtDWURsNWtweXQwem01WlJobXQzSmNtQUZydnNrb0UvSzJKQnM0b2ZRcSt6eElmaHFHZ3VzVkRrRkdtSC9jcGVRMDJzZlR3RDRta3V2UDBNdzRUSU1LQlo0dk43NHRHZGdaYTNPbndhYU14YmdqN1Y3VkNRb2l2bDF4NDQ5Tk09Cg== + TAURI_SIGNING_PRIVATE_KEY_PASSWORD: abcd with: projectPath: ./frontend args: ${{ matrix.args }} From 19824bc325fd1f1f47888efbe3eab1a0f0afcbdb Mon Sep 17 00:00:00 2001 From: rahulharpal1603 Date: Sun, 6 Jul 2025 00:52:08 +0530 Subject: [PATCH 12/12] Minor changes --- .github/workflows/pr-check-build.yml | 2 -- CONTRIBUTING.md | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr-check-build.yml b/.github/workflows/pr-check-build.yml index d56ceafb8..79c8331be 100644 --- a/.github/workflows/pr-check-build.yml +++ b/.github/workflows/pr-check-build.yml @@ -41,8 +41,6 @@ jobs: run: | cd frontend npm install - echo ${{vars.TAURI_SAMPLE_KEY}} - echo ${{vars.TAURI_SAMPLE_KEY_PASS}} - name: cache cargo registry and build uses: actions/cache@v3 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0a2778ffb..04850b46a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -48,9 +48,9 @@ Create Signing Keys for tauri using the command: npm run tauri signer generate ``` -Set the public key in tauri.conf.json as pubkey and private key and password in Environment Variables as TAURI_SIGNING_PRIVATE_KEY and TAURI_SIGNING_PRIVATE_KEY_PASSWORD +Set the public key in tauri.conf.json as pubkey and private key and password in Environment Variables(of your terminal) as TAURI_SIGNING_PRIVATE_KEY and TAURI_SIGNING_PRIVATE_KEY_PASSWORD -There is a preset pubkey in tauri.conf.json ; private key and password for it is: +As an **example** of the private key would look like this: ```bash TAURI_SIGNING_PRIVATE_KEY=dW50cnVzdGVkIGNvbW1lbnQ6IHJzaWduIGVuY3J5cHRlZCBzZWNyZXQga2V5ClJXUlRZMEl5NlF2SjE3cWNXOVlQQ0JBTlNITEpOUVoyQ3ZuNTdOSkwyNE1NN2RmVWQ1a0FBQkFBQUFBQUFBQUFBQUlBQUFBQU9XOGpTSFNRd0Q4SjNSbm5Oc1E0OThIUGx6SS9lWXI3ZjJxN3BESEh1QTRiQXlkR2E5aG1oK1g0Tk5kcmFzc0IvZFZScEpubnptRkxlbDlUR2R1d1Y5OGRSYUVmUGoxNTFBcHpQZ1dSS2lHWklZVHNkV1Byd1VQSnZCdTZFWlVGOUFNVENBRlgweUU9Cg==