Skip to content

feat : add front connected to backend - #5

Merged
teamssUTXO merged 6 commits into
devfrom
feat/front-login
May 16, 2026
Merged

feat : add front connected to backend#5
teamssUTXO merged 6 commits into
devfrom
feat/front-login

Conversation

@teamssUTXO

@teamssUTXO teamssUTXO commented May 15, 2026

Copy link
Copy Markdown
Member

The follow-up PR of the #4 . It adds a frontend to test the backend. The design is in wip.

Summary by CodeRabbit

  • New Features

    • Liquid Glass visual theme and mesh background
    • Full auth flows: sign‑in, sign‑up, join-by-code, and user menu
    • Course listing and detailed course pages
    • Locale switcher with English/French support and persisted locale
    • Branding support (instance defaults) plus updated top navigation and site footer
    • New glass UI primitives: cards, buttons, inputs, chips, nav, icons, and background
  • Improvements

    • Mobile-first responsive redesign, updated typography and color system
    • Accessibility enhancements (WCAG/ARIA considerations)
  • Documentation

    • Example frontend environment configuration (.env.example)

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 15, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 321dea37-b631-4c4a-bc6f-9a6581fbb19a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR introduces a comprehensive frontend redesign centered on a new Liquid Glass design system, server-based authentication with i18n support, and refactored pages using async server components. Key additions include an i18n routing layer, OAuth-like auth flows with JWT validation middleware, a reusable glass UI component library, and rebuilt home/login/course pages with role-aware navigation and localized content.

Changes

Frontend Redesign & New Architecture

Layer / File(s) Summary
i18n routing, request config, translations, and types
apps/frontend/i18n/routing.ts, apps/frontend/i18n/request.ts, apps/frontend/global.d.ts, apps/frontend/messages/en.json, apps/frontend/messages/fr.json
Locale configuration (en/fr) with cookie-based detection, dynamic JSON message loading, and TypeScript type-safe translations wired to en.json reference.
Authentication actions, provider, and middleware
apps/frontend/app/actions/auth.ts, apps/frontend/components/auth-provider.tsx, apps/frontend/proxy.ts
Server actions for sign-in/sign-up/group-join/logout with cookie-based tokens, client-side auth context with sign-out, and middleware enforcing auth via JWT expiration checks and route protection.
API client, shared types, roles, and utilities
apps/frontend/lib/api.ts, apps/frontend/lib/types.ts, apps/frontend/lib/roles.ts, apps/frontend/lib/instance.ts, apps/frontend/lib/safe-redirect.ts, apps/frontend/lib/site.ts
HTTP client with timeout/error handling, comprehensive domain types (roles, API responses, courses, branding), role helpers, instance defaults, path sanitization, and site URL config.
Configuration, environment, and root layout
apps/frontend/.env.example, apps/frontend/.gitignore, apps/frontend/next.config.ts, apps/frontend/package.json, apps/frontend/app/layout.tsx
Environment variables, i18n Next.js plugin, security headers, Node.js version constraint, and async RootLayout loading locale/messages/branding/user with provider wrappers and MeshBackground.
Liquid Glass design spec and CSS theming
apps/frontend/CLAUDE.md, apps/frontend/app/globals.css
New design direction with translucent glass, pastel palette, WCAG/ARIA rules, and CSS rewrite: theme variables, glass utilities, mesh animations, updated focus/reduced-motion/high-contrast styling.
Glass UI component library
apps/frontend/components/ui/glass-*.tsx, apps/frontend/components/ui/glass.ts, apps/frontend/components/ui/mesh-background.tsx
Reusable primitives: GlassCard with subcomponents, GlassButton with loading state, form fields (Input/Textarea/Select/Label/Field/Error/Helper), GlassNav with scroll detection, GlassChip, and MeshBackground with animated gradient spots.
Icon system, brand mark, and branding provider
apps/frontend/components/ui/icons.tsx, apps/frontend/components/brand-mark.tsx, apps/frontend/components/branding-provider.tsx
SVG icon components (Star, Sparkles, Book, Trophy, ArrowRight, Key, Check), BrandMark with preset-driven glyph/gradient rendering, and BrandingContext provider for instance configuration access.
Top navigation, footer, locale switcher, and user menu
apps/frontend/components/top-nav.tsx, apps/frontend/components/site-footer.tsx, apps/frontend/components/locale-switcher.tsx, apps/frontend/components/user-menu.tsx
Async TopNav with role-aware links and login buttons, async SiteFooter with localized copyright/links, LocaleSwitcher for locale selection, and UserMenu showing user details with sign-out.
Login page and authentication UI
apps/frontend/app/login/page.tsx, apps/frontend/app/login/login-shell.tsx
Async /login route handling mode/code/expiration parameters; LoginShell managing signin/signup/join modes with translated copy; LoginForm with validation and error handling; ModeTabs and DecorativeAside for visual context.
Home page with hero, featured content, and CTAs
apps/frontend/app/page.tsx
Async HomePage fetching branding/translations/courses; Hero with branding-derived copy; HeroVisual with gradient; FeaturedCourses listing; Pillars section with icon cards; FinalCta with signup/join buttons.
Course detail page
apps/frontend/app/courses/[id]/page.tsx
Async route fetching course and translations, generating metadata, and rendering course pages with translated pagination and block counts.
Error handling and SEO routes
apps/frontend/app/error.tsx, apps/frontend/app/not-found.tsx, apps/frontend/app/robots.ts, apps/frontend/app/sitemap.ts
GlobalError with logging and retry/home actions, NotFound with localized 404 UI, robots.ts and sitemap.ts metadata routes for search engines.
Server actions for data fetching
apps/frontend/app/actions/courses.ts, apps/frontend/app/actions/instance.ts, apps/frontend/app/actions/locale.ts
Async actions: getCourses/getCourseById for course fetching, getInstanceBranding with ISR caching, setLocaleAction for locale persistence.
Backend updates and component cleanup
.gitignore, apps/backend/src/main/java/com/codestar/backend/dto/InstanceBrandingDto.java, apps/backend/src/main/java/com/codestar/backend/security/GroupPermissionService.java, removed components
Backend: TODO and Javadoc changes. Frontend: removed legacy SectionLabel, StarMark, Wordmark, Badge, Button, Card, Tabs, Icon, RevealOnScroll, and old home sections (Deployment, Features, Hero, JoinOrCreate, OpenSource, Personas, Sovereignty, TopNav).

