express-sweet-generator
v5.0.0
Published
One command, zero boilerplate. Instantly scaffold a full-stack Express Sweet app — authentication, ORM, routing, views, and a Webpack-powered frontend — all wired up and ready to ship.
Maintainers
Readme
One command, zero boilerplate. Instantly scaffold a full-stack Express Sweet app — authentication, database, file uploads, file-based routing, and Handlebars views — all wired up and ready to run.
What Does It Generate?
A complete Express Sweet application with:
- Passport.js authentication — Login, session management, and route protection
- SQLite + Sequelize — Zero-config database with setup script included
- File-based routing — Drop a file in
routes/, it becomes an endpoint - Handlebars views — Layouts, error pages, and 37 built-in helpers
- Multer file uploads — Avatar upload with configurable storage
- Tailwind CSS — Clean, modern UI out of the box
- ESM or CJS — Choose your module format with a single flag
No build tools, no boilerplate, no decision fatigue. Just a working app.
Tech Stack
| Layer | Technology | |-------|------------| | Framework | Express Sweet v5 on Express.js | | Auth | Passport.js (local strategy + session) | | Database | SQLite via Sequelize (swap to MySQL/PostgreSQL anytime) | | Views | Handlebars with 37 built-in helpers | | File Upload | Multer | | Styling | Tailwind CSS (CDN) |
Screenshots
| Sign In | Home | People |
|---------|------|--------|
|
|
|
|
| New Person | Edit Profile | Change Your Look |
|------------|-------------|-----------------|
|
|
|
|
Installation
npm install -g express-sweet-generatorQuick Start
# Generate a new app (CJS by default)
express-sweet myapp
# Or generate an ESM app
express-sweet -o esm myapp
# Set up and run
cd myapp
npm install
npm run setup
npm startOpen http://localhost:3000 and sign in with [email protected] / password123.
Command Options
express-sweet [options] [dir]
Options:
-o, --output <output> Module format: esm or cjs (default: cjs)
-f, --force Force creation in a non-empty directory
-V, --version Display version number
-h, --help Display help for commandWhat's Inside
| Screen | URL | Feature |
|--------|-----|---------|
| Sign In | /login | Passport.js authentication |
| Home | / | Session data, Handlebars helpers |
| People | /users | Sequelize model, findAll |
| New Person | /users/new | Form POST, create |
| Edit Profile | /users/:id/edit | Form PUT, update |
| Remove | /users/:id (DELETE) | Self-delete protection |
| Change Your Look | /profile/avatar | Multer file upload |
| Sign Out | /logout | Session destroy |
Generated Application Structure
myapp/
├── .env # Environment variables (PORT, NODE_ENV)
├── app.js # Application entry point
├── setup.js # Database setup script
├── ddl.sql # Database schema + seed data
├── package.json
├── config/
│ ├── config.js # App settings, routing, error pages
│ ├── database.js # SQLite connection
│ ├── authentication.js # Passport.js config
│ ├── view.js # Handlebars settings
│ ├── logging.js # Morgan format
│ └── upload.js # Multer config
├── public/
│ └── img/ # Avatar images
├── models/
│ └── UserModel.js # Sequelize model
├── routes/
│ ├── home.js # Dashboard (default route)
│ ├── login.js # Auth login
│ ├── logout.js # Session destroy
│ ├── users.js # CRUD (list, create, edit, delete)
│ └── profile/
│ └── avatar.js # File upload
└── views/
├── layout/
│ └── default.hbs # Shared layout with nav
├── home.hbs
├── login.hbs
├── users.hbs
├── users-new.hbs
├── users-edit.hbs
├── avatar.hbs
└── errors/
├── 404.hbs
└── 500.hbsFile-based Routing
Files in routes/ are automatically mapped to URL endpoints — no manual registration needed:
| File | URL |
|------|-----|
| routes/home.js | /home (also / via default_router) |
| routes/login.js | /login |
| routes/logout.js | /logout |
| routes/users.js | /users, /users/new, /users/:id/edit, /users/:id |
| routes/profile/avatar.js | /profile/avatar |
Express Sweet Documentation
The generated app is built on the Express Sweet framework. For configuration, models, authentication, routing, views, file uploads, and more — see the Express Sweet README.
Changelog
See CHANGELOG.md for the full release history.
Author
shumatsumonobu
