Skip to content

Latest commit

 

History

History
82 lines (49 loc) · 4.01 KB

README.md

File metadata and controls

82 lines (49 loc) · 4.01 KB

Waterpark Client

The web app for Waterpark.

Developer Quick Start

  1. Copy the following into a file named .env.local in this directory.

    NEXT_PUBLIC_API_URL=https://waterpark-staging.herokuapp.com/api/v1
    

    See configuration for how to customize the frontend environment.

  2. Run the development server.

    npm run dev
  3. Open http://localhost:3000 with your browser to see the Waterpark client.

  4. You are ready to work on the Waterpark client! While the development server is still running, the browser page auto-updates to match any changes you save in this directory.

Configuration

The Waterpark client requires the following environment variables:

Variable Description Example Value
NEXT_PUBLIC_API_URL the URL of the Waterpark API http://localhost:3001/api/v1
(full-stack developers will find this value useful)

Stack

TypeScript

Almost every code file in the Waterpark client has .ts or .tsx as its extension, meaning that it is written in TypeScript. In a nutshell, TypeScript is a superset of JavaScript that adds types.

Beyond our Prettier configuration, Loo Labs does not have a style guide for writing TypeScript. However, here are some practices we look out for in code review:

React / Next.js

This is a Next.js project bootstrapped with create-next-app. Next.js is a wrapper over the React UI library that makes it easy to do things that are considered standard in most web apps.

Like most modern React teams, Loo Labs uses exclusively functional components and hooks.

CSS / styled-components

styled-components allows CSS styles to be written directly in the same .tsx files where React components are defined.

There are often many ways to implement the same style in CSS. However, here are some practices we look out for in code review:

React Query

To communicate with the Waterpark API, the client uses React Query.

Deployment

The Waterpark client is deployed with Vercel, the creators of Next.js. The deployment of main can be found at https://waterpark-loo-labs.vercel.app/.

For pull request preview deployments, the obscure vercel-is-pull-request npm package augments the environment variables of the deployment to include the PR number. The history of this hacky workaround can be found in issue #40.