🎯 4 (Complex) | ⏱️ ~60 minutes

A rabbit hops through the Glass Menagerie
Locales flowing like morning dew
Auth guards the garden gate
Icons dance, components bloom
The home page springs to life ✨

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/front-login

@teamssUTXO

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 15, 2026

Copy link
Copy Markdown
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@teamssUTXO teamssUTXO self-assigned this May 15, 2026
@teamssUTXO teamssUTXO added this to the v1.0.0 milestone May 15, 2026
@teamssUTXO teamssUTXO moved this from Backlog to In review in codestar roadmap May 15, 2026
@teamssUTXO teamssUTXO linked an issue May 15, 2026 that may be closed by this pull request

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 18

🧹 Nitpick comments (5)
apps/backend/src/main/java/com/codestar/backend/dto/InstanceBrandingDto.java (1)

3-3: ⚡ Quick win

Make the TODO actionable and traceable.

Line 3 (// TODO Logo) is too vague to execute reliably. Please include scope plus a ticket/reference (for example, expected logo source/validation rules), or replace it with a tracked issue link.

If you want, I can draft a concrete TODO format (or an issue template) for this DTO.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/backend/src/main/java/com/codestar/backend/dto/InstanceBrandingDto.java`
at line 3, Replace the vague "// TODO Logo" comment in the InstanceBrandingDto
class with a concrete, actionable TODO that includes scope and traceability:
specify the expected logo source (e.g., "SVG or PNG, max 2MB"), validation rules
(dimensions, allowed formats, field name in DTO), and a ticket or issue
reference (e.g., "ISSUE-1234" or hyperlink to tracked issue) so implementers
know where to follow up; update the comment attached to InstanceBrandingDto to
read like "TODO: Add logo field/validation — accept SVG/PNG up to 2MB, max
512x512px; validate MIME type; see ISSUE-XXXX for design/UX details."
apps/frontend/app/actions/courses.ts (1)

10-19: ⚡ Quick win

Consider logging errors before returning fallback.

The function silently swallows all errors and returns an empty array. This makes debugging API failures difficult in both development and production.

Add error logging:

} catch (error) {
  console.error("[getCourses] Failed to fetch courses:", error);
  return [];
}

This applies to getCourseById as well (lines 21-30).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/frontend/app/actions/courses.ts` around lines 10 - 19, The catch blocks
in getCourses and getCourseById silently swallow errors; update both functions
to catch the error object (catch (error)) and log it before returning the
fallback (e.g., console.error("[getCourses] Failed to fetch courses:", error)
and console.error("[getCourseById] Failed to fetch course:", error)) so failures
are visible while still returning the empty array or null fallback.
apps/frontend/lib/types.ts (2)

34-48: 💤 Low value

Consider clarifying "BLOC" naming.

The CourseBlockType union includes "BLOC" among otherwise English identifiers. If this represents a specific block type concept, consider either:

  • Using an English equivalent (e.g., "BLOCK", "SECTION", "PARAGRAPH")
  • Adding a comment explaining the French term

This improves consistency and reduces confusion for international contributors.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/frontend/lib/types.ts` around lines 34 - 48, The union type
CourseBlockType contains a non-English member "BLOC"; update this for clarity by
renaming "BLOC" to an English equivalent (e.g., "BLOCK" or "SECTION") and update
any usages of CourseBlockType, or alternatively add a concise code comment above
CourseBlockType explaining that "BLOC" is intentionally French and what it
represents; ensure you change all references to the symbol CourseBlockType and
the literal "BLOC" in the codebase to keep types and runtime values consistent.

73-82: ⚡ Quick win

Strengthen logo type safety.

The logo field uses { kind: string; value: string }, which accepts any string pair. Consider defining a discriminated union to enforce valid combinations:

logo: 
  | { kind: "preset"; value: "star" | "sparkles" | "book" }
  | { kind: "emoji"; value: string }
  | { kind: "url"; value: string }

This prevents invalid kind/value pairings and provides better autocomplete.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/frontend/lib/types.ts` around lines 73 - 82, Update the InstanceBranding
interface's logo field to a discriminated union instead of the loose { kind:
string; value: string } so TypeScript enforces valid kind/value pairs; replace
logo on InstanceBranding with a union such as a preset variant (kind: "preset",
value: one of the allowed preset names), an emoji variant (kind: "emoji", value:
string) and a url variant (kind: "url", value: string) so code using
InstanceBranding.logo gets proper type narrowing and autocomplete.
apps/frontend/app/actions/instance.ts (1)

