Giga Stack ✨

The most Twitter influenced stack you've ever seen

Features

Inspired by T3 stack and Shadcn Taxonomy project, I created this example of experimental edge stack full of sweet and fancy features for you to play with. Shout out to a bunch of open source solutions on the GitHub which I combined here.

Fetching

In this implementation you have 2 API clients. One for RSC and one for Client components. Syntax for both are the same, with all typescript hinting features.

To make a RSC api call:


  import { api } from "~/lib/api/server";
  
  export default async function ServerComponent() {
    const data = await api.route.stuff.fetch();
  }
              
Example (watch the code):

Hello Test RSC TRPC Call

To make a Client api call:


  "use client";

  import { api } from "~/lib/api/client";
  
  export default function ClientComponent() {
    const { data, isLoading } = await api.route.stuff.useQuery();
  }
              
Example (watch the code):

Loading...

Mutation:

The idea is simple - mutate on client and refresh the route on success


  const router = useRouter();

  const { mutate, isLoading } = api.route.stuff.useMutation({
    onSuccess() {
      router.refresh();
    },
  });
              

Play with demo dashboard or
see project code on GitHub