This is a React + Vite profile dashboard that authenticates with Basic Auth, stores a JWT, and fetches user data from a GraphQL API.
- Node.js + npm
Install dependencies:
npm installCreate a .env file in the project root:
VITE_API_DOMAIN=https://learn.reboot01.com
VITE_SIGNIN_PATH=/api/auth/signin
VITE_GRAPHQL_PATH=/api/graphql-engine/v1/graphqlNotes:
VITE_API_DOMAINshould be the domain only (no trailing endpoint).VITE_SIGNIN_PATHandVITE_GRAPHQL_PATHare appended toVITE_API_DOMAIN.- Do not put secrets in
.env(frontend env values are visible in the built app).
npm run devnpm run buildThis project deploys using gh-pages.
-
Ensure
vite.config.jscontains the correct base path:-
If your repo is
https://github.com/<user>/<repo>, set:base: '/<repo>/',
-
-
Deploy:
npm run deploy- In GitHub:
- Repo Settings -> Pages
- Source: Deploy from a branch
- Branch:
gh-pagesand folder/ (root)
GitHub Pages returns 404 on direct refresh of routes like /login or /profile. This repo includes a public/404.html redirect + an index.html handler to support SPA routing.