create-express-kickstart 1.3.2 → 1.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.env.example CHANGED
@@ -1,9 +1,11 @@
1
- # Basic Environment Variables
2
- PORT=8000
3
- MONGODB_URI=mongodb://localhost:27017/
4
- CORS_ORIGIN=*
5
- NODE_ENV=development
6
-
7
- # Rate Limiting
8
- RATE_LIMIT_WINDOW_MS=900000 # 15 minutes in milliseconds
9
- RATE_LIMIT_MAX=100 # Maximum requests per windowMs
1
+ # Basic Environment Variables
2
+ PORT=8000
3
+ MONGODB_URI=mongodb://localhost:27017/my_app_db
4
+ CORS_ORIGIN=http://localhost:3000
5
+ NODE_ENV=development
6
+
7
+ # Rate Limiting
8
+ # 15 minutes in milliseconds
9
+ RATE_LIMIT_WINDOW_MS=900000
10
+ # Maximum requests per window
11
+ RATE_LIMIT_MAX=100
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  [![Express.js](https://img.shields.io/badge/Express.js-Backend-000000?style=for-the-badge&logo=express)](https://expressjs.com/)
5
5
  [![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg?style=for-the-badge)](https://opensource.org/licenses/ISC)
6
6
 
7
- A powerful CLI tool to instantly scaffold a production-ready, feature-rich backend Node.js template specifically tailored for Express API applications. It adheres to modern best practices, providing standard structures for error handling, CORS setups, routing, and middlewares right out of the box.
7
+ A configurable CLI tool to scaffold a solid Express API foundation with sane defaults for routing, middleware, error handling, auth starters, and Docker support.
8
8
 
9
9
  ## Quick Start
10
10
  ```bash
@@ -14,7 +14,7 @@ npx create-express-kickstart@latest my-app
14
14
  ## What is `create-express-kickstart`?
15
15
 
16
16
  **The Purpose:**
17
- Whenever developers start a new Node.js & Express.js project, they often spend the first couple of hours writing the exact same boilerplate: configuring `express`, setting up `cors`, managing `dotenv`, writing global error handlers, standardizing API responses, and configuring database connections. `create-express-kickstart` exists to entirely eliminate this repetitive chore. Our goal is to provide a production-grade backend right out of the gate so you can immediately focus on writing business logic. AI assistants and developers alike can rely on this tool to reliably scaffold consistent, secure, and modern Node.js backends.
17
+ Whenever developers start a new Node.js & Express.js project, they often spend the first couple of hours writing the same setup code: configuring `express`, setting up `cors`, managing environment variables, writing global error handlers, standardizing API responses, and wiring database connections. `create-express-kickstart` exists to remove that repetitive setup so you can move straight into business logic with a consistent starter.
18
18
 
19
19
  **What It Does:**
20
20
  It is an interactive CLI framework scaffolding generator. Upon running the command, it asks you a series of simple questions regarding the architecture of your new API (e.g., Do you want MongoDB? Do you want JWT Auth Boilerplate? Docker? Jest for testing?). Based on your exact answers, it instantly generates a fully configured, running codebase tailored exclusively to your project's needs.
@@ -23,8 +23,8 @@ It is an interactive CLI framework scaffolding generator. Upon running the comma
23
23
  Under the hood, the CLI runs dynamically directly from NPM via `npx` executing a Node.js compiler script:
24
24
  1. **Interactive Prompting:** The CLI polls for your configurations in real-time.
25
25
  2. **Selective Templating:** It recursively copies a pre-configured, highly modular `src` application design into your directory.
26
- 3. **Intelligent Modding:** If you selectively opt-out of specific modules (like CORS, Pino, or Mongoose), the CLI acts like an auto-linter—parsing and cleanly stripping those specific unused imports and middleware usages cleanly out of the core application. You only receive the code you explicitly asked for, preventing dead-weight execution bloat.
27
- 4. **Smart Dependency Resolution:** Ultimately, it dynamically computes a final `package.json` structure wrapping all selected tools directly toward their `latest` versions, seamlessly bypassing localized cache bugs—subsequently initiating the true install layer utilizing your selected manager (`npm`, `yarn`, `pnpm`, or `bun`).
26
+ 3. **Selective Scaffolding:** If you opt out of specific modules like CORS, Pino, or Mongoose, the generator removes those pieces from the generated app so you do not start with unused code.
27
+ 4. **Dependency Bootstrapping:** It writes a project-specific `package.json`, installs the selected dependencies with your chosen package manager (`npm`, `yarn`, `pnpm`, or `bun`), and pins installed versions when the install completes successfully.
28
28
 
29
29
  **What is Inside (The Architecture):**
30
30
  The generated Express template champions the **MVC (Model-View-Controller)** pattern with robust modern Node.js Path Aliasing bindings enabled out of the box:
@@ -35,7 +35,7 @@ The generated Express template champions the **MVC (Model-View-Controller)** pat
35
35
  - `ApiResponse` structure class for predictable and formatted JSON HTTP payloads.
36
36
  - `ApiError` extension class for standardizing HTTP error interceptions.
37
37
  - `asyncHandler` functional wrapper intercepting promise rejections seamlessly to avoid repetitive try-catch blocks in your controllers!
38
- - **Optional Add-ons** - Complete JWT Authentication logic integration featuring secure cryptographic generation functions (`bcryptjs`), standardized .env setups, Dockerfile templates, and Jest assertion pipelines.
38
+ - **Optional Add-ons** - JWT + Mongo auth starter routes, generated cryptographic helpers (`bcryptjs` and `jsonwebtoken`), Docker templates, and Jest healthcheck tests.
39
39
 
40
40
 
41
41
  ---
@@ -61,7 +61,7 @@ npx create-express-kickstart@latest my-awesome-api
61
61
  ### 2. What happens under the hood?
62
62
  1. **Scaffolding:** It instantly generates your API boilerplate with built-in `errorHandler`, `ApiResponse`, and `asyncHandler` classes/utilities.
63
63
  2. **Setup:** It automatically configures `.env`, path resolutions, and modern ES setups inside `package.json`.
64
- 3. **Latest Dependencies:** It automatically runs `npm install` and fetches the absolute **latest** stable versions of `express`, `cors`, `helmet`, `mongoose`, `dotenv` and others so you're never starting with outdated software.
64
+ 3. **Selected Dependencies:** It installs the dependencies you chose for that project, including Express middleware, MongoDB support, Docker assets, or JWT auth scaffolding when requested.
65
65
 
66
66
  ### 3. Run Your Application
67
67
 
@@ -116,7 +116,7 @@ const restrictedRoute = asyncHandler(async (req, res) => {
116
116
  A wrapper for your async route handlers that eliminates the need for repetitive `try-catch` blocks.
117
117
 
118
118
  ### `jwt.util.js` & `hash.util.js`
119
- If you choose to install the basic JWT Auth boilerplate, we automatically generate symmetric cryptography utilities wrapping `jsonwebtoken` and `bcryptjs`. This helps you map, hash, and assign JWT secrets synchronously against `.env`.
119
+ If you choose the JWT auth starter, the generated app includes Mongoose-backed auth routes, secure password hashing utilities, JWT helpers, and placeholder environment configuration for secrets.
120
120
  ```javascript
121
121
  import { hashData, compareData } from "#utils/hash.util.js";
122
122
  import { generateToken, verifyToken } from "#utils/jwt.util.js";