- Notifications
You must be signed in to change notification settings - Fork34
Gabriella439/simple-twitter
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This is a project which has correspondingtalk slides
This is a bare bones "Twitter clone" implemented inasingle file that you can deploy to EC2
This uses:
- HTML + CSS for the front-end (No JavaScript)
- Bootstrap for some minimal styling
- AHaskell service for server-side rendering
- APostgres database for application state
- NixOps for deployment
- AWS EC2 for hosting
The result looks like this:
Create an AWS account
... by followingthese instructions
Install Nix:
$ curl https://nixos.org/nix/install| sh
Install the AWS command-line interface:
$ nix-env --install awscli
Configure your AWS credentials
... by followingthese 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 nixops
Build and redeploy the web application
$ nixops create --deployment simple-twitter simple-twitter.nix$ nixops deploy --deployment simple-twitter --allow-reboot
If you make changes you can redeploy the application by re-running the laststep:
$ nixops deploy --deployment simple-twitter --allow-reboot
To destroy the machine and clean up everything, run:
$ nixops destroy --deployment simple-twitter$ nixops delete --deployment simple-twitter
Have fun! 🙂
You can also view the files split out by language:
./split.nix
- Only the Nix code./Main.hs
- Only the Haskell code./initialScript.sql
- Only the SQL code