Sign inSign up

stuartshay/otel-ui

By stuartshay

•Updated 7 months ago

otel-ui - React frontend for otel-demo API

Image
0

5.1K

stuartshay/otel-ui repository overview

⁠otel-ui

Build Lint Docker Hub License: MIT

React frontend for the otel-demo⁠ API with OAuth2 authentication.

⁠Overview

A modern React + TypeScript frontend that consumes the otel-demo Flask API, featuring:

  • OAuth2/PKCE Authentication - AWS Cognito integration
  • Type-safe API Client - Uses @stuartshay/otel-types⁠
  • Distributed Tracing - Displays trace IDs from API responses
  • Responsive Design - Mobile-friendly UI
  • Docker Deployment - nginx container for K8s

Deployment Status: Version 1.0.82 deployed to ui.lab.informationcart.com⁠ šŸš€

Authentication: āœ… Fully functional OAuth2/PKCE flow with login, callback, and logout

⁠Quick Start

# Run setup script
./setup.sh

# Start development server
npm run dev

# Open http://localhost:5173

⁠Development

⁠Git Workflow

āš ļø CRITICAL: Never commit directly to main. All changes must go through pull requests.

  • main - Production branch (protected, PR-only, direct commits forbidden)
  • develop - Development branch (work here for regular changes)
  • feature/ - Feature branches (use for isolated features)

Two workflow options:

Option 1 - Direct develop to main (for regular changes):

git checkout develop
git pull origin develop
# Make your changes
git add .
git commit -m "feat: description"
git push origin develop
# Create PR: develop → main on GitHub

Option 2 - Feature branch (for isolated features):

git checkout develop  # or main
git pull origin develop
git checkout -b feature/my-feature
# Make your changes
git add .
git commit -m "feat: description"
git push origin feature/my-feature
# Create PR: feature/my-feature → main on GitHub

Never do this:

git checkout main
git commit ...  # āŒ FORBIDDEN
git push origin main  # āŒ FORBIDDEN
⁠Prerequisites
  • Node.js 24.x (recommend using nvm⁠)
  • npm 11.x
⁠Environment Configuration

Production (.env):

  • API: https://otel.lab.informationcart.com
  • Auth: https://ui.lab.informationcart.com/callback
  • Used for Docker builds

Development (.env.local):

  • API: http://localhost:8080
  • Auth: http://localhost:5173/callback
  • Copy from .env.example and customize
⁠Commands
CommandDescription
npm run devStart development server (port 5173)
npm run buildBuild for production
npm run previewPreview production build
npm run lint:allRun all linters (ESLint + Markdown)
npm run formatFormat code with Prettier
npm run type-checkTypeScript type check
npx playwright testRun end-to-end tests

⁠Infrastructure

ResourceValue
Production URLhttps://ui.lab.informationcart.com⁠
API Backendhttps://otel.lab.informationcart.com⁠
K8s Clusterk8s-pi5-cluster
Namespaceotel-ui
Docker Hubstuartshay/otel-ui

⁠Troubleshooting

⁠Local Development

Cannot connect to API:

  • Ensure otel-demo is running: cd ../otel-demo && python run.py
  • Check .env.local has VITE_API_BASE_URL=http://localhost:8080
  • Verify CORS is enabled in otel-demo .env

Authentication issues:

  • Clear localStorage: localStorage.clear() in browser console
  • Hard refresh: Ctrl+Shift+R (or Cmd+Shift+R on Mac)
  • Check Cognito redirect URI matches .env.local

Build errors:

# Clean and reinstall
rm -rf node_modules package-lock.json dist
npm install
npm run build

⁠Documentation

⁠License

MIT

Tag summary

Content type

Image

Digest

sha256:a890a618a…

Size

24.9 MB

Last updated

7 months ago

docker pull stuartshay/otel-ui