Hacker News new | ask | show | jobs
by verdverm 1563 days ago
Start with a full stack app with user accounts, deploy it to the cloud, then add websockets. After that come back and ask again for next steps.
1 comments

sorry I should clarify the parts I don't know. I know how to build a full stack app with user accounts, deploy it to the cloud, then add websockets. I own https://www.c0d3.com

I don't know how to create server instances on the fly.

Ah ok, there are many options here. You essentially need to do some programmatic devops. You can do this with Kubernetes, Terraform, or the cloud provider APIs directly. You'll need to maintain parity between what they want running and what is running, quotas / limits so they don't run up your bill, and cleanup of resources.

You'll want to be cautious of, and thoughtful in, your security because you are allowing users to run untrusted code. It's not just about protecting yourself from them, but also protecting users from each other.

thank you so much I will go learn Kubernetes and Terraform and how they work
What I've done is build a small API in Go, using the Kubernetes client-go module that my app server called out to. It would run the steps to deploy client session servers and manage the infra for it generally. There are a ton of ways / tech you can use in a server dedicated to this process. I would recommend separating it from your application server that talks to the main user database that tracks things. I queries the kids API or metrics server rather than storing everything in the database.