sequelize-pack
v1.0.4
Published
A starter package to scaffold Sequelize projects with migrations, models, and utilities
Downloads
26
Maintainers
Readme
Sequelize Pack
Sequelize Pack is a starter package to quickly scaffold Sequelize projects with migrations, models, utilities, and a ready-to-use project structure.
Features
- Generates project folders for models, migrations, seeders, and utilities.
- Includes starter utility files for database setup and migration checking.
- Pre-configured for MySQL with Sequelize.
- CLI command to initialize your project quickly.
Prerequisites
- Node.js (>=14)
- MySQL
- npm installed
Dependencies that will be installed automatically in your project:
sequelizesequelize-climysql2dotenvumzugfs-extra
Installation
Install the package globally or locally:
npm install sequelize-packThen initialize your project:
npx sequelize-pack-initProject Structure
After running the CLI, your project will have this structure:
database/
├── config/
│ └── config.js
├── migrations/
│ ├── alter/
│ └── create/
├── model/
├── seeders/
├── sql/
│ ├── store_procedure/
│ └── triggers/
│ ├── after_insert/
│ ├── after_update/
│ ├── after_delete/
│ ├── before_insert/
│ ├── before_update/
│ └── before_delete/
└── utility/
├── checkmigrations.js
├── db.setup.js
└── generateModels.jsScripts
package.json will include scripts like:
npm run db:setup— Create database, run migrations, and seeders.npm run db:status— Check migration status.npm run db:migrate— Run migrations.npm run db:seed— Run seeders.npm run db:reset— Reset the database (drop, create, migrate, seed).
Environment Configuration
Create a .env file in your project root with:
_HOST_ADMIN=localhost
_DATABASE_ADMIN=your_database_name
_USER_ADMIN=your_mysql_user
_PASSWORD_ADMIN=your_mysql_passwordThese values are used automatically by sequelize-pack-init to set up your database.
License
MIT License
Author
Wendell Blanco
