create-liver
v1.5.1
Published
School-level full-stack scaffolding CLI generator
Downloads
299
Maintainers
Readme
StackForge
School-level full-stack scaffolding CLI generator. Generates complete React + Express + MySQL management systems from terminal prompts.
Install and Run
Option 1: Run directly with npx (after publishing)
npx stackforgeOption 2: Run locally during development
cd stackforge
npm install
node index.jsWhat It Generates
Running the CLI creates two folders:
your-project-backend/
your-project-frontend/Backend includes:
- Express.js server with CORS and sessions
- MySQL database connection pool
- CRUD controller and routes for your main entity
- Authentication (login, register, logout, session middleware)
- Optional: reports, invoice, payments controllers and routes
.envfile template
Frontend includes:
- Vite + React 18 project
- Tailwind CSS
- React Router DOM v6
- Axios service layer
- Dashboard with sidebar, navbar, stats cards
- Full CRUD list page with table and delete confirmation
- Form page with insert and update support
- Relationship dropdowns auto-populated via Axios
- Login and Register pages
- Protected routes via AuthContext
- Optional: Reports, Invoices, Payments pages
Database includes:
- MySQL schema file (
schema.sql) - Users table (if auth enabled)
- Referenced tables stubs (for relationship fields)
- Main entity table with foreign keys
- Optional: invoices, payments tables
- ERD explanation as comments
CLI Questions
Project name?
Database name?
Include authentication?
Main entity name? (e.g. student)
Main entity plural name? (e.g. students)
How many fields?
For each field:
Field name?
Field type? [VARCHAR, INT, DECIMAL, DATE, TEXT, BOOLEAN]
Required?
Is this a relationship field?
If yes:
Referenced table?
Display field from referenced table?
Include reports module?
Include invoice module?
Include payments module?After Generation
1. Set up the database
Open MySQL and run:
source path/to/your-project-backend/database/schema.sql2. Configure the backend
Edit your-project-backend/.env:
DB_HOST=localhost
DB_USER=root
DB_PASSWORD=your_mysql_password
DB_NAME=your_database_name
SESSION_SECRET=change_this_to_something_secure
PORT=50003. Start the backend
cd your-project-backend
npm install
npm run devBackend runs at: http://localhost:5000
4. Start the frontend
cd your-project-frontend
npm install
npm run devFrontend runs at: http://localhost:5173
Supported Field Types
| Type | MySQL Type | HTML Input | |----------|-----------------|-------------| | VARCHAR | VARCHAR(255) | text | | INT | INT | number | | DECIMAL | DECIMAL(10,2) | number | | DATE | DATE | date | | TEXT | TEXT | textarea | | BOOLEAN | TINYINT(1) | checkbox |
Relationships
StackForge supports simple one-to-many relationships.
Example:
Field name: package_id
Referenced table: packages
Display field: package_nameThis generates:
package_id INTstored in databasepackage_namedisplayed in frontend dropdown- LEFT JOIN in GET queries
- Axios dropdown fetch in form page
Publishing to npm
1. Create an npm account
Go to https://www.npmjs.com and create a free account.
2. Login in terminal
npm login3. Make index.js executable
The #!/usr/bin/env node line is already at the top of index.js.
On Mac/Linux, also run:
chmod +x index.js4. Update package.json
Edit package.json and set a unique name:
{
"name": "your-unique-package-name",
"version": "1.0.0",
...
}Check if the name is available:
npm search your-unique-package-name5. Publish
npm publish6. Test your published package
npx your-unique-package-name7. Update version and republish
npm version patch # 1.0.0 -> 1.0.1
npm publishProject Structure
stackforge/
index.js Main CLI entry
package.json
README.md
generator/
promptEngine.js All CLI questions
schemaGenerator.js MySQL schema generator
backendGenerator.js Express backend generator
frontendGenerator.js React frontend generator
utils/
helpers.js Utility functionsVersion 1 Limitations
Version 1 is intentionally simple and school-level:
- One main CRUD entity per project
- Simple one-to-many relationships only
- No many-to-many relationships
- No nested relationships
- No chained joins
- No automatic AI form generation
- No analytics engine
- No plugin system
Tech Stack (Generated Projects)
Frontend: React 18, Vite, Tailwind CSS, React Router DOM v6, Axios
Backend: Node.js, Express.js, MySQL2, Express-Session, Bcryptjs, dotenv
License
MIT
