express-genix 3.0.0 → 3.0.1

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.
Files changed (2) hide show
  1. package/README.md +48 -10
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -3,6 +3,7 @@
3
3
  A production-grade CLI tool that generates Express.js applications with best-in-class defaults. Scaffold a complete REST API in seconds — with TypeScript, authentication, Prisma/Mongoose/Sequelize, Docker, CI/CD, and more.
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/express-genix.svg)](https://www.npmjs.com/package/express-genix)
6
+ [![npm downloads](https://img.shields.io/npm/dm/express-genix.svg)](https://www.npmjs.com/package/express-genix)
6
7
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
8
  [![Node.js](https://img.shields.io/badge/node-%3E%3D18-brightgreen.svg)](https://nodejs.org)
8
9
 
@@ -115,19 +116,22 @@ express-genix add prisma # Adds Prisma schema, client config, migrations
115
116
  ```
116
117
  my-express-app/
117
118
  ├── src/
118
- │ ├── config/ # Database, Swagger, WebSocket configuration
119
- │ ├── controllers/ # Route handlers
120
- │ ├── middleware/ # Auth, validation, error handling, request ID
121
- │ ├── models/ # Database models (Mongoose/Sequelize)
119
+ │ ├── config/ # Database, Swagger, WebSocket, queue configuration
120
+ │ ├── controllers/ # Route handlers (auth, user, admin, example)
121
+ │ ├── graphql/ # GraphQL type definitions & resolvers (if selected)
122
+ │ ├── jobs/ # BullMQ background workers (if selected)
123
+ │ ├── middleware/ # Auth, RBAC, validation, error handling, uploads, metrics, audit log
124
+ │ ├── models/ # Database models (Mongoose/Sequelize/Prisma)
122
125
  │ ├── routes/ # API route definitions with Swagger annotations
123
- │ ├── services/ # Business logic layer
126
+ │ ├── services/ # Business logic layer (auth, user, email)
124
127
  │ ├── utils/ # Logger, errors, response helpers, validators
125
128
  │ ├── app.js|ts # Express app setup
126
- │ └── server.js|ts # Server + clustering + WebSocket
129
+ │ └── server.js|ts # Server + clustering + WebSocket + workers
127
130
  ├── tests/ # Jest + Supertest suites
128
131
  ├── prisma/ # Prisma schema (if selected)
129
132
  ├── migrations/ # Sequelize migrations (if PostgreSQL + Sequelize)
130
133
  ├── seeders/ # Sequelize seeders (if PostgreSQL + Sequelize)
134
+ ├── uploads/ # File upload directory (if selected)
131
135
  ├── .github/workflows/ # CI/CD pipeline (if selected)
132
136
  ├── .env # Auto-generated environment config
133
137
  ├── .env.example # Template for team sharing
@@ -138,6 +142,8 @@ my-express-app/
138
142
 
139
143
  ## API Endpoints (with database + auth)
140
144
 
145
+ > When API versioning is enabled, all `/api/*` routes become `/api/v1/*`.
146
+
141
147
  ### Authentication
142
148
  | Method | Endpoint | Description |
143
149
  |--------|----------|-------------|
@@ -153,12 +159,35 @@ my-express-app/
153
159
  |--------|----------|-------------|
154
160
  | GET | `/api/users/profile` | Get current user |
155
161
  | PUT | `/api/users/profile` | Update profile |
156
- | DELETE | `/api/users/profile` | Delete account |
162
+ | DELETE | `/api/users/profile` | Delete account (soft delete if enabled) |
163
+
164
+ ### Admin (RBAC — admin role required)
165
+ | Method | Endpoint | Description |
166
+ |--------|----------|-------------|
167
+ | GET | `/api/admin/users` | List all users (paginated) |
168
+ | GET | `/api/admin/users/:id` | Get user by ID |
169
+ | PUT | `/api/admin/users/:id/role` | Update user role |
170
+ | DELETE | `/api/admin/users/:id` | Delete user |
171
+ | POST | `/api/admin/users/:id/restore` | Restore soft-deleted user |
157
172
 
158
- ### Health
173
+ ### File Uploads
159
174
  | Method | Endpoint | Description |
160
175
  |--------|----------|-------------|
161
- | GET | `/health` | Health check with uptime, DB status, Redis status, memory usage |
176
+ | POST | `/api/uploads/single` | Upload a single file |
177
+ | POST | `/api/uploads/multiple` | Upload multiple files (max 10) |
178
+
179
+ ### Background Jobs (BullMQ)
180
+ | Method | Endpoint | Description |
181
+ |--------|----------|-------------|
182
+ | POST | `/api/jobs` | Dispatch a background job |
183
+ | GET | `/api/jobs/:id` | Get job status |
184
+
185
+ ### Observability & Health
186
+ | Method | Endpoint | Description |
187
+ |--------|----------|-------------|
188
+ | GET | `/health` | Health check (uptime, DB, Redis, memory) |
189
+ | GET | `/metrics` | Prometheus metrics (prom-client) |
190
+ | GET | `/graphql` | GraphQL Playground (Apollo Server) |
162
191
 
163
192
  ## Available Scripts
164
193
 
@@ -197,10 +226,17 @@ Generated `.env` includes auto-generated JWT secrets:
197
226
  | `JWT_SECRET` | Access token secret (auto-generated) | — |
198
227
  | `JWT_REFRESH_SECRET` | Refresh token secret (auto-generated) | — |
199
228
  | `MONGO_URI` / `DATABASE_URL` | Database connection string | — |
200
- | `REDIS_URL` | Redis URL (when Redis blacklist enabled) | `redis://localhost:6379` |
229
+ | `REDIS_URL` | Redis URL (token blacklist, caching, BullMQ) | `redis://localhost:6379` |
201
230
  | `RATE_LIMIT_WINDOW_MS` | Rate limit window (ms) | `900000` |
202
231
  | `RATE_LIMIT_MAX` | Max requests per window | `100` |
203
232
  | `LOG_LEVEL` | Logging level | `info` |
233
+ | `SMTP_HOST` | SMTP server host (email service) | — |
234
+ | `SMTP_PORT` | SMTP server port | `587` |
235
+ | `SMTP_USER` | SMTP username | — |
236
+ | `SMTP_PASS` | SMTP password | — |
237
+ | `EMAIL_FROM` | Default sender address | — |
238
+ | `UPLOAD_MAX_SIZE` | Max file upload size in bytes | `5242880` (5 MB) |
239
+ | `UPLOAD_DIR` | Upload destination directory | `uploads` |
204
240
 
205
241
  ## Docker
206
242
 
@@ -208,6 +244,8 @@ Generated `.env` includes auto-generated JWT secrets:
208
244
  docker-compose up --build
209
245
  ```
210
246
 
247
+ The generated `docker-compose.yml` includes services for your app and its dependencies (MongoDB/PostgreSQL, Redis) with health checks, volumes, and a shared network. The `Dockerfile` uses multi-stage builds, runs as a non-root user, and only copies production dependencies.
248
+
211
249
  ## Contributing
212
250
 
213
251
  Contributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md) for details.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "express-genix",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "description": "Production-grade CLI to generate Express apps with JWT, RBAC, GraphQL, TypeScript, Prisma, MongoDB, PostgreSQL, file uploads, email, background jobs, and more",
5
5
  "main": "index.js",
6
6
  "bin": {