11-23: ⚡ Quick win

Consider logging errors before returning fallback.

The function silently swallows all errors and returns DEFAULT_INSTANCE. While the fallback ensures the app continues to function, logging the error would help identify backend issues:

} catch (error) {
  console.error("[getInstanceBranding] Failed to fetch branding, using default:", error);
  return DEFAULT_INSTANCE;
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/frontend/app/actions/instance.ts` around lines 11 - 23, The catch block
in getInstanceBranding silently swallows errors; update the catch to accept the
error (e.g., catch (error)) and log the failure before returning
DEFAULT_INSTANCE so backend issues are visible. Use a clear contextual log such
as console.error("[getInstanceBranding] Failed to fetch branding, using
default:", error) (or your app logger) and keep the existing return
DEFAULT_INSTANCE; leave apiFetch and DEFAULT_INSTANCE references unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/frontend/.gitignore`:
- Around line 33-35: The current .gitignore removed the broad env pattern
(leaving only ".env*.local" and ".env"), which fails to ignore files like
".env.production" and ".env.development"; replace those two lines with a single
broad pattern ".env*" (or add ".env*" above the existing entries) so all
environment files (including .env.production, .env.development, etc.) are
ignored and accidental secret commits are prevented.

In `@apps/frontend/app/actions/auth.ts`:
- Around line 122-126: getMe currently swallows all exceptions and returns null;
change the catch in getMe (the call to apiFetch<MeResponse>("/api/v1/auth/me"))
to only return null for expected auth failures (HTTP 401 or 403) by inspecting
the thrown error's status (or Response) and for any other errors (5xx, network
issues, timeouts) rethrow the error so they surface to the layout/error
boundary; ensure you reference the apiFetch call and MeResponse handling when
adding the conditional status check.

