hackernews-client is a simple App for Hacker News.
- It's build in React Native using Expo.
- It uses TanStack Query and the Firebase JavaScript SDK to get the front page, stories, and comments from the official Hacker News API.
Install Expo Go on your phone and afterwards use the camera to scan the QR code below. This will open the latest version of the app in Expo Go.
The easiest way is to use Expo Go on your phone to open the app running on your laptop. This way you can see the changes you make in the code immediately on your phone.
- Install Node.js
- Clone the git repository
- Run
npm install
in the root directory of the project - Run
npx expo start
(or if your phone is not on the same network as your laptop usenpx expo start --tunnel
) - Use the camera of your phone to scan the QR code in the terminal
You should now see the app running on your phone, try making some changes to the code and see the changes immediately on your phone. You could for example change src/screens/FrontPageScreen.tsx and change the <Header>
to say Hacker News instead of Front Page.
It's also possible to run the app in the iOS Simulator on macOS or the Android Emulator on Windows or macOS.
See example-hackernews-api-requests.http for example responses from the Hacker News API. You can use the REST Client extension for Visual Studio Code to run the requests.