Skip to content

About

Next 13 with App directory, TailwindCSS, Typescript, Apollo Client, GraphQL

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

GitInsight (github-viewer)

Browse GitHub users, their repositories, organizations and followers through the GitHub GraphQL API, built on the Next.js 13 App Router.

Live demo: github-viewer-nine.vercel.app

Screenshot 2026-12-02 at 4 40 06 PM

Features

  • Home page listing GitHub users returned by a GraphQL search query, each shown as an avatar card
  • User detail page at /user?login=<username> that works for any valid GitHub login, not only the users on the home page
  • User sidebar with organizations and recent followers, linking out to their GitHub profiles
  • List of the user's repositories, newest first
  • Responsive Tailwind layout: the user card grid moves from one to two to three columns as the viewport grows

How it's built

  • Server and client data fetching with one Apollo setup. The home page is an async React Server Component that queries GitHub via registerApolloClient from @apollo/experimental-nextjs-app-support/rsc (src/lib/getClient.ts). The user page is a Client Component using useSuspenseQuery, wrapped in an ApolloNextAppProvider (src/lib/apolloProvider.tsx).
  • SSR-aware caching. Both clients use NextSSRInMemoryCache; on the server the client link chain is prefixed with SSRMultipartLink({ stripDefer: true }) so data fetched during server rendering is handed to the browser cache.
  • Auth via an Apollo link. A setContext link adds the Authorization: Bearer header and is concatenated with the HttpLink that points at https://api.github.com/graphql.
  • Typed, parameterised queries. GetUserByLogin($login: String!) (src/query/index.ts) fetches a user, 5 followers, 10 organizations and up to 100 repositories ordered by CREATED_AT DESC in a single request.
  • Next.js platform features. next/font/google (Figtree and Cabin) exposed as CSS variables for Tailwind, next/image with GitHub avatar domains allow-listed in next.config.js, and the Metadata API for the page title.

Tech stack

  • Next.js 13.4 (App Router), React 18, TypeScript
  • Apollo Client 3.8 with @apollo/experimental-nextjs-app-support, GraphQL
  • Tailwind CSS 3 (with prettier-plugin-tailwindcss)
  • Jest 29 and React Testing Library (smoke tests for the header and footer in tests/)

Running locally

Requirements: Node.js 18+ and Yarn, plus a GitHub personal access token with read access to public data.

git clone https://github.com/AaronMullan/github-viewer.git
cd github-viewer
yarn install

Create .env.local with these variables:

GITHUB_ACCESS_TOKEN=        # used by the server-side client (home page)
NEXT_PUBLIC_GITHUB_ACCESS_TOKEN=  # used by the client-side Apollo provider (user page)

Then:

yarn dev           # http://localhost:3000
yarn test          # Jest, run once
yarn test:watch    # Jest in watch mode
yarn build && yarn start

About

Next 13 with App directory, TailwindCSS, Typescript, Apollo Client, GraphQL

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages