Files
FictionArchive/fictionarchive-web
Claude 78612ea29d
Some checks failed
CI / build-backend (pull_request) Failing after 1m12s
CI / build-frontend (pull_request) Successful in 28s
feat: implement authentication system for API Gateway and FileService
- Add JWT Bearer token validation to API Gateway with restricted CORS
- Add cookie-based JWT validation to FileService for browser image requests
- Create shared authentication infrastructure in FictionArchive.Service.Shared
- Update frontend to set fa_session cookie after OIDC login
- Add [Authorize] attributes to GraphQL mutations with role-based restrictions
- Configure OIDC settings for both services in docker-compose

Implements FA-17: Authentication for microservices architecture
2025-11-27 14:05:54 +00:00
..
2025-11-24 13:25:29 -05:00
2025-11-26 18:26:30 -05:00
2025-11-24 13:25:29 -05:00
2025-11-26 08:48:00 -05:00
2025-11-25 23:29:55 -05:00
2025-11-24 13:25:29 -05:00
2025-11-25 23:29:55 -05:00
2025-11-26 08:48:00 -05:00
2025-11-24 13:25:29 -05:00
2025-11-24 13:25:29 -05:00

FictionArchive React Starter

A minimal React + Vite + Apollo Client scaffold ready to connect to the FictionArchive Fusion gateway. Point it at your own endpoint by changing VITE_GRAPHQL_URI.

Getting started

cd fictionarchive-web
npm install
npm run dev

Then open the printed local URL. Update .env (create it if missing) with your endpoint:

VITE_GRAPHQL_URI=https://localhost:5001/graphql
VITE_OIDC_AUTHORITY=https://your-idp
VITE_OIDC_CLIENT_ID=fictionarchive-web
VITE_OIDC_REDIRECT_URI=http://localhost:5173
VITE_OIDC_POST_LOGOUT_REDIRECT_URI=http://localhost:5173
# Optional: token used only by codegen if your gateway requires auth
VITE_CODEGEN_TOKEN=your_api_token

Scripts

  • npm run dev: start Vite dev server.
  • npm run build: type-check + production build.
  • npm run codegen: generate typed hooks from src/**/*.graphql into src/__generated__/graphql.ts. Run this manually after changing GraphQL operations or when the gateway schema changes.

Project notes

  • src/apolloClient.ts configures the Apollo client with InMemoryCache, reads VITE_GRAPHQL_URI, and attaches an Authorization: Bearer header when an OIDC user is present.
  • GraphQL code generation is configured via codegen.ts (loads .env/.env.local automatically); run npm run codegen to emit typed hooks to src/__generated__/graphql.ts (ignored by git) or rely on the prebuild hook.
  • Routing is handled in src/App.tsx with react-router-dom; / renders the novels listing and /novels/:id is stubbed for future detail pages.
  • Styles live primarily in src/index.css alongside the shared UI components.

Codegen tips

  • Default schema URL: CODEGEN_SCHEMA_URL (falls back to VITE_GRAPHQL_URI, then https://localhost:5001/graphql).
  • Add VITE_CODEGEN_TOKEN (or CODEGEN_TOKEN) if your gateway requires a bearer token during introspection.
  • Generated outputs land in src/__generated__/graphql.ts (committed to git). Run npm run codegen after schema/operation changes.