How aha-shaf/optisuite works
Purpose and runtime
A Next.js TypeScript dashboard for optimizing SaaS applications: usage analytics, license management, vendor/role/user views, recommendations, notifications, and an AI interface. It runs as a React/Next.js application, styled with Tailwind CSS. Primary application entry points are app/layout.tsx and app/page.tsx.
Application shell and navigation
The shared dashboard frame likely owns persistent navigation, header content, and page composition:
• components/dashboard-shell.tsx
• components/app-sidebar.tsx
• components/dashboard-header.tsx
Route pages under app/ provide the feature-level entry points, including the root dashboard at app/page.tsx.
Authentication boundary
Login is implemented as a dedicated page plus a server API endpoint:
• app/login/page.tsx
• components/login-form.tsx
• app/api/auth/login/route.ts
Client-side access control is represented by components/auth-guard.tsx, while authentication-related logic is centralized in lib/auth.ts. This separates protected dashboard UI from the login/API boundary.
Dashboard and analytics presentation
The dashboard composes reusable metric, chart, alert, and status components to display optimization signals:
• app/analytics/page.tsx
• components/metric-card.tsx
• components/chart-card.tsx
• components/heatmap-card.tsx
Analytics is a routed UI surface; chart components are presentation boundaries that should remain independent of API or source-data acquisition.
SaaS management domains
Dedicated routes organize the core entities and decision workflows:
• Licenses: app/licenses/page.tsx, app/licenses/details/page.tsx, components/license-table.tsx
• Organization views: app/users/page.tsx, app/roles/page.tsx, app/vendors/page.tsx
• Optimization actions: app/recommendations/page.tsx, components/recommendation-card.tsx
The license details route is the apparent drill-down boundary, while tables/cards provide reusable views across entity and recommendation workflows.
Profile, settings, and notifications
User-specific and operational UI is split into independent routed areas:
• app/settings/page.tsx
• app/notifications/page.tsx
• components/profile-card.tsx
Profile data has its own API boundary at app/api/profile-data/route.ts, allowing profile UI to fetch or evolve separately from authentication.
AI interaction and data model
The AI feature is a first-class route with a reusable chat panel:
• app/ai/page.tsx
• components/ai-chat-panel.tsx
The repository currently appears to use local mock-backed domain data and shared types rather than a visible database or external SaaS-provider integration:
• data/mock.tsx
• types/index.ts
Those files form the primary data-contract boundary for pages and components. No external infrastructure, persistence layer, or AI-provider server endpoint is present in the supplied tree.
Main entry points: app-sidebar.tsx App Sidebar · mock.tsx Mock Domain Data · dashboard-shell.tsx Dashboard Shell · page.tsx Analytics
Components 24
App Shell
- Root Layout · Application entry and shared page frame.
app/layout.tsx - Dashboard Shell · Composes persistent dashboard chrome.
components/dashboard-shell.tsx - App Sidebar
components/app-sidebar.tsx - Dashboard Header
components/dashboard-header.tsx
Feature Routes
- Dashboard · Root optimization overview.
app/page.tsx - Analytics
app/analytics/page.tsx - Analytics Cards · Metric, chart, heatmap, alert, and status views.
components/chart-card.tsx - Licenses
app/licenses/page.tsx - License Details
app/licenses/details/page.tsx - License Table
components/license-table.tsx - Users, Roles & Vendors · Organization entity views.
app/users/page.tsx - Recommendations
app/recommendations/page.tsx - Recommendation Card
components/recommendation-card.tsx - AI
app/ai/page.tsx - AI Chat Panel
components/ai-chat-panel.tsx - Settings & Notifications · Independent operational user surfaces.
app/settings/page.tsx
Authentication
- Login
app/login/page.tsx - Login Form
components/login-form.tsx - Login API
app/api/auth/login/route.ts - Auth Logic
lib/auth.ts - Auth Guard
components/auth-guard.tsx - Profile Data API
app/api/profile-data/route.ts
Data Contracts
- Mock Domain Data · Current source for SaaS domain data.
data/mock.tsx - Domain Types
types/index.ts
Connections 25
- Root Layout → Dashboard Shell: frames
- Dashboard Shell → App Sidebar: includes
- Dashboard Shell → Dashboard Header: includes
- Dashboard Shell → Auth Guard: protects UI with
- App Sidebar → Dashboard: navigates to
- App Sidebar → Analytics: navigates to
- App Sidebar → Licenses: navigates to
- App Sidebar → Recommendations: navigates to
- App Sidebar → AI: navigates to
- Analytics → Analytics Cards: composes
- Licenses → License Table: renders
- License Table → License Details: drills into
- Recommendations → Recommendation Card: renders
- AI → AI Chat Panel: hosts
- Login → Login Form: renders
- Login Form → Login API: submits credentials
- Login API → Auth Logic: uses
- Auth Guard → Auth Logic: checks session via
- Dashboard → Mock Domain Data: reads
- Analytics → Mock Domain Data: reads
- Licenses → Mock Domain Data: reads
- Users, Roles & Vendors → Mock Domain Data: reads
- Recommendations → Mock Domain Data: reads
- Mock Domain Data → Domain Types: conforms to
- Profile Data API → Domain Types: returns