In `@apps/frontend/app/courses/`[id]/page.tsx:
- Around line 25-26: The current guard uses Number.isFinite which allows
decimals; change both occurrences that compute courseId (the const courseId =
Number(id) checks) to require an integer and positive value by validating with
Number.isInteger(courseId) && courseId > 0 instead of Number.isFinite(courseId)
|| courseId <= 0 so fractional IDs like 1.5 are rejected; update the
early-return logic surrounding the courseId variable in page.tsx where those two
guards appear.

In `@apps/frontend/app/login/login-shell.tsx`:
- Around line 422-430: The privacy/terms anchor tags in the login UI (the <a>
elements using className "underline hover:text-text-soft" and text from
tConsent("terms") and tConsent("privacy") in login-shell.tsx) currently use
href="#" placeholders; replace those placeholders with correct route/URL
constants (or generated routes) if the pages exist, or render them as
non-clickable elements (e.g., replace the <a> with a plain <span> or button-like
element that is not navigable) until the real pages are available, ensuring the
visible text and styling remain consistent and removing the dummy href="#"
behavior.
- Around line 240-256: The form currently only validates the invitation code
when requireCode = mode === "join", so signup submits invitationCode undefined;
update validation and rendering to accept an optional code in signup while still
requiring it for join: change the validate function so that when mode === "join"
it enforces presence (e.g., if (!s.code) e.code = tErrors("codeRequired")), but
when mode === "signup" it only validates format if s.code is provided (e.g., if
(s.code && !CODE_RE.test(s.code.toUpperCase())) e.code =
tErrors("codeInvalid")); ensure the form field that maps to FormState.code is
rendered for signup as optional so signUpAction(invitationCode) receives the
value.

In `@apps/frontend/app/page.tsx`:
- Around line 144-157: The header preview renders white text over a runtime
gradient built from branding.accent in apps/frontend/app/page.tsx (the inline
style setting background: `linear-gradient(135deg, ${branding.accent},
${branding.accent}99)`), which can yield insufficient contrast for the text
elements (the elements rendering {t("previewLabel")}, {branding.name}, and
{branding.tagline}). Update page.tsx to measure the computed contrast of
branding.accent (or its resolved gradient midpoint) at render time and, if
contrast with white is below 4.5:1, apply the stronger glass background variable
(--glass-bg-strong) or a darker overlay class instead of the default gradient;
ensure this logic targets the same container element that currently receives the
inline background and conditionally toggles the styles used by the
mono/display/text elements so the previewLabel, branding.name, and
branding.tagline meet WCAG AA contrast.
- Around line 207-210: The Link element currently removes the visible keyboard
focus indicator via the className "focus-visible:outline-none" which hides focus
for keyboard users; update the Link in page.tsx (the <Link
href={`/courses/${course.id}`} ... />) to restore an accessible focus style
instead of removing it — either remove "focus-visible:outline-none" or replace
it with a visible focus utility such as a focus-visible ring/outline (e.g.,
focus-visible:ring, focus-visible:ring-2, focus-visible:ring-offset-2,
focus-visible:ring-primary or similar) so the card link shows a clear keyboard
focus state while keeping existing aria-label and visual design.

In `@apps/frontend/app/sitemap.ts`:
- Around line 15-18: The sitemap currently includes the URL entry with url:
`${SITE_URL}/login` which conflicts with apps/frontend/app/robots.ts that
disallows /login; remove the `/login` entry from the sitemap (or make sitemap
generation conditional based on robots rules) so robots and sitemap remain
consistent—locate the object/array containing the `{ url: `${SITE_URL}/login`,
lastModified: now, changeFrequency: "monthly", priority: 0.3 }` entry in
apps/frontend/app/sitemap.ts and delete it (or wrap its creation in a check that
queries the same disallow rules used in robots.ts).

In `@apps/frontend/components/brand-mark.tsx`:
- Around line 67-75: The gradient id creation uses the raw accent string
(id={`mark-${accent.replace("#", "")}`}) which can produce invalid id/url()
tokens for non-hex or arbitrary strings; update the BrandMark component to
sanitize accent before building the id and fill (both the linearGradient id and
the path fill={`url(#...)`}) by stripping or replacing all non-alphanumeric
characters (e.g., keep [A-Za-z0-9_-]), and provide a deterministic fallback
(like "default") when the sanitized result is empty so the generated id is
always valid and the fill reference never breaks.

