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

@lid-vizion/pose-analysis

v0.1.2

Published

Pose analysis library with MediaPipe, Gemini-powered custom exercises, and MongoDB persistence

Readme

Pose Analysis Library

This library provides real-time human pose analysis using MediaPipe. It includes React components for video and live camera analysis, along with standalone logic for counting repetitions and providing feedback for specific exercises.

📂 Project Structure

libraries/pose-analysis/
├── src/
│   ├── analyzers/         # Core exercise logic (pure TypeScript)
│   │   ├── squat.ts       # Squat form analysis
│   │   ├── kettlebell.ts  # Single Hand Snatch analysis
│   │   ├── long_cycle.ts  # Long Cycle (Double Kettlebell) analysis
│   │   └── types.ts       # Shared interfaces
│   ├── components/        # React UI components
│   │   ├── AnalysisPage.tsx # Video/Image upload & analysis
│   │   ├── ExercisePage.tsx # Live webcam exercise tracking
│   │   └── BottomNav.tsx    # Navigation component
│   ├── hooks/             # Custom React hooks
│   │   └── usePoseDetection.ts # MediaPipe integration hook
│   ├── lib/               # Utilities
│   │   └── utils.ts       # Helper functions (cn, etc.)
│   └── index.ts           # Public API exports
├── dev-app/               # Standalone Vite development app
├── start-dev.sh           # Script to build & run dev-app
├── package.json           # Library dependencies
└── tsconfig.json          # TypeScript configuration

🏋️ implemented Exercises

1. Squat Form (squat.ts)

  • Logic: Calculates the angle between Hip, Knee, and Ankle.
  • States: UP -> DOWN -> UP.
  • Feedback: Checks depth (< 90 degrees) and full extension.

2. Single Hand Kettlebell Snatch (kettlebell.ts)

  • Logic: Tracks wrist position relative to shoulder (top) and hip (bottom).
  • States: Independent UP/DOWN states for Left and Right arms.
  • Feedback: "Left Up!", "Right Rep Complete!", etc.

3. Long Cycle (Double Kettlebell) (long_cycle.ts)

  • Logic: Tracks BOTH hands simultaneously.
  • Requirement: Both wrists must move from below hips to above shoulders and back down together.
  • Feedback: "Lift both hands!", "Rep Complete!".

🚀 Standalone Development

You can run this library in isolation without the main app.

  1. Navigate to directory:
    cd libraries/pose-analysis
  2. Run the dev script:
    ./start-dev.sh
    # Or on Windows Git Bash:
    bash start-dev.sh
    This will:
    • Install dependencies for the dev-app.
    • Build the library.
    • Start a local Vite server at http://localhost:5173.

🔌 Integration Guide

Frontend (React App)

To use these components in the main baas application:

  1. Add Dependency: Add to root package.json:
    "@lid-vizion/pose-analysis": "workspace:*"
  2. Install:
    npm install
  3. Import & Route: In src/App.tsx:
    import { AnalysisPage, ExercisePage } from "@lid-vizion/pose-analysis";
        
    // In Routes:
    <Route path="/analysis" element={<AnalysisPage />} />
    <Route path="/exercise" element={<ExercisePage />} />

Backend (AWS Lambda)

To run analysis logic on the server (e.g., for processing uploaded videos):

  1. Handler: A handler file has been created at lambda/src/handlers/pose-analysis.ts.

    • It imports the analyzers (SquatAnalyzer, etc.) directly.
    • Uncomment the code in this file to enable it.
  2. Infrastructure (SAM): A resource definition has been added to lambda/workspace-template.yml.

    • Uncomment the PoseAnalysisFunction section to provision the Lambda.
  3. Dependencies: Add @lid-vizion/pose-analysis to lambda/package.json if you want to share the exact same logic code between frontend and backend.

🛠 Dependencies

  • @mediapipe/pose: AI model for body tracking.
  • react-webcam: For handling camera input.
  • lucide-react: UI icons.
  • tailwindcss: Styling (via clsx and tailwind-merge).