How ariyoaresa/tracknelf works
Purpose and Runtime
This is a Next.js App Router application for an authenticated personal-finance experience centered on loans, repayment tracking, learning content, and user profiles. It runs as a TypeScript React web application, with Next.js serving page routes and an authentication API endpoint. The README is the default Next.js scaffold and does not document domain behavior.
Route and Layout Structure
The root application shell is defined in src/app/layout.tsx, with global styling in src/app/globals.css. Public authentication entry is src/app/login/page.tsx.
Authenticated pages are grouped under src/app/(authenticated), which applies a shared protected-area layout via src/app/(authenticated)/layout.tsx. Primary destinations are dashboard (src/app/(authenticated)/page.tsx), loans (src/app/(authenticated)/loans/page.tsx), tracker (src/app/(authenticated)/tracker/page.tsx), learning (src/app/(authenticated)/learn/page.tsx), and profile (src/app/(authenticated)/profile/page.tsx).
Authentication Boundary
Better Auth is exposed through the catch-all App Router endpoint src/app/api/auth/[...better-auth]/route.ts. Server-side authentication configuration is expected in src/lib/auth.ts, while browser-facing auth interaction is isolated in src/lib/auth-client.ts.
src/contexts/AuthContext.tsx is the client-side session/auth state boundary for UI consumers. The authenticated route-group layout is the likely control point for gating protected content and composing the signed-in application shell.
Shared Application Shell
Navigation and account-oriented UI are componentized rather than embedded in individual pages. src/components/Navbar.tsx and src/components/Sidebar.tsx define primary navigation surfaces, while src/components/ThemeToggle.tsx handles presentation-mode switching. src/components/OnboardingModal.tsx and src/components/DutyBanner.tsx provide cross-page user guidance or status messaging.
This separation allows authenticated pages to focus on domain content while the shared layout owns navigation, auth-aware presentation, and persistent UI.
Loan and Tracking Domain
Loan-facing presentation is represented by src/components/FeaturedLoanCard.tsx, suggesting the dashboard or loans route highlights a selected/current loan. Domain calculations and formatting should remain centralized in src/lib/loan-utils.ts rather than duplicated across src/app/(authenticated)/loans/page.tsx and src/app/(authenticated)/tracker/page.tsx.
The likely flow is: authenticated user enters dashboard or loans area, loan data is obtained through the API/data layer, utilities derive loan-specific values, and pages render summaries or repayment-tracking views.
Client Data and Provider Boundary
src/providers/QueryProvider.tsx establishes an application-level client data-query/cache provider, likely consumed by authenticated pages and components. src/lib/api.ts is the dedicated boundary for client-side requests or backend integration.
The intended dependency direction is UI routes/components → query provider and API abstraction → external/backend services. No domain-specific backend, database, or third-party financial provider is visible in the tree; Better Auth is the only explicit external service integration.
Deployment and Infrastructure
The project uses Next.js configuration at next.config.ts and is deployable to a standard Next.js host, with Vercel referenced by the scaffold README. Static browser assets belong under public. No separate worker, server process, database schema, infrastructure-as-code, or service integration is present in the supplied repository structure.
Main entry points: (authenticated)/layout.tsx Authenticated layout · app/layout.tsx Root layout · loans/page.tsx Loans · tracker/page.tsx Repayment tracker
Components 20
App Routes
Next.js App Router pages and layouts.
- Root layout
src/app/layout.tsx - Login
src/app/login/page.tsx - Authenticated layout · Gates and composes the signed-in experience.
src/app/(authenticated)/layout.tsx - Dashboard
src/app/(authenticated)/page.tsx - Loans
src/app/(authenticated)/loans/page.tsx - Repayment tracker
src/app/(authenticated)/tracker/page.tsx - Learning
src/app/(authenticated)/learn/page.tsx - Profile
src/app/(authenticated)/profile/page.tsx
Shared UI
Persistent authenticated application surfaces.
- Navbar
src/components/Navbar.tsx - Sidebar
src/components/Sidebar.tsx - Guidance UI · Onboarding and duty/status messaging.
src/components/OnboardingModal.tsx - Theme toggle
src/components/ThemeToggle.tsx - Featured loan card
src/components/FeaturedLoanCard.tsx
Auth and Data
Client state, requests, and server authentication.
- Auth context · Auth-aware state boundary for UI consumers.
src/contexts/AuthContext.tsx - Query provider
src/providers/QueryProvider.tsx - API abstraction
src/lib/api.ts - Loan utilities · Centralizes loan calculations and formatting.
src/lib/loan-utils.ts - Auth client
src/lib/auth-client.ts - Better Auth endpoint
src/app/api/auth/[...better-auth]/route.ts - Auth configuration
src/lib/auth.ts
Connections 22
- Root layout → Login: renders route
- Root layout → Authenticated layout: wraps route group
- Authenticated layout → Dashboard: renders
- Authenticated layout → Loans: renders
- Authenticated layout → Repayment tracker: renders
- Authenticated layout → Learning: renders
- Authenticated layout → Profile: renders
- Authenticated layout → Navbar: composes
- Authenticated layout → Sidebar: composes
- Authenticated layout → Guidance UI: shows
- Authenticated layout → Theme toggle: composes
- Authenticated layout → Auth context: uses session
- Root layout → Query provider: provides cache
- Dashboard → Featured loan card: highlights loan
- Loans → Loan utilities: calculates
- Repayment tracker → Loan utilities: calculates
- Featured loan card → Loan utilities: formats values
- Loans → API abstraction: loads data
- Repayment tracker → API abstraction: loads data
- Auth context → Auth client: uses
- Auth client → Better Auth endpoint: auth requests
- Better Auth endpoint → Auth configuration: configures