-
-
Notifications
You must be signed in to change notification settings - Fork 635
added dev-setup and launch script for windows, linux and MacOS #1351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
aliviahossain
wants to merge
3
commits into
AOSSIE-Org:main
Choose a base branch
from
aliviahossain:setup
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+673
−0
Open
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,162 @@ | ||
| # PictoPy Dev Setup Guide | ||
|
|
||
| This guide covers how to set up and run PictoPy locally for development on **Windows** and **Linux/macOS**. | ||
|
|
||
| --- | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| | Tool | Version | Purpose | | ||
| |------|---------|---------| | ||
| | Node.js | 18+ | Frontend build | | ||
| | Rust + Cargo | latest stable | Tauri desktop framework | | ||
| | Python | 3.12 | Backend + sync microservice | | ||
| | Conda (Miniconda) | any | Python environment management | | ||
|
|
||
| --- | ||
|
|
||
| ## Quick Start (Recommended) | ||
|
|
||
| Both scripts handle all prerequisite installation, environment setup, and launch all three services automatically. | ||
|
|
||
| ### Windows | ||
|
|
||
| Open **PowerShell** in the PictoPy root directory and run: | ||
|
|
||
| ```powershell | ||
| Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned | ||
| .\dev-setup.ps1 | ||
| ``` | ||
|
|
||
| > If prompted by Windows Defender, choose "Run anyway". | ||
|
|
||
| ### Linux / macOS | ||
|
|
||
| Open a terminal in the PictoPy root directory and run: | ||
|
|
||
| ```bash | ||
| bash dev-setup.sh | ||
| ``` | ||
|
|
||
| > On macOS, Homebrew must be installed first: https://brew.sh | ||
|
|
||
| --- | ||
|
|
||
| ## What the Scripts Do | ||
|
|
||
| Both scripts run the same four phases: | ||
|
|
||
| **Phase 1 — Prerequisites** | ||
| - Installs Node.js if missing | ||
| - Installs Rust + Cargo via rustup if missing | ||
| - Installs Visual Studio C++ Build Tools (Windows) or system libs (Linux) required by Tauri | ||
| - Installs Miniconda if missing | ||
|
|
||
| **Phase 2 — Service Setup** | ||
| - Installs frontend npm dependencies (`frontend/node_modules`) | ||
| - Creates conda environment for the backend (`backend/.env`) and installs Python packages | ||
| - Creates conda environment for the sync microservice (`sync-microservice/.sync-env`) and installs Python packages | ||
|
|
||
| **Phase 3 — Launch** | ||
| - Starts the Python backend on port `52123` | ||
| - Starts the sync microservice on port `52124` | ||
| - Starts the Tauri frontend (React + Rust) | ||
|
|
||
| **Phase 4 — Health Check** | ||
| - Verifies backend and sync microservice are reachable | ||
| - Streams logs from all three services with colour-coded prefixes (`[BACKEND]`, `[SYNC]`, `[FRONTEND]`) | ||
|
|
||
| Press **Ctrl+C** to stop all services. | ||
|
|
||
| --- | ||
|
|
||
| ## Manual Setup (Alternative) | ||
|
|
||
| If you prefer to set up each service individually: | ||
|
|
||
| ### 1. Frontend | ||
|
|
||
| ```bash | ||
| cd frontend | ||
| npm install | ||
| npm run tauri dev | ||
| ``` | ||
|
|
||
| > **Windows only:** Rust requires Visual Studio C++ Build Tools (`link.exe`). | ||
| > Install via: `winget install Microsoft.VisualStudio.2022.BuildTools --override "--quiet --wait --add Microsoft.VisualStudio.Workload.VCTools --includeRecommended"` | ||
|
|
||
| ### 2. Backend | ||
|
|
||
| ```bash | ||
| cd backend | ||
| conda create -p .env python=3.12 -y | ||
| conda run -p .env pip install -r requirements.txt | ||
| conda run -p .env python main.py | ||
| ``` | ||
|
|
||
| Backend runs at: `http://localhost:52123` | ||
|
|
||
| ### 3. Sync Microservice | ||
|
|
||
| ```bash | ||
| cd sync-microservice | ||
| conda create -p .sync-env python=3.12 -y | ||
| conda run -p .sync-env pip install -r requirements.txt | ||
| conda run -p .sync-env fastapi dev --port 52124 | ||
| ``` | ||
|
|
||
| Sync microservice runs at: `http://localhost:52124` | ||
|
|
||
| --- | ||
|
|
||
| ## Services Overview | ||
|
|
||
| | Service | Port | Description | | ||
| |---------|------|-------------| | ||
| | Backend (Python/FastAPI) | 52123 | Image processing, face recognition, albums | | ||
| | Sync Microservice (Python/FastAPI) | 52124 | File sync and watching | | ||
| | Frontend (Tauri/React) | — | Desktop app window (not a browser port) | | ||
|
|
||
| All three must be running for the app to work correctly. | ||
|
|
||
| --- | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| ### `cargo` not found after installing Rust | ||
| Close and reopen your terminal — Rust adds itself to PATH only for new sessions. | ||
|
|
||
| ### `link.exe` not found (Windows) | ||
| Visual Studio C++ Build Tools are missing. Run: | ||
| ```powershell | ||
| winget install Microsoft.VisualStudio.2022.BuildTools --override "--quiet --wait --add Microsoft.VisualStudio.Workload.VCTools --includeRecommended" | ||
| ``` | ||
| Then reopen your terminal and retry. | ||
|
|
||
| ### `chmod` not recognized (Windows) | ||
| `chmod` is a Linux command. On Windows, skip it — just run `.\dev-setup.ps1` directly. | ||
|
|
||
| ### App window opens but shows a blank page | ||
| The Python backend is not running. Start it manually: | ||
| ```bash | ||
| cd backend | ||
| conda run -p .env python main.py | ||
| ``` | ||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||
|
|
||
| ### Script fails on emoji / encoding error (Windows PowerShell) | ||
| Your PowerShell version may not support Unicode. Upgrade to PowerShell 7+: | ||
| ```powershell | ||
| winget install Microsoft.PowerShell | ||
| ``` | ||
|
|
||
| ### Port already in use | ||
| Kill the process occupying the port: | ||
| ```powershell | ||
| # Windows | ||
| netstat -ano | findstr :52123 | ||
| taskkill /PID <pid> /F | ||
| ``` | ||
| ```bash | ||
| # Linux/macOS | ||
| lsof -ti:52123 | xargs kill | ||
| ``` | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.