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

arnab-repo

v0.0.7

Published

Awesome utilities by Arnab

Readme

PPT Monorepo

A modern, full-stack monorepo template for scalable web applications, featuring Next.js, Vite, Express, Prisma, shadcn/ui, and more. Built for rapid development, type safety, and best practices.


Overview

This monorepo provides a robust foundation for building production-grade web applications with multiple frontends (Next.js, Vite), backend APIs (Express, Socket.io), a shared UI library (shadcn/ui), and a PostgreSQL database managed via Prisma. All code is organized for maximum reusability and maintainability.


Tech Stack

  • Frontend: Next.js (React, SSR), Vite (React, SPA)
  • Backend: Express.js (REST API), Socket.io (WebSockets)
  • UI Library: shadcn/ui (customizable React components)
  • Styling: Tailwind CSS
  • Database: PostgreSQL (via Prisma ORM)
  • Type Safety: TypeScript (everywhere)
  • Monorepo Tools: pnpm workspaces, Turborepo
  • Linting/Formatting: ESLint, Prettier
  • Other: dotenv, helmet, morgan, cors, cookie-parser

API Documentation

Express API (apps/expressWeb)

GET /

  • Description: Health check, returns JWT secret (for demo only; do not expose secrets in production).
  • Response: string (JWT secret)

POST /signup

  • Description: Register new users.
  • Request Body:
    • username (string, required)
    • password (string, required)
    • age (number, required)
    • email (string, required)
  • Response:
    • On success: Prisma createMany result (array of created users)
    • On validation error: Zod error format

POST /signin

  • Description: User login (validates input, demo only).
  • Request Body:
    • username (string, required)
    • password (string, required)
  • Response:
    • On success: Zod validation result
    • On error: Zod error format

All endpoints accept and return JSON. CORS is enabled and credentials are supported.


Database Schema

Managed by Prisma (packages/sqlDb/prisma/schema.prisma).

Models

User

  • id (Int, PK, autoincrement)
  • username (String, unique)
  • password (String)
  • age (Int)
  • email (String)
  • todo (Relation: Todo[])

Todo

  • id (Int, PK, autoincrement)
  • title (String)
  • description (String)
  • isDone (Boolean)
  • userId (Int, FK to User)
  • user (Relation: User)
  • time (DateTime, default now())

Relationships:

  • One User has many Todos. Each Todo belongs to one User.

Features

  • Modular monorepo: multiple apps, shared packages
  • Full-stack type safety (TypeScript, Zod)
  • Customizable UI library (shadcn/ui)
  • REST API with validation
  • PostgreSQL database with Prisma ORM
  • Environment variable management with dotenv
  • Secure HTTP headers (helmet), logging (morgan), CORS, cookies
  • Ready for SSR, SPA, and real-time (Socket.io) apps

Architecture

demo1/
├── apps/
│   ├── expressWeb/      # Express.js backend (API)
│   ├── socketWeb/       # Socket.io backend
│   ├── viteWeb/         # Vite + React frontend
│   └── web/             # Next.js frontend (SSR, shadcn/ui)
├── packages/
│   ├── backend-common/  # Shared backend logic/config
│   ├── common/          # Shared types, validation schemas
│   ├── eslint-config/   # Centralized ESLint config
│   ├── sqlDb/           # Prisma schema, DB client
│   ├── typescript-config/ # Shared tsconfig
│   └── ui/              # shadcn/ui component library
├── package.json
├── pnpm-workspace.yaml
├── turbo.json
└── README.md
  • Design: Modular, clean code, separation of concerns, shared code via packages, type safety enforced everywhere.

Best Practices

  • Environment Variables: All secrets/configs via .env files (never commit to VCS)
  • Type Safety: TypeScript and Zod for runtime and compile-time safety
  • Error Handling: Centralized, consistent error responses
  • Logging: HTTP request logging with morgan
  • Security: Helmet for HTTP headers, CORS configured
  • Reusable Code: Shared types, configs, and UI components
  • Prisma Singleton: Prevents connection leaks in dev

Setup Instructions

1. Installation

pnpm install

2. Environment Variables

  • Copy .env.example to .env in each app/package that needs it (e.g., apps/expressWeb/, packages/sqlDb/).
  • Set DATABASE_URL for Prisma, PORT, JWT_SECRET, etc.

3. Database Migration

pnpm --filter sqlDb prisma migrate dev

4. Running in Development

  • Next.js:
    pnpm --filter web dev
  • Vite:
    pnpm --filter viteWeb dev
  • Express:
    pnpm --filter expressWeb dev
  • Socket.io:
    pnpm --filter socketWeb dev

5. Running in Production

  • Build all:
    pnpm build
  • Start apps (example):
    pnpm --filter web start
    pnpm --filter expressWeb start
    # etc.

Testing

  • Add tests in each app/package as needed.
  • Example (Jest, Vitest, or your preferred runner):
    pnpm test
  • Lint all code:
    pnpm lint

Deployment

  • Next.js: Deploy to Vercel, Azure, or any Node.js host
  • Express: Deploy to Azure App Service, Heroku, Render, etc.
  • Database: Use managed PostgreSQL (e.g., Supabase, Azure, AWS RDS)
  • Environment: Set all required env vars in your deployment platform

Contact

Made with ❤️ by Arnab Saha