Development
Development
Section titled “Development”Want to contribute or build DownKingo yourself? Here’s everything you need to get started.
Prerequisites
Section titled “Prerequisites”Before you begin, ensure you have the following installed:
- Go 1.21+ — Download Go
- Bun — Fast JavaScript runtime (Install Bun)
- Wails v2 — Desktop app framework
Installing Wails
Section titled “Installing Wails”go install github.com/wailsapp/wails/v2/cmd/wails@latestVerify the installation:
wails doctorQuick Start
Section titled “Quick Start”1. Clone the Repository
Section titled “1. Clone the Repository”git clone https://github.com/down-kingo/downkingo.gitcd downkingo2. Install Frontend Dependencies
Section titled “2. Install Frontend Dependencies”cd frontend && bun install && cd ..3. Run in Development Mode
Section titled “3. Run in Development Mode”wails devThis will start the app in development mode with hot-reload enabled.
Project Structure
Section titled “Project Structure”downkingo/├── internal/ # Backend logic (Go)│ ├── auth/ # OAuth2 Device Flow│ ├── downloader/ # Queue manager and yt-dlp wrapper│ ├── roadmap/ # "Build in Public" integration│ └── storage/ # SQLite layer├── frontend/ # UI (React + Tailwind)│ ├── src/│ │ ├── components/ # React components│ │ ├── pages/ # Page views│ │ ├── hooks/ # Custom hooks│ │ └── i18n/ # Translations│ └── package.json└── build/ # Build resourcesBuilding for Production
Section titled “Building for Production”All Platforms
Section titled “All Platforms”wails buildPlatform-Specific
Section titled “Platform-Specific”# Windowswails build -platform windows/amd64
# macOS (Universal Binary)wails build -platform darwin/universal
# Linuxwails build -platform linux/amd64Development Tips
Section titled “Development Tips”Hot Reload
Section titled “Hot Reload”Wails includes hot-reload by default in dev mode. Frontend changes reload instantly, and Go changes trigger a rebuild.
Debugging
Section titled “Debugging”- Frontend: Use browser DevTools (F12 in the app window)
- Backend: Use standard Go debugging tools or add log statements
Environment Variables
Section titled “Environment Variables”Create a .env file in the root for local configuration:
GITHUB_CLIENT_ID=your_client_idDOWNKINGO_DEV_MODE=true