Development Workflow

Learn how to integrate Spin into your development process

Basic Workflow

  1. Create a spin.config.json in your project
  2. Configure required services in the dependencies section
  3. Add a Procfile.dev if you need multiple processes
  4. Run spin up to start your development environment and services
  5. Use spin ps to monitor running processes
  6. View logs with spin logs [process]
  7. Debug with spin debug [process] when needed
  8. Stop everything with spin down

Daily Development

1. Starting Your Day

# Start all services
spin up

# Check service status
spin ps

This will start your development environment and ensure all services are running correctly.

2. During Development

# View logs from all services
spin logs

# View logs from a specific service
spin logs web

# Check service health
spin ps

Monitor your services and debug issues as you develop.

3. Ending Your Day

# Stop all services
spin down

Clean up resources and stop services when you're done.

Working with Teams

  • Share the same spin.config.json across the team
  • Document any additional setup steps in README
  • Use spin setup for consistent project initialization
  • Keep service versions in sync through configuration

Onboarding New Team Members

# Fetch repository
spin fetch [repository-name]

# Start development environment
spin up

New team members can quickly get started by fetching the repository and running spin up. This will set up the environment with all necessary services, and run the setup script if available.

Troubleshooting

Process Won't Start

  • Check process logs with spin logs [process]
  • Verify all required services are running
  • Ensure ports aren't already in use
  • Check environment variables in configuration

Service Connection Issues

  • Verify service is running with spin services list
  • Check service configuration in spin.config.json
  • Ensure no conflicting services are running locally
  • Try stopping and restarting the service

Performance Issues

  • Monitor resource usage with spin ps
  • Check logs for any warnings or errors
  • Consider adjusting service resource limits
  • Restart services if they become unresponsive

Debugging Steps

# Check process status
spin ps

# View process logs
spin logs [process-name]

# Debug a specific process
spin debug [process-name]

# Verify service status
spin services list

# Restart everything if needed
spin down && spin up

Getting Help

  • Check the GitHub repository for known issues
  • Review the documentation for your specific services
  • Join the community discussions on GitHub
  • Report bugs with detailed reproduction steps

Best Practices

  • Regular Health Checks

    Use spin ps regularly to ensure all services are healthy

  • Log Management

    Use spin logs with service names for focused debugging

  • Resource Cleanup

    Always use spin down when finishing work to free up system resources

  • Version Control

    Keep your spin.config.json in version control and document dependencies