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

ts-node-react-mongo-boilerplate

v1.0.14

Published

TS-NODE-REACT-MONGO-BOILERPLATE

Readme

TS Node React Mongo Boilerplate

This is a full-stack boilerplate project using TypeScript, Node.js, React, and MongoDB. It includes a client-side application, a server-side rendered application, and an API, all configured to work together in a monorepo structure.

Features

  • Full-stack TypeScript: A consistent language across the entire stack (frontend, backend, and shared code).
  • Monorepo Architecture: Manages multiple projects (api, client, ssr, lib) in a single repository.
  • Three-Tier Application Structure:
    • client: A modern React single-page application (built with Vite) for a rich, dynamic user experience and the admin panel.
    • api: A robust Node.js backend (with Express) serving the business logic and data.
    • ssr: A Next.js application for server-side rendering, ideal for SEO-friendly public pages.
  • Authentication Flow:
    • Secure JWT (JSON Web Token) based authentication.
    • Uses accessToken for API requests and a secure refreshToken (stored in an HTTP-only cookie) to refresh sessions.
    • Includes sign-in, sign-up, and logout functionalities.
  • Admin Panel:
    • A feature-rich admin interface built with Ant Design.
    • Provides a layout with a collapsible side menu for navigation.
    • Ready for managing users and viewing statistics.
  • Database:
    • Integrated with MongoDB for a flexible, scalable NoSQL database solution.
  • State Management:
    • Uses Redux Toolkit on the client-side for efficient and predictable state management.
  • Code Quality & Development Experience:
    • Pre-configured with Prettier for consistent code formatting.
    • nodemon for automatic server restarts during development.
    • Vite for a fast and modern frontend development experience.
  • Shared Code:
    • A dedicated lib directory allows sharing of TypeScript interfaces, types, and utility functions across the api, client, and ssr applications, ensuring consistency and reducing code duplication.
  • Production Ready:
    • pm2 configuration (ecosystem.config.json) for process management in production.
    • An example nginx.conf for setting up a reverse proxy.
    • A vps-setup.sh script to streamline server provisioning and deployment.

Structure

  • api: The Node.js backend API.
  • client: The React client-side application (Admin Panel).
  • ssr: The Next.js server-side rendered application.
  • lib: Shared libraries, interfaces, and utilities.

Installation

To create a new project using this boilerplate, run the following command:

npx i -g ts-node-react-mongo-boilerplate
npx ts-node-react-mongo-boilerplate your-project-name

Development

To run the applications in development mode, navigate to the respective directories (first in project root, api, client, ssr) and run:

npm i
npm run dev

Production

The vps-setup.sh script provides instructions for setting up a VPS for production. It includes steps for installing dependencies, configuring Nginx, and setting up SSL with Certbot. The ecosystem.config.json file is used by PM2 to manage the applications in a production environment.