In `@apps/frontend/components/locale-switcher.tsx`:
- Around line 27-40: The radio group lacks keyboard arrow navigation and roving
tabindex; update the locale-switcher (LOCALES map rendering, active/current and
pending logic) to implement proper radio semantics by adding keyboard handling
and tabindex management: give each button a dynamic tabIndex (0 for the active
locale, -1 for others), add an onKeyDown on the button or the radiogroup to
handle ArrowLeft/ArrowUp and ArrowRight/ArrowDown to compute the next index from
LOCALES, move focus to that button, update the selected/current locale (invoke
the same handler used by onClick) and ensure aria-checked reflects the new
active state; alternatively, if you prefer simpler behavior, change the controls
to toggle buttons by replacing role="radio"/aria-checked with role="button" and
aria-pressed and keep click-only semantics (preserving disabled/pending).

In `@apps/frontend/components/site-footer.tsx`:
- Around line 38-46: The footer currently renders anchor tags with href="#" for
the items using t("legal"), t("privacy"), and t("contact") which are
non-functional; replace these placeholders by wiring each anchor to the correct
route or, if routes aren't available yet, render them as non-interactive text
(e.g., span) to avoid dead links. Locate the anchor elements in the
site-footer.tsx component that wrap t("legal"), t("privacy"), and t("contact")
and either change href="#" to the proper route paths (or wrap with your router
Link component if using Next/React Router) or replace the <a> elements with
non-clickable elements styled the same until real URLs are ready.

In `@apps/frontend/components/top-nav.tsx`:
- Around line 78-84: The Join CTA is hidden on mobile due to the "hidden
sm:inline-flex" utility on the GlassButton containing Link; remove or change
that class so the button is visible on small screens (e.g., make it
"inline-flex" or remove "hidden"), ensure the GlassButton/Link pair still uses
variant="ghost" size="sm" and add appropriate accessible attributes (aria-label
and visible focus styles) and sufficient contrast per WCAG AA so the join flow
is reachable on mobile and keyboard/screen-reader users.

In `@apps/frontend/components/ui/glass-button.tsx`:
- Around line 105-113: The component allows interaction when asChild is true
because non-button children (Slot/Link) ignore the disabled prop; update the
render logic in glass-button.tsx around Comp, asChild, Slot to actively disable
non-button elements when disabled || loading by adding aria-disabled={true},
tabIndex={-1} and preventing clicks: if asChild and Comp !== "button" spread
these attributes and attach an onClick wrapper (or merge with props.onClick)
that calls event.preventDefault() and event.stopPropagation() when
disabled/loading; keep aria-busy as-is and ensure className still reflects
disabled state so pointer events can also be suppressed via CSS if present.

In `@apps/frontend/components/user-menu.tsx`:
- Around line 27-30: In onDocClick, guard against non-HTMLElement event targets
before calling closest: check that e.target is an HTMLElement (e.g. using
instanceof HTMLElement) and only then call target.closest("[data-user-menu]");
if the check fails, safely return without calling closest and avoid changing
setOpen. This prevents runtime exceptions when e.target isn't an element.

