Gabriel439 / simple-twitter
- понедельник, 25 ноября 2019 г. в 00:24:35
Nix
A bare-bones Twitter clone implemented in a single file
simple-twitterThis is a project which has corresponding talk slides
This is a bare bones "Twitter clone" implemented in a single file that you can deploy to EC2
This uses:
The result looks like this:
Create an AWS account
... by following these instructions
Install Nix:
$ curl https://nixos.org/nix/install | shInstall the AWS command-line interface:
$ nix-env --install awscliConfigure your AWS credentials
... by following these instructions
If you did this correctly you should have an ~/.aws/credentials
file that looks similar to this:
[default]
aws_access_key_id = …
aws_secret_access_key = …Install NixOps:
$ nix-env --install nixopsBuild and redeploy the web application
$ nixops create --deployment simple-twitter simple-twitter.nix
$ nixops deploy --deployment simple-twitter --allow-rebootIf you make changes you can redeploy the application by re-running the last step:
$ nixops deploy --deployment simple-twitter --allow-rebootTo destroy the machine and clean up everything, run:
$ nixops destroy --deployment simple-twitter
$ nixops delete --deployment simple-twitterHave fun!
You can also view the files split out by language: