Opinionated frontend template for spinning up stuff quickly.
bun install
to install dependencies, and create a.env
file following the template in.env.template
bun run dev
for developmentbun run build
for production builds
Some assumptions the template makes:
- You are exposing endpoints at
https://{VITE_GRAPHQL_URL}/graphql
andwss://{VITE_GRAPHQL_URL}/graphql
- Introspection queries are allowed
- You need a JWT token for authentication on your graphql server. If you don't, just remove the relevant code from
codegen.ts
, andsrc/providers/graphql.tsx
Once you are setup with everything, you can run bun codegen.ts
to generate the schema.json
from the graphql introspection query in src/codegen/schema.json
.
If you need to update the JWT (in case it expires), there's a helper function exposed on template.token()
in the browser console in src/lib/hooks.ts