Skip to content

feat: add portal page with application grid and settings navigation#15

Merged
TymekV merged 2 commits into
aginrocks:masterfrom
PawiX25:portal-page
Apr 7, 2026
Merged

feat: add portal page with application grid and settings navigation#15
TymekV merged 2 commits into
aginrocks:masterfrom
PawiX25:portal-page

Conversation

@PawiX25

@PawiX25 PawiX25 commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Replaces the placeholder root page (/) with a proper portal that shows authenticated users their available applications and links to account settings.

Changes

Backendserver/src/routes/api/applications.rs

  • New GET /api/applications endpoint behind require_auth middleware
  • Returns applications filtered by the user's group membership (allowed_groups empty = visible to all, non-empty = user must belong to at least one group)
  • Returns minimal UserApplication { name, slug, icon } response

Frontendapps/frontend/app/page.tsx

  • Unauthenticated users → redirect to /login
  • Authenticated users → portal with:
    • Welcome header with display name, email, and sign out button
    • Application grid (cards with icon or initial letter fallback)
    • "Account Settings" card linking to /dashboard
    • Empty state placeholder when no applications are available
  • Fade-in animation via motion/react

API Schemapackages/api-schema/api.d.ts

  • Added UserApplication schema and get_my_applications operation types

Self-Review Checklist:

  • I've split up large pieces of code into smaller, reusable pieces
  • No logic is duplicated that could be abstracted into a function, method, hook or middleware
  • I've commented my code where needed and avoided comments that provide no value

Frontend checklist

  • I've checked my code for duplicate components or UI elements that already exist elsewhere in the codebase
  • Data fetching and mutations use React Query
  • Forms use useForm — N/A (no forms in this PR)
  • I've formatted my code using Prettier

Backend checklist

  • Logic is not reimplemented manually when a suitable crate already exists
  • I've used the validator crate for API input validation — N/A (no user input in this endpoint)
  • I've formatted my code using rustfmt
  • My code produces no new warnings with Clippy enabled

- Add user-facing GET /api/applications endpoint that returns
  applications filtered by user's group membership
- Replace placeholder root page with portal showing:
  - Welcome header with user info and sign out
  - Application grid with group-based access control
  - Account Settings card linking to /dashboard
- Add UserApplication schema to API types

@TymekV TymekV left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Image

The Account Settings button feels off. You could do a dropdown menu in the place of the Sign out button with options to sign out or view settings.

Or alternatively, you could try doing something similar to Authentik:

Image

Comment thread server/src/routes/api/applications.rs Outdated
.find_one(doc! { "_id": *user_id })
.await?;

let user_groups: Vec<ObjectId> = user.map(|u| u.groups).unwrap_or_default();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Remove types that can be inferred.

Suggested change
let user_groups: Vec<ObjectId> = user.map(|u| u.groups).unwrap_or_default();
let user_groups = user.map(|u| u.groups).unwrap_or_default();

Comment thread server/src/routes/api/applications.rs Outdated

let apps: Vec<Application> = state
.database
.collection::<Application>("applications")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same here

Suggested change
.collection::<Application>("applications")
.collection("applications")

- Add user dropdown (avatar initial, display name) replacing the separate
  Sign out button and Account Settings card; shows account settings link
  and log out option
- Add shared DropdownMenu UI component (Radix UI primitives)
- Remove explicitly annotated types that Rust can infer in applications.rs
- Unify log out label with dashboard (was "Sign out")
@TymekV TymekV merged commit 8225917 into aginrocks:master Apr 7, 2026
2 checks passed
@PawiX25 PawiX25 deleted the portal-page branch April 9, 2026 22:32
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.

2 participants