Local Development Setup
This guide covers setting up nsyte for local development and testing your sites before deployment.
Prerequisites
- Deno 2.0 or later
- Git
- A bunker-compatible signer (Amber, Alby, etc.)
Development Installation
Option 1: Install from Source
git clone https://github.com/sandwichfarm/nsyte.git
cd nsyte
deno task compileOption 2: Install from JSR
# Install latest from JSR
deno install -A -f -g -n nsyte jsr:@nsyte/cliOption 3: Development Build from Source
git clone https://github.com/sandwichfarm/nsyte.git
cd nsyte
deno install -A -f -g -n nsyte src/cli.tsTesting Your Setup
Initialize a Test Project
mkdir test-site
cd test-site
nsyte initDuring initialization:
- Connect your bunker signer when prompted
- Configure at least one relay for testing
- Optionally configure blossom servers
Create Test Content
echo "<html><body><h1>Test Site</h1></body></html>" > index.html
echo "# Test" > README.mdTest Deploy
nsyte deploy .Verify Deployment
nsyte listThe canonical command is list; ls is also accepted as an alias (see the list command reference).
Local Development Workflow
Building Your Site
Build your static site using your preferred tools:
# React/Next.js
npm run build
# Jekyll
bundle exec jekyll build
# Hugo
hugo
# Or any other static site generatorTesting Before Deploy
Test locally before uploading:
# Serve locally first
python -m http.server 8000
# or
npx serve dist/Deploy to Test Environment
# Deploy to staging relays first
nsyte deploy ./dist --relays "wss://test-relay.example.com"Development Commands
Build Commands
# Build for current platform
deno task compile
# Build for all platforms
deno task compile:all
# Run tests
deno task testDebug Mode
Use verbose output for debugging:
nsyte deploy . --verboseConfiguration Tips
Multiple Environments
Use the global -c, --config <path> flag (inherited by every subcommand) to target a different config file per environment. The flag accepts an absolute path or one relative to the current working directory; the default is .nsite/config.json.
# Development
nsyte --config .nsyte-dev.json init
# Production
nsyte --config .nsyte-prod.json init
# The flag works on every subcommand:
nsyte --config .nsyte-prod.json deploy ./distIgnore Files
Create .nsyte-ignore to exclude development files:
node_modules/
.git/
*.log
.env
.nsyte-dev.jsonThe legacy filename .nsite-ignore is also recognized by the file scanner for backwards compatibility, but .nsyte-ignore is the canonical name (matching the README and configuration reference).
Troubleshooting
Common Issues
Permission Errors
- Ensure Deno has necessary permissions
- Check file system permissions
- Verify bunker connection
Connection Issues
- Test relay connectivity manually
- Check network/firewall settings
- Verify relay URLs are correct
Authentication Problems
- Reconnect bunker signer
- Check bunker permissions
- Generate new CI token if needed