Work in progress (permanently?).
After completing the tutorial rebuilding solidjs/solid-hackernews from the ground up seemed like a way to get a guided tour to structuring an application.
- Use TypeScript (transpilation first/type checking later)
- Use Official Hacker News API only rather than the unofficial one (this will result in a waterfall of requests degrading client-side performance which is why the unofficial API is used in the original).
- Started with
$ npx degit solidjs/templates/ts solid-hackernews-a
- Added Prettier and ESlint.
- The updated API access code can be found in
src/lib/api.ts
with some supporting code insrc/lib/helpers.ts
. - The application entry point is at
src/index.tsx
. solid-app-router
is used for client side routing. The config based routing is found insrc/routes.ts
.- Stories route:
src/pages/[...stories].data.ts
fetches forsrc/pages/[...stories].tsx
. - Story route:
src/pages/stories/[id].data.ts
fetches forsrc/pages/stories/[id].tsx
. - User route:
src/pages/users/[id].data.ts
fetches forsrc/pages/users/[id].tsx
.
- Stories route:
Clone the repo:
$ cd solid-hackernews-a
$ npm i
$ npm run dev