A minimal example SyftUI application demonstrating a simple setup with:
- Frontend: Next.js app that displays "Hello World"
- Backend: FastAPI server with SyftBox integration
- Cron Job: Background task that logs periodically
- SyftBox Integration: Proper
run.shand SyftBox client connection
- Copy this directory to your SyftBox apps folder
- SyftBox will automatically run
./run.shto start the app - Visit the assigned port in your browser
- Install dependencies:
just install- Run the development server:
just dev- Open your browser to http://localhost:3000
run.sh- SyftBox app entry point (called by SyftBox)requirements.txt- Dependencies for SyftBox deploymentbackend/- FastAPI server with SyftBox client integrationfrontend/- Next.js React appsrc/syft_syftui_example/- Python cron job componentjustfile- Build and run commands for development
This app properly integrates with SyftBox by:
run.sh: Main entry point with proper SyftBox logging format- Port handling: Uses
SYFTBOX_ASSIGNED_PORTenvironment variable - SyftBox client: Connects to SyftBox filesystem and shows user email
- Virtual environment: Sets up clean Python environment with
uv - Frontend building: Builds Next.js app as part of startup
just dev- Run both frontend and backend in development modejust install- Install all dependenciesjust build- Build the frontendjust cron- Run the cron job component./run.sh- Run as SyftBox would (for testing)
- Ensure SyftBox is installed and you're logged in
- Copy this directory to your SyftBox apps folder
- SyftBox will handle the rest via
run.sh
This is a minimal but complete template for SyftUI applications.