Client side template

The client side template for a web application that uses the Learner Model GQL service is available at https://github.com/PabloSzx/learner-model-gql-template.

Relevant Libraries

The template uses specific libraries to handle specific needs:

  • Next.js - Fully fledged React framework for web applications.
  • TypeScript - Superset of JavaScript with Type-safety in mind. It's encouraged but not mandatory, since TypeScript and JavaScript can be mixed.
  • auth0-react - Authentication
  • Chakra UI - Simple, Modular & Accessible UI Components
  • GraphQL Code Generator - Generate code for complete type-safety and easier usage of GraphQL APIs
  • React Query - Hooks for fetching, caching and updating asynchronous data in React
  • Valtio - React state management

Important code

Usage

Development

Install dependencies:

pnpm i

Then, to run in localhost:

pnpm dev

The application is going to run and open on http://localhost:3000

Deployment

Some instructions recommended in the Next.js documentation can be found in https://nextjs.org/docs/deployment.

It's recommended to use Vercel, but for using pnpm inside Vercel a couple of extra configurations have to be defined:

Vercel PNPM Deployment

Build Command: pnpm build

Install Command: npm i -g pnpm && pnpm i --store=node_modules/.pnpm-store