|
| 1 | +<h2 align="center">Hacker News Clone Remix/React</h2> |
| 2 | + |
| 3 | +<p align="center"> |
| 4 | + <a href="https://github.com/clintonwoo/hackernews-remix-react/stargazers"><img alt="GitHub Repo stars" src="https://img.shields.io/github/stars/clintonwoo/hackernews-remix-react?style=social"></a> |
| 5 | + <a href="https://github.com/clintonwoo/"><img alt="GitHub Followers" src="https://img.shields.io/github/followers/clintonwoo.svg?style=social&label=Follow"></a> |
| 6 | + <a href="https://github.com/clintonwoo/hackernews-remix-react/issues"><img alt="GitHub Issues" src="https://img.shields.io/github/issues/clintonwoo/hackernews-remix-react.svg"></a> |
| 7 | + <a href="https://github.com/clintonwoo/hackernews-remix-react/pulls"><img alt="GitHub Pull Requests" src="https://img.shields.io/github/issues-pr-raw/clintonwoo/hackernews-remix-react.svg"></a> |
| 8 | +</p> |
| 9 | + |
| 10 | +This is a clone of Hacker News written in TypeScript using Remix and React. |
| 11 | + |
| 12 | +It is intended to be an example or boilerplate to help you structure your projects using production-ready technologies. |
| 13 | + |
| 14 | +The project implements the publically available parts of the Hacker News site API, with some remaining functionality implemented in-memory. |
| 15 | + |
| 16 | +<p align="center" margin-bottom="0"> |
| 17 | + <a href="https://remix.hnclone.win" target="_blank"> |
| 18 | + <img alt="Hacker News Clone Demo" width="600" height="auto" src="docs/hn-screenshot-seal.webp"> |
| 19 | + </a> |
| 20 | +</p> |
| 21 | +<p align="center"> |
| 22 | + <a href="https://remix.hnclone.win">Live Demo</a> |
| 23 | +</p> |
| 24 | + |
| 25 | +## Overview |
| 26 | + |
| 27 | +### Featuring |
| 28 | + |
| 29 | +- Remix (Server side rendering framework) |
| 30 | +- React (Declarative UI) |
| 31 | +- ESBuild (via Remix, sub-second production builds) |
| 32 | +- TypeScript (Static typing) |
| 33 | +- Authentication via Cookies (plain JS) |
| 34 | +- Jest (Test runner) |
| 35 | +- Prettier (Code formatter) |
| 36 | + |
| 37 | +### Benefits |
| 38 | + |
| 39 | +**UI** |
| 40 | + |
| 41 | +- Website works with JavaScript disabled (`Remix`) |
| 42 | +- Declarative UI (`React`) |
| 43 | +- Minimalistic client-side UI rendering (`Remix`) |
| 44 | +- Pre-fetch page assets (`Remix`) |
| 45 | +- JS Code splitting (`Remix`) |
| 46 | +- Loading state spinners not required (`Remix`) |
| 47 | + |
| 48 | +**Server** |
| 49 | + |
| 50 | +- Server Side rendering (`Remix`) |
| 51 | +- Universal TypeScript/JavaScript (`Web standards`) |
| 52 | +- Deployable on FaaS (Functions as a Service), edge workers or on your own NodeJS server (`Remix`) |
| 53 | +- Asset bundler (`ESBuild` via `Remix`) |
| 54 | + |
| 55 | +**Dev/Test** |
| 56 | + |
| 57 | +- Hot module reloading (`remix`) |
| 58 | +- Snapshot testing (`Jest`) |
| 59 | +- JS/TS best practices (`eslint`) |
| 60 | + |
| 61 | +## How it works |
| 62 | + |
| 63 | +Remix emphasises web primitives and fundamentals. So requests are made generally using Remix's `<Link>`s and `<Form>`s which add some extra functionality on top of the regular `<a>` and `<form>` tags. |
| 64 | + |
| 65 | +Remix `routes` folder correlates to route-matching UI views with layouts and endpoints for GET (loader) or all other HTTP verb methods (action). You can have endpoints with no UI and UI with no endpoints, or mixed. |
| 66 | + |
| 67 | +Remix takes care of the build system (using ESBuild), which works incredibly quickly and is a pleasure to work with. Remix implements code-splitting, HTTP headers, asset bundling and various optimizations to make the site run fast in real-world scenarios. |
| 68 | + |
| 69 | +Remix can run in a number of runtime environments so the architecture for your app could be widely different depending on your requirements. You could deploy it on an edge network (like Cloudflare Workers) or run it with NodeJS inside a cloud VM or VPS, for example. |
| 70 | + |
| 71 | +### How to build and start |
| 72 | + |
| 73 | +Start with `npm install`. |
| 74 | + |
| 75 | +You can build and start with file watching using `npm run dev`. |
| 76 | + |
| 77 | +Or you can do a regular build and start using `npm run build` and `npm run start`. |
| 78 | + |
| 79 | +### One Command Setup & Run |
| 80 | + |
| 81 | +You can download and run the repo with one command to rule them all: |
| 82 | + |
| 83 | +`git clone https://github.com/clintonwoo/hackernews-react-remix.git && cd hackernews-react-remix && npm install && npm run dev` |
| 84 | + |
| 85 | +## Contributing |
| 86 | + |
| 87 | +File an issue for ideas, conversation or feedback. Pull requests are welcome. |
| 88 | + |
| 89 | +## Community |
| 90 | + |
| 91 | +After you ★Star this project, follow [@ClintonDAnnolfo](https://twitter.com/clintondannolfo) on Twitter. |
0 commit comments