Skip to content

Client #43: App shell with sidebar layout and data layer foundation#71

Merged
FadyGergesRezk merged 8 commits into
mainfrom
client/43-app-shell
Jun 11, 2026
Merged

Client #43: App shell with sidebar layout and data layer foundation#71
FadyGergesRezk merged 8 commits into
mainfrom
client/43-app-shell

Conversation

@FadyGergesRezk

Copy link
Copy Markdown
Collaborator

Why

Sets up the foundational client architecture for all future feature screens — without this, every feature PR would need to independently wire up routing, data fetching, and shared state from scratch.

What changed

Providers & routing

  • Replaced BrowserRouter + monolithic AppRouter.tsx with React Router v7 route-object style (createBrowserRouter, RouterProvider)
  • Extracted sidebar shell into src/app/layout/AppShell.tsx using shadcn SidebarProvider + Outlet
  • QueryClientProvider added in main.tsx with shared retry logic (skip retry on 4xx, max 2 retries on 5xx/network)

Feature-based architecture

  • Restructured all 7 features from flat api.ts/client.ts files into feature slices: api/, types/, pages/
  • Each feature has typed TanStack Query hooks (useQuery + useMutation) with query key factories
  • Delete hooks evict the detail cache entry immediately (removeQueries) instead of waiting for gcTime
  • Update hooks accept id in mutation variables rather than closing over it at hook-call time

Shared foundations

  • src/types.ts — re-exports all OpenAPI schema types from src/api.ts with clean names; feature types import from here (single source of truth)
  • src/lib/forms.ts — re-exports useForm, zodResolver, z from a single entry point
  • src/store/ui.ts — Zustand store for client-only UI state
  • src/components/ui/ErrorMessage.tsx + LoadingSpinner.tsx — shared UI primitives

Naming

  • events feature renamed to sport-events throughout (folder, hooks, query keys, page, nav label) — avoids shadowing the DOM Event global; backend route /api/v1/events unchanged
  • Event type aliased as SportEvent in src/types.ts

Notes

  • src/api.ts is auto-generated by openapi-typescript (installed as dev dep) — do not edit it. Edit src/types.ts aliases instead, or regenerate src/api.ts from the OpenAPI spec.
  • All API clients use createApiClient() from src/lib/keycloak.ts — no custom auth or token logic was added.
  • payments/ folder name kept as-is (user-facing domain); base URL is /api/v1/finance to match the Traefik proxy route.
  • Page components are stubs (heading only) — ready for feature implementation PRs.

Testing

  • pnpm lint — 0 errors, 0 warnings
  • pnpm typecheck — clean
  • pnpm build — 2020 modules, built successfully

Closes #43

@f-s-h

f-s-h commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

For consistency, please change "sports-events" to "events".

@f-s-h

f-s-h commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Please further add the finance route.

@f-s-h

f-s-h commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Rest lgtm.

@f-s-h f-s-h self-requested a review June 11, 2026 07:11
@raphael-frank

Copy link
Copy Markdown
Collaborator

Also, maybe merge main into this branch for merge conflict resolution before merging to main.

Comment thread web-client/src/features/helper/api/queries.ts Fixed
@FadyGergesRezk FadyGergesRezk merged commit f38be65 into main Jun 11, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Client foundation — app shell, shared state, and data layer

4 participants