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 🙏

© 2026 – Pkg Stats / Ryan Hefner

create-numz-app

v1.0.4

Published

Generate a full Express + React CRUD project from SQL CREATE TABLE statements.

Readme

project-gen-ai

Generate a full Express backend + React frontend CRUD project from a database name and SQL CREATE TABLE statements. One command → working app.

What it generates

For every table in your SQL:

| Input | Output | |---|---| | Table with plain columns | React page with typed inputs (text / number / date) | | Column with FOREIGN KEY | React <select> dropdown fetching from the referenced table | | All tables | Express route file with GET / GET:id / POST / PUT / DELETE | | DB name | db.js MySQL pool + .env template |


Install

# From npm (once published)
npm install -g project-gen-ai

# Or run locally from this folder
npm install
npm link          # makes `project-gen` available globally

Usage

npm create numz-app

The CLI will ask you:

| Question | Example answer | |---|---| | Project name | sims | | MySQL database name | simsdb | | Output directory | (leave blank = current folder) | | Paste your SQL | (paste all CREATE TABLE blocks, press Enter) |

Example SQL input

CREATE TABLE Users (
  UserID   INT PRIMARY KEY AUTO_INCREMENT,
  Username VARCHAR(100) NOT NULL,
  Password VARCHAR(255) NOT NULL,
  Role     VARCHAR(50)  DEFAULT 'staff'
);

CREATE TABLE SpareParts (
  PartID     INT PRIMARY KEY AUTO_INCREMENT,
  Name       VARCHAR(100) NOT NULL,
  Category   VARCHAR(50),
  Quantity   INT          DEFAULT 0,
  UnitPrice  DECIMAL(10,2),
  TotalPrice DECIMAL(10,2)
);

CREATE TABLE StockIn (
  StockInID       INT PRIMARY KEY AUTO_INCREMENT,
  PartID          INT NOT NULL,
  StockInQuantity INT NOT NULL,
  StockInDate     DATE NOT NULL,
  FOREIGN KEY (PartID) REFERENCES SpareParts(PartID)
);

CREATE TABLE StockOut (
  StockOutID         INT PRIMARY KEY AUTO_INCREMENT,
  PartID             INT NOT NULL,
  UserID             INT NOT NULL,
  StockOutQuantity   INT,
  StockOutUnitPrice  DECIMAL(10,2),
  StockOutTotalPrice DECIMAL(10,2),
  StockOutDate       DATE,
  FOREIGN KEY (PartID) REFERENCES SpareParts(PartID),
  FOREIGN KEY (UserID) REFERENCES Users(UserID)
);

Generated project structure

sims/
├── backend/
│   ├── package.json
│   ├── server.js          ← Express app, registers all routers
│   ├── db.js              ← mysql2 connection pool
│   ├── .env               ← DB credentials template
│   └── routes/
│       ├── users.js
│       ├── spareparts.js
│       ├── stockin.js
│       └── stockout.js
└── frontend/
    ├── package.json
    ├── vite.config.js     ← proxies /api → localhost:5000
    ├── index.html
    └── src/
        ├── main.jsx
        ├── index.css
        ├── App.jsx        ← react-router-dom routes
        ├── Navbar.jsx
        └── pages/
            ├── Login.jsx
            ├── Users.jsx
            ├── SpareParts.jsx
            ├── StockIn.jsx   ← PartID = dropdown ✓
            └── StockOut.jsx  ← PartID + UserID = dropdowns ✓

After generation — next steps

# 1. Create the MySQL database and run your SQL schema
mysql -u root -p -e "CREATE DATABASE simsdb;"
mysql -u root -p simsdb < schema.sql

# 2. Start the backend
cd sims/backend
npm install
# Edit .env with your DB credentials
npm run dev       # nodemon server.js on port 5000

# 3. Start the frontend
cd sims/frontend
npm install
npm run dev       # Vite on http://localhost:5173

How FK detection works

The parser reads FOREIGN KEY (col) REFERENCES table(col) constraints.
When generating a React page, any column that is a FK becomes a <select> dropdown:

<select name="PartID" value={form.PartID} onChange={handleChange} className="border p-2 rounded">
  <option value="">Select SpareParts</option>
  {sparePartsList.map((r) => (
    <option key={r.PartID} value={r.PartID}>{r.Name}</option>
  ))}
</select>

The display label for each option is chosen automatically — it looks for a column named Name, name, Title, Username, etc. on the referenced table.


SQL type → input type mapping

| SQL type | HTML input type | |---|---| | INT, BIGINT, SMALLINT | number | | DECIMAL, FLOAT, DOUBLE | number | | DATE | date | | DATETIME, TIMESTAMP | datetime-local | | VARCHAR, CHAR, ENUM | text | | TEXT, LONGTEXT | text |


Tech stack of generated project

Backend: Node.js · Express · mysql2 · dotenv · cors
Frontend: React 18 · Vite · Tailwind CSS · Axios · React Router v6