Development Setup
Local development with Docker dev mode and Vite HMR
For local dev you can use Docker dev mode (recommended) or run PHP and Node directly on the host.
Docker development mode
cd nixstream/nixstream
./install.sh --devThis enables:
- Source bind mounts (edit PHP/JS without rebuilding images)
- Vite dev server on port 5173 with HMR
- Same Docker services as production (MySQL, Redis, queue, live)
Access the app at http://localhost (or whatever you set in APP_PORT). Vite proxies through the nginx container in dev mode.
Dev vs production Docker
./install.sh bakes code into the image and serves built frontend assets; rebuild after changes. ./install.sh --dev bind-mounts source from the host and runs Vite HMR on 5173, so PHP and JS edits land without rebuilding. Use plain install for staging or production-like runs; use --dev while you are actively hacking on the app.
Frontend development
cd nixstream/nixstream
npm run devVite serves the React admin panel with hot module replacement. Changes to resources/js/ reflect instantly in the browser.
Frontend stack
- React 18 with TypeScript
- Vite build tool
- Tailwind CSS
- React Router for admin routes
Build for production:
npm run buildBackend commands
php artisan route:list --path=api
./vendor/bin/phpunit
php artisan queue:work redis --queue=high,default,video-encoding
php artisan tinkerRun PHPUnit inside Docker:
docker compose exec app ./vendor/bin/phpunitUseful artisan commands
| Command | Purpose |
|---|---|
php artisan migrate | Run database migrations |
php artisan db:seed | Seed default admin user |
php artisan queue:work | Process jobs manually |
php artisan config:clear | Clear config cache after .env changes |
php artisan permission:cache-reset | Refresh ACL after config/acl.php edits |
Documentation site
cd docs
npm install
npm run devOpen http://localhost:3000 for the Fumadocs documentation site.
Build docs for production:
npm run build
npm startEnvironment for development
Copy .env.docker.example (Docker) or .env.example (manual). Key dev settings:
APP_ENV=local
APP_DEBUG=true
LOG_LEVEL=debugNever use APP_DEBUG=true in production.
Watching encoding jobs
docker compose logs -f queue
docker compose exec queue supervisorctl statusTrigger a test upload from the admin panel and watch the queue process the job.
Database access
docker compose exec db mysql -u nixstream_user -p nixstreamOr use a GUI client pointed at localhost:3306 with credentials from .env.
Tips
- Use
docker compose logs -f queueto watch encoding jobs - Run
php artisan permission:cache-resetafter editingconfig/acl.php - Check
storage/logs/laravel.logfor application errors - Clear browser cache if Vite HMR stops updating (rare)
- Run
composer installafter pulling changes that updatecomposer.lock
Testing API locally
# Create API key in admin panel, then:
curl http://localhost/api/client/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY"Adjust host/port if using APP_PORT=8080.
Same stack details as Docker Installation and Manual Installation. API shapes are in the API Reference.