Opinionated frontend template for spinning up stuff quickly.
bun installto install dependencies, and create a.envfile following the template in.env.templatebun run devfor developmentbun run buildfor production builds
Some assumptions the template makes:
- You are exposing endpoints at
https://{VITE_GRAPHQL_URL}/graphqlandwss://{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