How aynaash/nextdeploy works
NextDeploy is a self-hosted Next.js deployment engine: users configure a target, analyze and validate a build, ship it to their own infrastructure, then verify or roll back releases. Its principal workflow spans CLI commands, build intelligence, target-specific deployment, and runtime operations. The README supports the documented workflow and major capabilities; sampled source confirms selected CLI, daemon, serverless, and request-context responsibilities. Some subsystems are represented by exact directory paths because their implementation was not sampled, so undocumented internal links are omitted.
Main entry points: cli/main.go NextDeploy CLI · nextdeployd/main.go Deployment daemon · serverless AWS and Cloudflare · ship.go Release shipping
Components 25
CLI workflow
- NextDeploy CLI
cli/main.go - Project setup
cli/cmd/init.go - Deployment plan
cli/cmd/plan.go - Release shipping
cli/cmd/ship.go - Target configuration
shared/config/server_resolve.go
Build intelligence
- Build analysis
cli/cmd/build.go - Build metadata
shared/nextbuild/build.go - Next.js inspection
shared/nextcore
Deployment targets
- VPS deployment
cli/internal/server/server.go - AWS and Cloudflare
cli/internal/serverless - Cloudflare resources
cli/internal/serverless/cloudflare - AWS resources
cli/internal/serverless/aws - Serverless packaging
internal/packaging/serverless_packager.go - Worker runtime
shared/nextcompile/runtime_src/context.mjs
Runtime operations
- Deployment daemon
daemon/cmd/nextdeployd/main.go - Service lifecycle
daemon/internal/daemon/process_manager.go - Traffic and HTTPS
daemon/internal/daemon/caddy_manager.go - Next.js sidecar
daemon/internal/daemon/sidecar_manager.go
Operational capabilities
- Log and status tools
cli/cmd/logs.go - Rollback
cli/cmd/rollback.go - Host preparation
daemon/internal/prepare/run.go - CI workflow generation
cli/internal/cicd/workflow.go - Agent trace and MCP
shared/agenttrace/trace.go - Self updater
shared/updater/updater.go
Other components
- Developer
Connections 24
- Developer → NextDeploy CLI: runs commands
cli/main.go - NextDeploy CLI → Project setup: initializes project
README.md - NextDeploy CLI → Build analysis: analyzes build
README.md - Build analysis → Build metadata: generates metadata
README.md - Build analysis → Next.js inspection: classifies routes
README.md - NextDeploy CLI → Deployment plan: validates deployment
README.md - Deployment plan → Target configuration: checks configuration
README.md - NextDeploy CLI → Release shipping: ships release
README.md - Release shipping → VPS deployment: deploys to VPS
README.md - VPS deployment → Deployment daemon: sends release
- Deployment daemon → Service lifecycle: manages services
- Deployment daemon → Traffic and HTTPS: configures routing
- Deployment daemon → Next.js sidecar: manages sidecar
- Release shipping → AWS and Cloudflare: deploys serverless
README.md - AWS and Cloudflare → AWS resources: provisions AWS
README.md - AWS and Cloudflare → Cloudflare resources: provisions Workers
README.md - AWS and Cloudflare → Serverless packaging: packages application
README.md - Cloudflare resources → Worker runtime: runs compiled app
README.md - NextDeploy CLI → Log and status tools: streams logs
README.md - NextDeploy CLI → Rollback: restores release
README.md - NextDeploy CLI → Host preparation: prepares VPS
README.md - NextDeploy CLI → CI workflow generation: generates workflows
README.md - NextDeploy CLI → Agent trace and MCP: offers trace tools
README.md - Deployment daemon → Self updater: updates daemon
daemon/cmd/nextdeployd/main.go