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

create-bj-react-template

v1.0.0

Published

Custom React template CLI

Downloads

49

Readme

🚀 Create BJ React Template CLI

A custom CLI tool to rapidly scaffold modern React projects pre-configured with Redux Toolkit, Material UI (MUI), scalable API service integrations, class-based service methods, centralized React Context + custom hook setup, and a hot-swappable ThemeProvider for dynamic theming.

Skip the repetitive boilerplate and start building scalable, maintainable apps with the best tooling in place from the start.


📦 Features

  • ⚛️ React (latest) project scaffolding
  • 📦 Redux Toolkit (v2.8.2) for state management
  • 🎨 Material UI (MUI) (v7.1.0) for modern, responsive UI components
  • 📡 Scalable API integration setup via API services
  • 🏛️ Class-structured methods for API clients (clean, reusable, centralized)
  • 📊 Centralized React Context implementation with a custom useContext hook
  • 🎨 Dynamic hot theme implementation using a custom ThemeProvider
  • ⚡ Rapid project scaffolding with a clean, organized folder structure
  • 📁 Ready-to-extend Redux slices, components, API services, and contexts

🛠️ Installation

Install the CLI Globally

npm install -g create-bj-react-template

🚀 Usage

1️⃣ Create a New Project

create-bj-react-template <project-name>

2️⃣ Navigate to the Project

cd my-app

3️⃣ Install Dependencies

npm install

4️⃣ Start the Development Server

npm start

📂 Generated Project Structure

my-app/ ├── src/ │ ├── api/ # Scalable API services with class-structured methods │ ├── components/ # MUI-based reusable components │ ├── context/ # Centralized React Context + custom hook │ ├── features/ # Redux Toolkit slices/features │ ├── store/ # Redux store setup │ ├── theme/ # ThemeProvider and hot theme management │ ├── App.js # Main app entry with MUI ThemeProvider │ └── index.js # App bootstrap ├── package.json # Pre-configured with dependencies └── ... # Standard React files

📡 API Service Architecture

Centralized apiService using Axios with interceptors

Clean, scalable class-structured service methods per API domain (e.g. AuthService, UserService)

Simplified and consistent API request handling

example

import apiService from "./apiService";

class UserService {
  getAllUsers() {
    return apiService.get("/users");
  }

  getUserById(id) {
    return apiService.get(`/users/${id}`);
  }

  createUser(data) {
    return apiService.post("/users", data);
  }
}

export const userService = new UserService();

🏛️ Centralized Context + Custom Hook

Built-in context and hook pattern for scalable state management beyond Redux.

Example:

import { createContext, useContext, useState } from "react";

const AppContext = createContext();

export const useAppContext = () => {
  const context = useContext(AppContext);
  if (!context) throw new Error("useAppContext must be used within a AppProvider");
  return context;
};

export const AppProvider = ({ children }) => {
  const [themeMode, setThemeMode] = useState("light");
  return (
    <AppContext.Provider value={{ themeMode, setThemeMode }}>
      {children}
    </AppContext.Provider>
  );
};

🎨 Hot Theme Implementation

Global ThemeProvider wrapping the app via MUI theming

Dynamic light/dark mode toggle

Integrated with centralized context for seamless theme updates

Example:

import { ThemeProvider, createTheme } from "@mui/material/styles";
import { useAppContext } from "./context/AppContext";

const App = () => {
  const { themeMode } = useAppContext();

  const theme = createTheme({
    palette: { mode: themeMode },
  });

  return (
    <ThemeProvider theme={theme}>
      <MainRoutes />
    </ThemeProvider>
  );
};

📦 Included Dependencies

| Package | Version | Purpose | | :----------------- | :------ | :----------------------- | | @mui/material | ^7.1.0 | Material UI components | | @reduxjs/toolkit | ^2.8.2 | Redux state management | | react-redux | ^9.2.0 | React bindings for Redux | | axios | latest | API integration layer |

📜 License

MIT © Blessed Raj P