Introduction
This is a step-by-step tutorial to create a website similar to Hacker News using Tribe react sdk. Live preview of the end result is available.
#
1. Create a communityIn this tutorial we will use ReactSDK Tutorial community. If you want to use your own community, you can create one on Tribe.
#
2. Create a react projectYou can follow Create React App to create a new React project with typescript. Alternatively, if you already have a React project you can add Tribe ReactSDK on top of it.
#
3. Install tailwindcssFor this tutorial we will use tailwindcss to style out components.
You can install tailwindcss to your React app.
In order to add the HackerNews colors to the theme, we update the tailwind.config.js
.
#
4. Set up routerWe use React Router to set up the routing.
#
5. Install the React SDKYou can simply install Tribe React SDK using the following yarn
command:
note
We have to install @tribeplatform/gql-client
because we will use it in this tutorial.
After installing your package.json
should look similar to this.
#
6. Inject Tribe React providerWrap your App by TribeProvider
. Here is how index.tsx
should look like.
Now you have set up the project with Tribe ReactSDK, and it's ready to use.