Development Workflow
Learn how to integrate Spin into your development process
Basic Workflow
- Create a
spin.config.jsonin your project - Configure required services in the dependencies section
- Add a
Procfile.devif you need multiple processes - Run
spin upto start your development environment and services - Use
spin psto monitor running processes - View logs with
spin logs [process] - Debug with
spin debug [process]when needed - 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.jsonacross the team - Document any additional setup steps in README
- Use
spin setupfor 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 psregularly to ensure all services are healthy -
Log Management
Use
spin logswith service names for focused debugging -
Resource Cleanup
Always use
spin downwhen finishing work to free up system resources -
Version Control
Keep your
spin.config.jsonin version control and document dependencies