Skip to content

Latest commit

Β 

History

History
133 lines (107 loc) Β· 5.72 KB

File metadata and controls

133 lines (107 loc) Β· 5.72 KB

Callora Frontend

Web app for the Callora API marketplace: developer dashboard, API management, and billing views.

Tech stack

  • React 18 + TypeScript
  • Vite for build and dev server
  • React Router v6 for client-side routing
  • Minimal UI (no component library); ready to extend

What's included

  • Landing page with product overview
  • Dashboard (usage stats, vault balance)
  • Screen-reader-friendly dashboard usage gauge with visible usage state and remaining allowance
  • Marketplace (browse and compare APIs)
  • Pinned APIs on the dashboard for fast access to saved marketplace APIs
  • Billing (USDC deposit, Stellar settlement, transaction tracking)
  • API Usage analytics view
  • 500 error page with retry flow
  • 404 catch-all page
  • Theme playground for previewing primary/accent/surface tokens live
  • Dev proxy to backend at http://localhost:3000 for /api
  • Global Command Palette: Instantly jump to views, search APIs by name, cycle/toggle light & dark themes, or trigger vault deposits. Use Cmd+K on macOS or Ctrl+K on Windows/Linux to open.
  • Pattern-based status badges: Status indicators now use distinct textures in addition to color so they remain understandable for color-blind users and in grayscale displays.

Keyboard shortcuts

  • Open Command Palette: Cmd + K (macOS) or Ctrl + K (Windows/Linux)
  • Navigate options: Up / Down Arrow keys
  • Select option: Enter
  • Close Palette: Escape or backdrop click

UI Design System

Callora uses a comprehensive design token system and component library. All contributors must follow the UI Design System guide when building or modifying UI.

Key principles:

  • Use design tokens, not inline hex values β€” All colors, spacing, and shadows use CSS custom properties
  • Reuse shared components β€” Use existing components from src/components/ before creating new ones
  • Maintain accessibility β€” All UI must be keyboard navigable and screen reader friendly
  • Test both themes β€” Verify appearance in both light and dark modes

Local setup

  1. Prerequisites: Node.js 18+

  2. Install and run:

    npm install
    npm run dev
  3. Open http://localhost:5173.

Accessibility notes

The dashboard includes an accessible usage gauge that summarizes API spend for the current cycle. It exposes role="progressbar", numeric ARIA values, and a human-readable usage state such as β€œWithin limit”, β€œApproaching limit”, β€œCritical usage”, β€œLimit reached”, or β€œNo limit configured” so screen-reader users receive the same status information as sighted users.

Scripts

Command Description
npm run dev Start dev server (port 5173)
npm run build TypeScript check + production build
npm run preview Serve production build locally

Routes

Path Description
/ Landing page
/dashboard Developer dashboard
/marketplace API marketplace
/billing USDC deposit and settlements
/api-usage API usage analytics
/theme-playground Live theme token playground for designers
/500 Server error page
* 404 not found

Project layout

callora-frontend/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ App.tsx              # Router, layout, and route definitions
β”‚   β”œβ”€β”€ main.tsx             # Entry point
β”‚   β”œβ”€β”€ index.css            # Global styles and design tokens
β”‚   β”œβ”€β”€ ThemeContext.tsx      # Light/dark theme context
β”‚   β”œβ”€β”€ ThemeToggle.tsx      # Theme toggle component
β”‚   β”œβ”€β”€ ApiUsage.tsx         # API usage analytics view
β”‚   β”œβ”€β”€ config/              # Shared app configuration
β”‚   β”‚   └── constants.ts     # App constants (URLs, deposit limits, loading delay)
β”‚   β”œβ”€β”€ components/          # Shared UI components
β”‚   β”‚   β”œβ”€β”€ ApiCard.tsx
β”‚   β”‚   β”œβ”€β”€ Breadcrumb.tsx
β”‚   β”‚   β”œβ”€β”€ CodeExample.tsx
β”‚   β”‚   β”œβ”€β”€ CommandPalette.css
β”‚   β”‚   β”œβ”€β”€ CommandPalette.test.tsx
β”‚   β”‚   β”œβ”€β”€ CommandPalette.tsx
β”‚   β”‚   β”œβ”€β”€ CommandPalette_MANUAL_TEST_PLAN.md
β”‚   β”‚   β”œβ”€β”€ Dashboard.tsx
β”‚   β”‚   β”œβ”€β”€ EmptyState.tsx
β”‚   β”‚   β”œβ”€β”€ FiltersSidebar.tsx
β”‚   β”‚   β”œβ”€β”€ NotFound.tsx
β”‚   β”‚   β”œβ”€β”€ SearchBar.tsx
β”‚   β”‚   β”œβ”€β”€ ServerError.tsx
β”‚   β”‚   β”œβ”€β”€ ServerErrorDemo.tsx
β”‚   β”‚   └── Skeleton.tsx
β”‚   β”œβ”€β”€ pages/               # Standalone page components
β”‚   β”‚   β”œβ”€β”€ ApiDetailPage.tsx
β”‚   β”‚   └── MarketplacePage.tsx
β”‚   β”œβ”€β”€ hooks/               # Custom React hooks
β”‚   β”‚   └── useDebounce.ts
β”‚   β”œβ”€β”€ data/                # Static and mock data
β”‚   β”‚   └── mockApis.ts
β”‚   β”œβ”€β”€ utils/               # Utility functions
β”‚   β”‚   └── format.ts        # Currency formatters (formatUsdc, formatUsdShortcut, formatPrice)
β”‚   └── vite-env.d.ts
β”œβ”€β”€ docs/
β”‚   └── UI-Design-System.md
β”œβ”€β”€ index.html
β”œβ”€β”€ package.json
β”œβ”€β”€ tsconfig.json
└── vite.config.ts

This repo is part of Callora. Backend and contracts live in separate repos: callora-backend, callora-contracts.

See CONTRIBUTING.md for contribution guidelines.