In `@apps/frontend/lib/api.ts`:
- Around line 121-123: The function that currently does `if (!parsed) { return
undefined as T; }` should stop forcing `undefined` into a non-nullable generic;
change the function's return type from `T` (or `Promise<T>`) to allow
`undefined` explicitly (e.g. `T | undefined` or `Promise<T | undefined>`),
remove the `as T` assertion so it returns plain `undefined`, and update all call
sites to handle the `undefined` case (or alternatively update the function to
throw an error instead of returning `undefined` if that's preferred). Ensure you
update the function signature and any related types where the function is
declared (the function containing the `parsed` variable) and adjust callers to
handle the new `undefined` possibility.

In `@apps/frontend/lib/instance.ts`:
- Line 2: Update the inline comment "Static fallbackc for the instance
branding." to correct the typo by changing "fallbackc" to "fallback" so it reads
"Static fallback for the instance branding."; locate and edit the comment in
apps/frontend/lib/instance.ts where that exact phrase appears.

In `@apps/frontend/messages/en.json`:
- Around line 98-106: The user-facing message for the "backendStub" key inside
the "errors" object currently exposes internal hand-off/task IDs; replace that
string with neutral copy (e.g., "Service unavailable. Please try again later."
or "Unexpected server error. Please try again.") and keep any internal task/doc
references out of user strings—retain those details only in logs or developer
docs; update the "backendStub" value accordingly in the en.json errors object so
end users see a generic, non-internal message.

In `@apps/frontend/proxy.ts`:
- Around line 26-35: The code currently decodes JWTs in decodeJwtPayload and
then hasValidToken trusts the exp field without verifying the signature; update
decodeJwtPayload (and the similar logic around lines referenced) to parse the
JWT header to obtain alg, reject tokens with alg:"none", and verify the
signature cryptographically (e.g., HMAC SHA-256 verification with the server
secret for HS* or RSA/ECDSA verification with the configured public key for
RS*/ES*) before returning any payload; ensure verification fails for malformed
signatures and only then use exp in hasValidToken.

---

Nitpick comments:
In
`@apps/backend/src/main/java/com/codestar/backend/dto/InstanceBrandingDto.java`:
- Line 3: Replace the vague "// TODO Logo" comment in the InstanceBrandingDto
class with a concrete, actionable TODO that includes scope and traceability:
specify the expected logo source (e.g., "SVG or PNG, max 2MB"), validation rules
(dimensions, allowed formats, field name in DTO), and a ticket or issue
reference (e.g., "ISSUE-1234" or hyperlink to tracked issue) so implementers
know where to follow up; update the comment attached to InstanceBrandingDto to
read like "TODO: Add logo field/validation — accept SVG/PNG up to 2MB, max
512x512px; validate MIME type; see ISSUE-XXXX for design/UX details."

In `@apps/frontend/app/actions/courses.ts`:
- Around line 10-19: The catch blocks in getCourses and getCourseById silently
swallow errors; update both functions to catch the error object (catch (error))
and log it before returning the fallback (e.g., console.error("[getCourses]
Failed to fetch courses:", error) and console.error("[getCourseById] Failed to
fetch course:", error)) so failures are visible while still returning the empty
array or null fallback.

In `@apps/frontend/app/actions/instance.ts`:
- Around line 11-23: The catch block in getInstanceBranding silently swallows
errors; update the catch to accept the error (e.g., catch (error)) and log the
failure before returning DEFAULT_INSTANCE so backend issues are visible. Use a
clear contextual log such as console.error("[getInstanceBranding] Failed to
fetch branding, using default:", error) (or your app logger) and keep the
existing return DEFAULT_INSTANCE; leave apiFetch and DEFAULT_INSTANCE references
unchanged.

In `@apps/frontend/lib/types.ts`:
- Around line 34-48: The union type CourseBlockType contains a non-English
member "BLOC"; update this for clarity by renaming "BLOC" to an English
equivalent (e.g., "BLOCK" or "SECTION") and update any usages of
CourseBlockType, or alternatively add a concise code comment above
CourseBlockType explaining that "BLOC" is intentionally French and what it
represents; ensure you change all references to the symbol CourseBlockType and
the literal "BLOC" in the codebase to keep types and runtime values consistent.
- Around line 73-82: Update the InstanceBranding interface's logo field to a
discriminated union instead of the loose { kind: string; value: string } so
TypeScript enforces valid kind/value pairs; replace logo on InstanceBranding
with a union such as a preset variant (kind: "preset", value: one of the allowed
preset names), an emoji variant (kind: "emoji", value: string) and a url variant
(kind: "url", value: string) so code using InstanceBranding.logo gets proper
type narrowing and autocomplete.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e68ef429-3db9-4e4e-817d-0b43e2cf7260

📥 Commits

Reviewing files that changed from the base of the PR and between 903f4cd and fb3e32e.

⛔ Files ignored due to path filters (1)
  • apps/frontend/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (73)
  • .gitignore
  • apps/backend/src/main/java/com/codestar/backend/dto/InstanceBrandingDto.java
  • apps/backend/src/main/java/com/codestar/backend/security/GroupPermissionService.java
  • apps/frontend/.env.example
  • apps/frontend/.gitignore
  • apps/frontend/CLAUDE.md
  • apps/frontend/app/actions/auth.ts
  • apps/frontend/app/actions/courses.ts
  • apps/frontend/app/actions/instance.ts
  • apps/frontend/app/actions/locale.ts
  • apps/frontend/app/courses/[id]/page.tsx
  • apps/frontend/app/error.tsx
  • apps/frontend/app/globals.css
  • apps/frontend/app/layout.tsx
  • apps/frontend/app/login/login-shell.tsx
  • apps/frontend/app/login/page.tsx
  • apps/frontend/app/not-found.tsx
  • apps/frontend/app/page.tsx
  • apps/frontend/app/robots.ts
  • apps/frontend/app/sitemap.ts
  • apps/frontend/components/auth-provider.tsx
  • apps/frontend/components/brand-mark.tsx
  • apps/frontend/components/brand/section-label.tsx
  • apps/frontend/components/brand/star-mark.tsx
  • apps/frontend/components/brand/wordmark.tsx
  • apps/frontend/components/branding-provider.tsx
  • apps/frontend/components/home/deployment.tsx
  • apps/frontend/components/home/features/block-editor-preview.tsx
  • apps/frontend/components/home/features/index.tsx
  • apps/frontend/components/home/features/leaderboard-preview.tsx
  • apps/frontend/components/home/features/quiz-preview.tsx
  • apps/frontend/components/home/features/roadmap-rail.tsx
  • apps/frontend/components/home/hero.tsx
  • apps/frontend/components/home/join-or-create.tsx
  • apps/frontend/components/home/open-source.tsx
  • apps/frontend/components/home/personas.tsx
  • apps/frontend/components/home/site-footer.tsx
  • apps/frontend/components/home/sovereignty.tsx
  • apps/frontend/components/home/top-nav.tsx
  • apps/frontend/components/locale-switcher.tsx
  • apps/frontend/components/reveal-on-scroll.tsx
  • apps/frontend/components/site-footer.tsx
  • apps/frontend/components/top-nav.tsx
  • apps/frontend/components/ui/badge.tsx
  • apps/frontend/components/ui/button.tsx
  • apps/frontend/components/ui/card.tsx
  • apps/frontend/components/ui/glass-button.tsx
  • apps/frontend/components/ui/glass-card.tsx
  • apps/frontend/components/ui/glass-chip.tsx
  • apps/frontend/components/ui/glass-input.tsx
  • apps/frontend/components/ui/glass-nav.tsx
  • apps/frontend/components/ui/glass.ts
  • apps/frontend/components/ui/icon.tsx
  • apps/frontend/components/ui/icons.tsx
  • apps/frontend/components/ui/mesh-background.tsx
  • apps/frontend/components/ui/tabs.tsx
  • apps/frontend/components/user-menu.tsx
  • apps/frontend/global.d.ts
  • apps/frontend/i18n/request.ts
  • apps/frontend/i18n/routing.ts
  • apps/frontend/lib/api.ts
  • apps/frontend/lib/icons.ts
  • apps/frontend/lib/instance.ts
  • apps/frontend/lib/reveal.ts
  • apps/frontend/lib/roles.ts
  • apps/frontend/lib/safe-redirect.ts
  • apps/frontend/lib/site.ts
  • apps/frontend/lib/types.ts
  • apps/frontend/messages/en.json
  • apps/frontend/messages/fr.json
  • apps/frontend/next.config.ts
  • apps/frontend/package.json
  • apps/frontend/proxy.ts
💤 Files with no reviewable changes (25)
  • apps/frontend/components/home/hero.tsx
  • apps/frontend/components/home/personas.tsx
  • apps/frontend/components/home/open-source.tsx
  • apps/frontend/lib/reveal.ts
  • apps/frontend/components/home/features/index.tsx
  • apps/frontend/components/ui/button.tsx
  • apps/frontend/components/home/join-or-create.tsx
  • apps/frontend/components/home/features/leaderboard-preview.tsx
  • apps/frontend/components/ui/card.tsx
  • apps/frontend/components/ui/icon.tsx
  • apps/frontend/components/home/site-footer.tsx
  • apps/frontend/components/ui/badge.tsx
  • apps/frontend/components/home/features/block-editor-preview.tsx
  • apps/frontend/components/brand/section-label.tsx
  • apps/frontend/components/ui/tabs.tsx
  • apps/frontend/lib/icons.ts
  • apps/frontend/components/home/top-nav.tsx
  • apps/frontend/components/home/deployment.tsx
  • apps/frontend/components/home/features/roadmap-rail.tsx
  • apps/frontend/components/reveal-on-scroll.tsx
  • apps/frontend/components/brand/wordmark.tsx
  • apps/frontend/components/brand/star-mark.tsx
  • apps/backend/src/main/java/com/codestar/backend/security/GroupPermissionService.java
  • apps/frontend/components/home/features/quiz-preview.tsx
  • apps/frontend/components/home/sovereignty.tsx

Comment thread apps/frontend/.gitignore Outdated
Comment thread apps/frontend/app/actions/auth.ts Outdated
Comment thread apps/frontend/app/courses/[id]/page.tsx Outdated
Comment thread apps/frontend/app/login/login-shell.tsx
Comment thread apps/frontend/app/login/login-shell.tsx
Comment thread apps/frontend/components/user-menu.tsx
Comment thread apps/frontend/lib/api.ts
Comment thread apps/frontend/lib/instance.ts Outdated
Comment thread apps/frontend/messages/en.json
Comment thread apps/frontend/proxy.ts Outdated
@teamssUTXO

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 16, 2026

Copy link
Copy Markdown
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/frontend/package.json`:
- Line 12: Update the Node engine constraint in package.json so it matches
Next.js 16.2.4's requirement: locate the "node" entry in the package.json
engines block and change its value from ">=20.3.0" to ">=20.9.0" (i.e., update
the "node" field).

In `@apps/frontend/proxy.ts`:
- Around line 25-34: In verifyToken, avoid calling jwtSecretKey() inside the try
so configuration/runtime errors aren't swallowed; instead call const key =
jwtSecretKey() before the try (letting it throw on missing/invalid config), then
run jwtVerify(token, key, ...) inside the try and in the catch only map
joseErrors.JWTExpired to "expired" and otherwise return "invalid" for
verification failures; ensure you reference verifyToken, jwtSecretKey, jwtVerify
and joseErrors.JWTExpired when making the change.
- Around line 60-93: The token check currently treats any non-"valid" status as
expired; update the verification logic in the block that calls
verifyToken(tokenValue) so it sets hasValidToken = true only when status ===
"valid", sets tokenExpired = true only when status === "expired", and leaves
both false for "invalid" (or other) statuses; adjust downstream behavior already
keyed off hasValidToken/tokenExpired (functions referenced: verifyToken,
hasValidToken, tokenExpired, isOnLogin, isPublic, clearAuthCookie) so
tampered/malformed tokens are not flagged with expired=1.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 78bd17ce-8b82-4840-b587-e2139fe31ae0

📥 Commits

Reviewing files that changed from the base of the PR and between fb3e32e and 2bca540.

⛔ Files ignored due to path filters (1)
  • apps/frontend/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (14)
  • apps/frontend/.gitignore
  • apps/frontend/app/actions/auth.ts
  • apps/frontend/app/courses/[id]/page.tsx
  • apps/frontend/app/login/login-shell.tsx
  • apps/frontend/app/sitemap.ts
  • apps/frontend/components/brand-mark.tsx
  • apps/frontend/components/user-menu.tsx
  • apps/frontend/lib/api.ts
  • apps/frontend/lib/instance.ts
  • apps/frontend/messages/en.json
  • apps/frontend/messages/fr.json
  • apps/frontend/next.config.ts
  • apps/frontend/package.json
  • apps/frontend/proxy.ts
✅ Files skipped from review due to trivial changes (2)
  • apps/frontend/messages/fr.json
  • apps/frontend/.gitignore
🚧 Files skipped from review as they are similar to previous changes (9)
  • apps/frontend/lib/instance.ts
  • apps/frontend/app/sitemap.ts
  • apps/frontend/next.config.ts
  • apps/frontend/messages/en.json
  • apps/frontend/components/brand-mark.tsx
  • apps/frontend/lib/api.ts
  • apps/frontend/app/login/login-shell.tsx
  • apps/frontend/components/user-menu.tsx
  • apps/frontend/app/actions/auth.ts

Comment thread apps/frontend/package.json Outdated
Comment thread apps/frontend/proxy.ts
Comment thread apps/frontend/proxy.ts
@teamssUTXO
teamssUTXO merged commit 316c46d into dev May 16, 2026
1 check passed
@github-project-automation github-project-automation Bot moved this from In review to Done in codestar roadmap May 16, 2026
@teamssUTXO
teamssUTXO deleted the feat/front-login branch May 16, 2026 13:42
@coderabbitai coderabbitai Bot mentioned this pull request May 17, 2026
@coderabbitai coderabbitai Bot mentioned this pull request Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Feature] Login / Signin

1 participant