create-kyan-app
v1.0.0
Published
Pattern-based React + Express + MySQL scaffold.
Maintainers
Readme
create-kyan-app
Generate a React client, Express API, and MySQL schema from data patterns, not fixed exam copies.
How it thinks
You describe (or blueprint) your entities and relationships. Ocean detects:
| Pattern | Detected when | Reports | CRUD default | |--------|----------------|---------|----------------| | Service / sales | Hub table with 2+ foreign keys + payment linked to hub | Daily joined report + receipt | Insert-only except hub | | Payroll | Department ← Employee ← Salary | Monthly payroll | Insert-only except salary table | | Generic | Anything else | Per-table / date filters | Full CRUD on all tables |
The old national-exam PDFs were only examples of these shapes — they are not baked in as four templates.
Usage
npx create-kyan-app1. Choose a model pattern
- Define all entities yourself — full control; detection runs after you enter tables.
- Service / sales blueprint — generic Party, Offering, Transaction, Payment (renameable).
- Payroll blueprint — Department, Employee, Salary (renameable).
- Simple CRUD — no insert-only restriction.
2. Confirm inferred roles + CRUD policy
For manual models, Ocean now:
- suggests a likely role for each table:
mastertransactionsettlementlookupauth
- preselects likely column input types from names like:
email->emailphoneNumber->phoneamountPaid->moneypaymentDate->date
After entities are defined, Ocean shows what it detected (e.g. hub = Transaction) and asks whether only the hub gets update/delete.
3. Choose auth mode
Ocean now supports:
- Default auth table:
users(username, password) - Custom user table: choose your own:
- table name
- primary key
- login field
- password field
- display field
- optional role field
- optional extra user profile fields
When you enable the custom user table, the generator keeps it aligned across:
database.sql- backend auth controller
- login/register/recover endpoints
- React login/register/recover forms
- signed-in user display in the frontend
4. Generated stack
backend-project— Express, MySQL, session/JWT, bcrypt, password recoveryfrontend-project— Vite, React, Tailwind, Axiosdatabase.sql— schema + views (no exam-specific seed rows)project-cleanup.js— drop database when finished
Start
cd backend-project && npm run dev
cd frontend-project && npm run devImport database.sql, configure backend-project/.env, hash the admin user (see SQL comments).
Pattern examples (any domain)
Service / sales — appointments, car wash, parking stay, shop order:
- Lookup tables (customer, product, slot…)
- One transaction row linking lookups
- Payment referencing the transaction
Payroll — HR, school fees, commissions:
- Org unit → person → pay line
- Monthly report joins the three tables (column names inferred)
Publish
npm publish