Search and explore npm and PyPI packages from a single interface — download trends, version history, GitHub stars, and more.
- Multi-registry search — npm and PyPI in one place
- Package analytics — download stats, version history, trend charts
- GitHub stars — live star counts pulled from the GitHub API
- Redis caching — in-flight deduplication and graceful degradation when Redis is unavailable
- Rybbit analytics — optional, privacy-friendly; supports self-hosted instances
- Dark/light mode — system-aware theme toggle
- Typesafe — strict TypeScript + Zod validation at all API boundaries
- Extensible — add new registries with a single adapter file
| Layer | Technology |
|---|---|
| Framework | Next.js 16 (App Router, RSC) |
| Runtime | Bun |
| UI | shadcn/ui (Maia style, emerald theme) |
| Styling | Tailwind CSS v4 |
| Charts | Recharts |
| Cache | Redis (ioredis) |
| Analytics | Rybbit (optional, self-hosted or cloud) |
| Validation | Zod |
| Font | JetBrains Mono |
# Clone
git clone https://github.com/amitgoesbrr/pkgx.git
cd pkgx
# Install dependencies
bun install
# Copy and edit environment variables
cp .env.example .env.local
# Start Redis (skip if you have an external Redis URL)
docker compose up -d
# Start dev server
bun devOpen http://localhost:3000.
Copy .env.example to .env.local and fill in the values.
| Variable | Required | Default | Description |
|---|---|---|---|
REDIS_URL |
Yes | redis://localhost:6379 |
Redis connection URL. Use rediss:// for TLS (e.g. Upstash). |
NEXT_PUBLIC_RYBBIT_SITE_ID |
No | — | Rybbit site ID. Leave empty to disable analytics. |
NEXT_PUBLIC_RYBBIT_SCRIPT_URL |
No | https://app.rybbit.io/api/script.js |
Rybbit script URL. Override for self-hosted instances. |
GITHUB_TOKEN |
No | — | GitHub personal access token. Raises rate limit from 60 to 5 000 req/hr. |
PACKAGE_CACHE_TTL |
No | 3600 |
Cache TTL in seconds for package detail responses. |
STATS_CACHE_TTL |
No | 3600 |
Cache TTL in seconds for download stats responses. |
SEARCH_CACHE_TTL |
No | 900 |
Cache TTL in seconds for search results. |
app/ — Pages and API routes
components/ — UI components (shadcn + custom)
lib/ — Core utilities, cache, registry adapters
hooks/ — React hooks
types/ — TypeScript type definitions
- Create types in
types/<registry>.ts - Implement
RegistryAdapterinlib/registries/<registry>.ts - Register in
lib/registries/index.ts - Add config entry to
lib/constants.ts