- Elixir 80.3%
- HTML 7.7%
- JavaScript 5.5%
- Dockerfile 3.6%
- Shell 2.4%
- Other 0.5%
| assets | Simplify color selection and add light mode | |
| bin | Add image name option to bin/build-container-image | |
| config | Upgrade all dependencies | |
| lib | Add some automatic URL rewriting | |
| priv/static | Replace favicon | |
| rel/overlays/bin | Add container build setup | |
| test | Initial commit | |
| .dockerignore | Add container build setup | |
| .formatter.exs | Initial commit | |
| .gitignore | Initial commit | |
| Dockerfile | Upgrade all dependencies | |
| LICENSE | Add LICENSE | |
| mix.exs | Upgrade all dependencies | |
| mix.lock | Upgrade all dependencies | |
| README.md | Add README section on deploying | |
Hacker News frontend
This provides a mobile-focused alternative frontend for Hacker News. It uses the official API, and renders HTML pages with very minimal JS.
The design of the webpages is strongly inspired by hn.premii.com.
Note that interacting with the Hacker News API to build comment pages requires a sometimes enormous number of HTTP requests. There is no rate limit, so that is fine, but loading a large page can take a while. This frontend does not include any sort of abuse prevention, but does include some caching.
Usage
To start your Phoenix server:
- Run
mix setupto install and setup dependencies - Start Phoenix endpoint with
mix phx.serveror inside IEx withiex -S mix phx.server
Now you can visit localhost:4000 from your browser.
Deploying
Can easily deployed using Podman/Docker. See the Phoenix deployment guide for other options.
Use bin/build-container-image to build a container image. By default it
builds an image with the name localhost/hacker-news:<commit-id>. Add -h to
see some more options.
The following environment variables are important:
-
SECRET_KEY_BASEshould be set to a secret generated usingmix phx.gen.secret -
PORTcan be set to the port to listen on, defaults to4000