npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

ldaca_web_app_frontend

v0.1.7

Published

LDaCA Web App Frontend - React application for text analytics and corpus analysis

Readme

LDaCA Frontend

React + TypeScript frontend for the LDaCA Web Application.

Quick Start

Option 1: Run via npx (Recommended)

# Run production build with single command
npx ldaca_web_app_frontend
# Frontend will run on http://localhost:3000
# Backend assumed at http://localhost:8001

Option 2: Local Development

# Install dependencies
npm install

# Run dev server (no .env file needed!)
npm run dev
# Frontend will run on http://localhost:3000
# Backend assumed at http://localhost:8001

Environment Variables

The frontend does NOT require a .env file - all variables have sensible defaults.

Why Two Types of Variables?

Vite distinguishes between:

  • Build-time variables (FRONTEND_PORT) - Only available to Node.js/Vite dev server
  • Runtime variables (VITE_*) - Exposed to browser code (must have VITE_ prefix)

Available Variables

| Variable | Type | Default | Purpose | |----------|------|---------|---------| | FRONTEND_PORT | Build-time | 3000 | Dev server port (Node.js side) | | VITE_BACKEND_PORT | Runtime | 8001 | Backend API port (browser side) | | VITE_BACKEND_API_BASE | Runtime | Auto-detected | Full backend URL override | | VITE_GOOGLE_CLIENT_ID | Runtime | - | Google OAuth (multi-user mode only) |

Usage Examples

# Custom frontend port
FRONTEND_PORT=4000 npm run dev

# Custom backend port
VITE_BACKEND_PORT=9000 npm run dev

# Both at once
FRONTEND_PORT=4000 VITE_BACKEND_PORT=9000 npm run dev

# Full backend URL (for remote backend)
VITE_BACKEND_API_BASE=https://api.example.com/api npm run dev

API URL Detection Logic

The frontend automatically detects where the backend is:

  1. Explicit override: VITE_BACKEND_API_BASE (if set)
  2. Custom port: Uses VITE_BACKEND_PORT (default: 8001)
  3. Localhost detection: On localhost/127.0.0.1, connects to http://localhost:${VITE_BACKEND_PORT}/api
  4. JupyterHub/Binder: Handles proxied paths like /user/<name>/proxy/8001/
  5. Production: Same-origin /api

Development

# Install dependencies
npm install

# Run dev server
npm run dev

# Build for production
npm run build

# Preview production build
npm run preview

# Type check
npm run type-check

# Lint
npm run lint

Production Build

npm run build

Output goes to build/ directory. Serve with any static file server:

# Using Python
python -m http.server 3000 -d build

# Using Node.js serve
npx serve build -p 3000

Architecture

  • React 19 with TypeScript
  • TanStack Query v5 for server state
  • Zustand for client state
  • XYFlow for workspace graph visualization
  • Tailwind CSS + Radix UI for styling
  • Vite for build tooling

Key Directories

src/
├── api/          # API client (axios, query functions)
├── components/   # React components
├── hooks/        # Custom React hooks
├── lib/          # Utilities
├── providers/    # Context providers
├── stores/       # Zustand stores
└── types/        # TypeScript types

Notes

  • The frontend expects the backend at /api by default
  • For local development, it auto-connects to http://localhost:8001/api
  • No .env file is required for basic development
  • All environment variables are optional with sensible defaults