Serverless dev, QA, and prod
You're building an app and want to show a friend. Do you ship to production?
You're trying a new feature that doesn't do localhost. Do you publish?
You've built a pipeline that edits user data and want to make sure it works. Test in production?
If you're brave enough ...
Before there's users
None of this matters until you have users. Build on the main branch, ship to production, test in real life. Enjoy yourself!
Coding at this stage is fun.
You don't have to worry about corrupting user data. No concerns about disrupting a user's workflow. You don't even need to worry about shipping bugs!
If nobody noticed the bug, was the bug even there?
A word of caution: It's easy to fill your database with crappy data. Try to start production clean.
Thank me later when counting users isn't a 5 step process. You'd be surprised how hard it can be to answer "How many users do we have?".
Localhost vs. Production
Once you have users, you need a way to distinguish production from development. That's easy on a solo project.
Localhost is for development, production is for production. Run a copy of production on your machine and test.
The bigger your system, the trickier this gets. You need to host a database, run queues, caching layers, etc.