secret-traitor / secret-traitor

A social deduction game, identify the secret member of a hostile faction
0 stars 1 forks source link

Experiment with the crazy idea of no-local development #28

Open douglasnaphas opened 3 years ago

douglasnaphas commented 3 years ago

I want to try out developing with no local dev at all.

This is crazy, but I think it will be better.

A local dev env threatens to be a massive time suck. It requires:

  1. Dockerfiles
  2. a Docker Compose file
  3. Nginx files to mimic CloudFront
  4. mimicking DynamoDB with dynamodb-local
  5. mimicking API Gateway WebSockets, not sure how
  6. mimicking S3
  7. mimicking Lambda
  8. telling Cognito, once we want to have users who log in, that localhost is OK as a redirect URI
  9. using mkcert so that we can use https://localhost
  10. making annoying decisions about ports
  11. constantly keeping in your head the various differences between local development and the live site.

The payoff for all of this is:

  1. You might be able to have React pages update without reloading.
  2. You don't have to wait for a build to see changes.

I think the delay in seeing your changes is worth it. Especially since you don't have to commit to see changes--you can get your changes live by pushing to your development S3 bucket (for the frontend) or running cdk deploy from your local CLI (for everything else) between commits to a feature branch. And cdk deploy may often finish quickly, because CloudFormation will not deploy the entire stack with each deploy, but rather will only deploy the resources within the stack that have changed.

This Issue includes setting up a GitHub Actions build or builds so that you can

  1. Fork this repo.
  2. Add the credentials to your dev account in your fork as GitHub repository secrets.
  3. Create a feature branch in your fork.
  4. Have your feature branch automatically deployed to a CloudFront URL within the account targeted by your fork.
douglasnaphas commented 3 years ago

TODO

dan-muller commented 3 years ago

I was just thinking today how its very frustrating that local and prod are so different. I need to go over the details, but I love the idea.