Auth Split Timeline Simple
Documentation for Sessions
Auth Split: Simple Timeline (For Non-Developers)
Purpose: Explain in plain language what changed, why it matters, and what comes next.
What Was the Problem?
Our login and authentication code lived in one big library. Every time someone opened the app, the entire login UI (forms, buttons, registration screens) loaded immediately—even if the user was already logged in. That made the app slower to start and harder to maintain.
What Did We Do? (Timeline)
Step 1: Split Into Two Libraries
We divided authentication into two parts:
| Library | What It Does | When It Loads |
|---|---|---|
| @auth-core | Login logic, security checks, user menu | Always (small, fast) |
| @auth-ui | Login page, registration form, preferences screens | Only when needed (lazy) |
Why this helps: The app starts faster because heavy UI loads only when the user actually needs it.
Step 2: Move the Right Pieces
- Moved to @auth-core: Services (AuthService, GuestAuthService), guards, interceptors, UserMenuComponent, types
- Kept in @auth-ui: LoginComponent, RegisterComponent, UserPreferences, ConnectChannel, AuthPanel, ProtectedShell
- DesktopOAuthService: Stays in @auth-ui (used for desktop app handshake); imports AuthService from @auth-core
Why this helps: Clear separation: core = always loaded, UI = load on demand.
Step 3: Update All Imports
We updated every file that used authentication to import from the correct library:
- Before: Everything from
@auth-ui - After: Services from
@auth-core, UI components from@auth-ui
Why this helps: The build system knows exactly what to load when, reducing errors and improving performance.
Step 4: Fix ESLint Rules
We removed ESLint exceptions for auth-related libraries. The split now follows the rules properly.
Why this helps: Future changes stay consistent and easier to maintain.
Step 5: Fix Build Cache Issues
Some builds showed old errors even after fixes. We cleared caches and ensured the correct file content was used.
Why this helps: Reliable builds and faster feedback for developers.
What Are the Benefits?
- Faster startup — Users see the app sooner
- Smaller initial bundle — Less code loaded upfront
- Clearer structure — Easier to understand and change
- Better maintainability — Changes follow patterns
What Comes Next?
- Verify all apps: Run all apps (gograb-dev, gograb-ai, gograb-admin, docs-angular) to confirm they build and run
- Monitor build: Watch for any remaining import errors
- Document conventions: Add patterns so future agents avoid mixing imports
Summary for Stakeholders
| Before | After |
|---|---|
| One auth library | Two: core (always) + UI (lazy) |
| Slow startup | Faster startup |
| Mixed imports | Clear import rules |
| ESLint exceptions | Clean rules |
Date: 2026-03-14 | Session: S222