Skip to content

Next: Towards new arena and backoffice#560

Draft
Axolotle wants to merge 434 commits into
developfrom
next
Draft

Next: Towards new arena and backoffice#560
Axolotle wants to merge 434 commits into
developfrom
next

Conversation

@Axolotle

@Axolotle Axolotle commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

#518 (new layout)

  • new global arena layout with side bar
  • moved /modeles & /ranking to arena

#548 (Complete rewrite of LLMs data)

  • Added LLMData, LLMEndpoint, LLMLab and LLMLicense db models
  • Added proper migration of models.json to db models
  • Reworked back and front accordingly
  • Add some redis cache mecanism to invalidate cached LLM data on every instances
  • Reworked front LLM info and reveal cards
  • Reworked front LLM list page
  • Added new cli commands:
    • ./comparia-cli llms export to export our db llm data to json for other instance to import (to be discussed)
    • ./comparia-cli llms import to import from json (to be discussed)
    • ./comparia-cli internal types|i18n|all to manage types/constants/archs/i18n internal generation
  • Added autogeneration of newly added models to typescript from pydantic types (could be done for other pydantic/sqlmodels too at some point)
  • Dropped all legacy LLM data generation code and commands
  • Removed github job models-update.yml

#547

  • Adds email passwordless auth (magic code) via FastAPI router and services
  • Backend: new auth router with request/verify/logout/me endpoints, SMTP relay for sending codes, Redis rate limiting, Alembic migrations for user/session/consent tables
  • Frontend: auth state module, sign-in modal, settings dropdown with logout in NavBar

#558

  • Add user role field (user/admin) on User model with alembic migration
  • Admin backend router with user listing and role management
  • CLI command to seed admin users from ADMIN_EMAILS env var
  • Admin frontend layout with guard and users page

#559

  • Server-side redirect wall for sign_in_required mode
  • Dedicated /login page with configurable branding
  • 401 interceptor in API client
  • Enrich GET /auth/config with smtp_configured and domain_allowlist
  • Admin auth config read-only page and sidebar navigation

#565 (Quickly add history list)

  • add comparison_id param on all arena routes
  • add new cookie/token for anonymous visitor and save it on Comparison
  • add new middleware that set that cookie
  • add revealed and revealed_at columns to Comparison (default to false for previous
  • compute reveal data in ComparisonPublic
  • add route to query comparison list if logged in

Todo

TODO

  • locales cleaning (some keys could be removed, all legacy llm i18n keys should be removed)
  • llms data
    • find a way to dynamicly add LLMLab.logo to unocss from db?
  • auth
    • Handle sociodemographic data in sign in form and database
    • Check frontend respect component system
    • Should we add a role anonymous to User instead of a extra anonymous session cookie?
    • add ability to merge previous comparison (from anonymous cookie or visitor_id?) on account creation (checkbox opt-in)
  • admin
    • users:
      • Actions par ligne (promouvoir/rétrograder, supprimer)
      • Invite user flow
      • Search/filter by email
  • history
    • improve history list + optimize by querying only selected comparison (currently fetch all comparisons)

Infra

  • run make db-migrate
    • WARNING: make sure to also pass OPENROUTER_API_KEY, HF_INFERENCE_KEY, ORDBOGEN_API_KEY as env vars to this command to properly migrate and activate endpoints for migration 4e31217520dd

Test

#547

  • Sign in flow: enter email, receive code, enter code, see confirmation toast
  • Sign out: settings dropdown -> logout clears session
  • Auth state persists across page reloads via GET /auth/me

#558

  • Set ADMIN_EMAILS=your@email.fr and run db-seed-admins
  • Log in and verify /admin is accessible
  • Non-admin users are redirected to /

#559

  • Set AUTH_ACCESS_POLICY=sign_in_required in both backend and frontend .env
  • Visiting any page redirects to /login
  • Login flow works from /login, redirects back to original destination
  • Logout redirects to /login
  • /admin/configuration/auth shows current config state

@Axolotle
Axolotle changed the base branch from develop to fix-unknown-llms July 3, 2026 08:09
@e-lie
e-lie marked this pull request as draft July 8, 2026 07:58
Axolotle and others added 30 commits July 16, 2026 16:50
Améliore le bilan énergétique de la révélation
Fix: data fetching, error handling and auth handling
NavBar reads the comparisons context unconditionally since logout()
started clearing it, but the admin layout never initialized it,
causing a missing_context crash on every /admin/* page.
…ntext

fix(front): init comparisons context in admin layout
Add User/UserUpsert/UserPublic split, a generic edit form and a manual
add-user flow, replacing the dedicated promote-to-admin modal.
updateComparisonsContext can fail after /auth/logout already cleared
the session (eg. sign_in_required blocks /arena/* without one),
leaving an unhandled rejection instead of resetting the list.
auth/initAuth were removed from auth.svelte.ts when it moved to a
context-based API, but this page still referenced them, causing a
500 on every invite link.
Users created directly from the admin panel had no invite token and
no login code, so they fell into the generic "unknown" source bucket
alongside users mid email-code signup. Give them their own label.
update_user let a role change silently strip admin access from the
last admin, with no equivalent to delete_user's CannotDeleteLastAdminError
guard. Add the same protection for role changes.
onSubmit only handled ValidationError; any other error (eg. the 400
"Email already registered" from create_user) was silently swallowed,
so the form looked like it did nothing.
The auth-error-on-server-side issue this ssr=false was working around
is already handled globally via UnauthorizedError + hooks.server.ts;
no other admin upsert page (llms, labs, endpoints, licenses) needs it.
align users admin with LLM backoffice upsert/jsonschema pattern
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

4 participants