Skip to content

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 compile

Option 2: Install from JSR

# Install latest from JSR
deno install -A -f -g -n nsyte jsr:@nsyte/cli

Option 3: Development Build from Source

git clone https://github.com/sandwichfarm/nsyte.git
cd nsyte
deno install -A -f -g -n nsyte src/cli.ts

Testing Your Setup

Initialize a Test Project

mkdir test-site
cd test-site
nsyte init

During 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.md

Test Upload

nsyte upload .

Verify Deployment

nsyte ls

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 generator

Testing Before Deploy

Test locally before uploading:

# Serve locally first
python -m http.server 8000
# or
npx serve dist/

Deploy to Test Environment

# Upload to staging relays first
nsyte upload ./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 test

Debug Mode

Use verbose output for debugging:

nsyte upload . --verbose

Configuration Tips

Multiple Environments

Create different configurations for different environments:

# Development
nsyte init --config .nsyte-dev.json

# Production  
nsyte init --config .nsyte-prod.json

Ignore Files

Create .nsyteignore to exclude development files:

node_modules/
.git/
*.log
.env
.nsyte-dev.json

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

Getting Help

Next Steps