{"_id":"@aditya3012singh/create-base-backend","_rev":"8-c04fd608286949ac658d21a28233381a","name":"@aditya3012singh/create-base-backend","dist-tags":{"latest":"1.1.7"},"versions":{"1.0.0":{"name":"@aditya3012singh/create-base-backend","version":"1.0.0","keywords":["express","typescript","prisma","boilerplate","starter","cli"],"author":"","license":"MIT","_id":"@aditya3012singh/create-base-backend@1.0.0","maintainers":[{"name":"aditya3012singh","email":"aditya3012singh@gmail.com"}],"bin":{"create-base-backend":"index.js"},"dist":{"shasum":"3d8e1a7935003f69122baf72802887fc8210e0de","tarball":"https://registry.npmjs.org/@aditya3012singh/create-base-backend/-/create-base-backend-1.0.0.tgz","fileCount":3,"integrity":"sha512-xZ8Ye0pHLK5Z3zTVuKFNLcErVuSFRUukfm/oGZOTCuIlfCROQ9Ly0xOxcDIsCE7bkv9C1J6jOreNn8NsCZ1d2w==","signatures":[{"sig":"MEQCIHobBZbamuegohMDOJo7fyNeO0vesjgQGGJQUTSc2D5BAiAQJ+b/aBGaS2mzR1dXpVL36Be9MHQJLmxQkp+nw/fWig==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":5505},"main":"index.js","type":"module","gitHead":"0b406d322589ef3a28be1ac069d8b12419116058","_npmUser":{"name":"aditya3012singh","email":"aditya3012singh@gmail.com"},"_npmVersion":"11.11.0","description":"Interactive CLI initializer for production-ready Node.js Express APIs","directories":{},"_nodeVersion":"20.20.0","dependencies":{"degit":"^2.8.4","prompts":"^2.4.2","kolorist":"^1.8.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/create-base-backend_1.0.0_1785829072164_0.31263713519574554","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@aditya3012singh/create-base-backend","version":"1.0.1","keywords":["express","typescript","prisma","boilerplate","starter","cli"],"author":"","license":"MIT","_id":"@aditya3012singh/create-base-backend@1.0.1","maintainers":[{"name":"aditya3012singh","email":"aditya3012singh@gmail.com"}],"bin":{"create-base-backend":"index.js"},"dist":{"shasum":"70baa8b662c8c4fc9452c97d9af877389fd11f86","tarball":"https://registry.npmjs.org/@aditya3012singh/create-base-backend/-/create-base-backend-1.0.1.tgz","fileCount":3,"integrity":"sha512-a1DR1x68/nI6bEvnNn2ou5A8QG1ZwXYAI5yhWcgGmcP2ujl20TZb6JMn8nCQp/C0+woNGAXo9+xSzUt3xVj9wQ==","signatures":[{"sig":"MEUCIQCSRHz3TWhC5hHxQmbFpt/O8oZ3dgtHKSjwDXom12AMSQIgBeELx13BOfZwMH7sEMY/N+sgTPeeBk8q/FFtp8Kpp0A=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":5881},"main":"index.js","type":"module","gitHead":"0b406d322589ef3a28be1ac069d8b12419116058","_npmUser":{"name":"aditya3012singh","email":"aditya3012singh@gmail.com"},"_npmVersion":"11.11.0","description":"Interactive CLI initializer for production-ready Node.js Express APIs","directories":{},"_nodeVersion":"20.20.0","dependencies":{"degit":"^2.8.4","prompts":"^2.4.2","kolorist":"^1.8.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/create-base-backend_1.0.1_1785837257394_0.06011061778371296","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@aditya3012singh/create-base-backend","version":"1.0.2","keywords":["express","typescript","prisma","boilerplate","starter","cli"],"author":"","license":"MIT","_id":"@aditya3012singh/create-base-backend@1.0.2","maintainers":[{"name":"aditya3012singh","email":"aditya3012singh@gmail.com"}],"bin":{"create-base-backend":"index.js"},"dist":{"shasum":"c3fdc709daf8c37666911adfb5c8e73a35ac19e6","tarball":"https://registry.npmjs.org/@aditya3012singh/create-base-backend/-/create-base-backend-1.0.2.tgz","fileCount":3,"integrity":"sha512-y0KoJWAVqpYnu/IzLmYMMSuFq7qmpvUgLUVw/xSpfJfEm4XRBjUEVnAJP3HvdmQefLpblqEpasNqkSzVANG0iw==","signatures":[{"sig":"MEQCIAtB9/VrY5mV0PxBBY+FdxyLNyFG+yHaROsRGsNVZoRYAiAaRpd8P6MXrYglLe7ZLS/lGtIsZN9g4G7ghjIuFe3zpQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":5879},"main":"index.js","type":"module","gitHead":"0b406d322589ef3a28be1ac069d8b12419116058","_npmUser":{"name":"aditya3012singh","email":"aditya3012singh@gmail.com"},"_npmVersion":"11.11.0","description":"Interactive CLI initializer for production-ready Node.js Express APIs","directories":{},"_nodeVersion":"20.20.0","dependencies":{"degit":"^2.8.4","prompts":"^2.4.2","kolorist":"^1.8.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/create-base-backend_1.0.2_1785837917671_0.038392684839033464","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@aditya3012singh/create-base-backend","version":"1.1.0","keywords":["express","typescript","prisma","boilerplate","starter","cli"],"author":"","license":"MIT","_id":"@aditya3012singh/create-base-backend@1.1.0","maintainers":[{"name":"aditya3012singh","email":"aditya3012singh@gmail.com"}],"bin":{"create-base-backend":"index.js"},"dist":{"shasum":"4eeb51a0f65a8821b8bdc37d83789394d7fe00dd","tarball":"https://registry.npmjs.org/@aditya3012singh/create-base-backend/-/create-base-backend-1.1.0.tgz","fileCount":3,"integrity":"sha512-SKqEWRdvYW+TKRFb6HSo1Z0UWdpY9nc9Bqptud5Hg2NX7aGY5NKQg9piPs1Vt3hiE+MJg+rtOjQG7+ajS981+Q==","signatures":[{"sig":"MEUCIBrJxJ4CQRgaju8QU8kaFND8g4arpN85BYyIYG/NcFt/AiEA3A47i0ybQ5/F603gsywChHNmj3lrXIvUZjrE9u5aNf0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16784},"main":"index.js","type":"module","gitHead":"58e368ec6c3bda27a9dca61b29b0e6e78ac64335","_npmUser":{"name":"aditya3012singh","email":"aditya3012singh@gmail.com"},"_npmVersion":"11.11.0","description":"Interactive CLI initializer for production-ready Node.js Express APIs","directories":{},"_nodeVersion":"20.20.0","dependencies":{"degit":"^2.8.4","prompts":"^2.4.2","kolorist":"^1.8.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/create-base-backend_1.1.0_1785888274752_0.02999582297380532","host":"s3://npm-registry-packages-npm-production"}},"1.1.1":{"name":"@aditya3012singh/create-base-backend","version":"1.1.1","keywords":["express","typescript","prisma","boilerplate","starter","cli"],"author":"","license":"MIT","_id":"@aditya3012singh/create-base-backend@1.1.1","maintainers":[{"name":"aditya3012singh","email":"aditya3012singh@gmail.com"}],"bin":{"create-base-backend":"index.js"},"dist":{"shasum":"7b1b916c2c7d0a99c3449537bd1083f653152a81","tarball":"https://registry.npmjs.org/@aditya3012singh/create-base-backend/-/create-base-backend-1.1.1.tgz","fileCount":3,"integrity":"sha512-Ee4wb1qkYAVAfhzH5yL4J7vPuDmiB5DxQyq+XMhhS+esG1YJTpVYfbqY9rut05g4G2bMoIXzO6KeotkQqSxPMg==","signatures":[{"sig":"MEUCIQDF6GErWiyu+uwUsYU6YhxU/X8nbDcMZFnDNVCsf836LwIgWnTgmRONiesTNNjAVTnVsa6nqXCVVNOvvegNk4OUanQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":17142},"main":"index.js","type":"module","gitHead":"58e368ec6c3bda27a9dca61b29b0e6e78ac64335","_npmUser":{"name":"aditya3012singh","email":"aditya3012singh@gmail.com"},"_npmVersion":"11.11.0","description":"Interactive CLI initializer for production-ready Node.js Express APIs","directories":{},"_nodeVersion":"20.20.0","dependencies":{"degit":"^2.8.4","prompts":"^2.4.2","kolorist":"^1.8.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/create-base-backend_1.1.1_1785892998427_0.7049628039320968","host":"s3://npm-registry-packages-npm-production"}},"1.1.5":{"name":"@aditya3012singh/create-base-backend","version":"1.1.5","keywords":["express","typescript","prisma","boilerplate","starter","cli"],"author":"","license":"MIT","_id":"@aditya3012singh/create-base-backend@1.1.5","maintainers":[{"name":"aditya3012singh","email":"aditya3012singh@gmail.com"}],"bin":{"create-base-backend":"index.js"},"dist":{"shasum":"5b9ca0e46702d21dc24f9b210c30ebf9ac09beae","tarball":"https://registry.npmjs.org/@aditya3012singh/create-base-backend/-/create-base-backend-1.1.5.tgz","fileCount":3,"integrity":"sha512-2AlVOqxslfWGHms0DoAddEV1BTOb474IKclALs2LuymeJ4I9MpgotyTKPGqRneaLG8cs8HzuU/GxdkkQuQwI9A==","signatures":[{"sig":"MEYCIQCtxA8COOcWBDESQ89UPaOgXNLS0c0+JloM3cZFoR7fWAIhAL6z52YXHeQvq/7Hwq9PO2KVfs/0G2+4dlVt0PeQ46pj","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":17712},"main":"index.js","type":"module","gitHead":"e87b7927fcd3062dacd4298f4a84398112778f84","_npmUser":{"name":"aditya3012singh","email":"aditya3012singh@gmail.com"},"_npmVersion":"11.11.0","description":"Interactive CLI initializer for production-ready Node.js Express APIs","directories":{},"_nodeVersion":"20.20.0","dependencies":{"degit":"^2.8.4","prompts":"^2.4.2","kolorist":"^1.8.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/create-base-backend_1.1.5_1785906790194_0.786062032686315","host":"s3://npm-registry-packages-npm-production"}},"1.1.6":{"name":"@aditya3012singh/create-base-backend","version":"1.1.6","keywords":["express","typescript","prisma","boilerplate","starter","cli"],"author":"","license":"MIT","_id":"@aditya3012singh/create-base-backend@1.1.6","maintainers":[{"name":"aditya3012singh","email":"aditya3012singh@gmail.com"}],"bin":{"create-base-backend":"index.js"},"dist":{"shasum":"ee8a432691aba809de75e3e08589e22ce68d641b","tarball":"https://registry.npmjs.org/@aditya3012singh/create-base-backend/-/create-base-backend-1.1.6.tgz","fileCount":3,"integrity":"sha512-9jgfkuAgSXHS0+hviH8cPsiIKEEs2EecDWicr1jLxojOP72WA2SCo0fvrJcSL9WoWLzTg2rssdVymtXZ5FPZRA==","signatures":[{"sig":"MEUCICgx77sL73vDuKaibNfy8uHldwD89BMoP0Oc/kyrnTSZAiEAkupQ7WoF30jiChTtO6sEt7IZIUA744r3M9fG/q5iMNU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":17735},"main":"index.js","type":"module","gitHead":"e87b7927fcd3062dacd4298f4a84398112778f84","_npmUser":{"name":"aditya3012singh","email":"aditya3012singh@gmail.com"},"_npmVersion":"11.11.0","description":"Interactive CLI initializer for production-ready Node.js Express APIs","directories":{},"_nodeVersion":"20.20.0","dependencies":{"degit":"^2.8.4","prompts":"^2.4.2","kolorist":"^1.8.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/create-base-backend_1.1.6_1785909462761_0.717882382036664","host":"s3://npm-registry-packages-npm-production"}},"1.1.7":{"name":"@aditya3012singh/create-base-backend","version":"1.1.7","description":"Interactive CLI initializer for production-ready Node.js Express APIs","type":"module","main":"index.js","bin":{"create-base-backend":"index.js"},"keywords":["express","typescript","prisma","boilerplate","starter","cli"],"author":"","license":"MIT","dependencies":{"prompts":"^2.4.2","kolorist":"^1.8.0","degit":"^2.8.4"},"gitHead":"8e60b6e6c7e6fbb6e55deae83ba06f794ed7b0db","_id":"@aditya3012singh/create-base-backend@1.1.7","_nodeVersion":"20.20.0","_npmVersion":"11.11.0","dist":{"integrity":"sha512-q+4V273flaOmECRuMpO/1QcNRzzzKkbVrgyQY7DqZIF2WpuBWIKRv79o/RZn6ZFwLf8fOBrAuE06R3DBPAQrDA==","shasum":"60eb59493ebdd46ee1be63807088512e2ddde38f","tarball":"https://registry.npmjs.org/@aditya3012singh/create-base-backend/-/create-base-backend-1.1.7.tgz","fileCount":3,"unpackedSize":22363,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHsBTU9teb2O8Jel8EKIw9FYfAizVdTVWT99QL9fiJRlAiEAlSoXe6T3ZT/LdoeP/ivHEM/3kLfWcXQW/DldoHpzf5Q="}]},"_npmUser":{"name":"aditya3012singh","email":"aditya3012singh@gmail.com"},"directories":{},"maintainers":[{"name":"aditya3012singh","email":"aditya3012singh@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/create-base-backend_1.1.7_1786052614910_0.5290653247297668"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-04T07:37:51.990Z","modified":"2026-08-06T21:43:35.216Z","1.0.0":"2026-08-04T07:37:52.301Z","1.0.1":"2026-08-04T09:54:17.530Z","1.0.2":"2026-08-04T10:05:17.792Z","1.1.0":"2026-08-05T00:04:34.885Z","1.1.1":"2026-08-05T01:23:18.567Z","1.1.5":"2026-08-05T05:13:10.327Z","1.1.6":"2026-08-05T05:57:42.892Z","1.1.7":"2026-08-06T21:43:35.067Z"},"license":"MIT","keywords":["express","typescript","prisma","boilerplate","starter","cli"],"description":"Interactive CLI initializer for production-ready Node.js Express APIs","maintainers":[{"name":"aditya3012singh","email":"aditya3012singh@gmail.com"}],"readme":"# create-base-backend\n\nInteractive CLI initializer to instantly scaffold production-ready Node.js Express APIs in either JavaScript or TypeScript, with customizable database and event messaging architectures.\n\n---\n\n## 🚀 Usage\n\nYou do not need to install the package globally. Simply run the initializer inside your target workspace directory:\n\n```bash\nnpx @aditya3012singh/create-base-backend\n```\n\nThe CLI will guide you through interactive choices to customize your template.\n\n---\n\n## 🎨 Interactive Prompt Options & Customizations\n\nDuring scaffolding, the customizer prunes the templates down to only your selected stack, ensuring no unused dependencies or files are left behind:\n\n| Selection | Target File Type | Kept Files | Deleted/Pruned Files |\n| :--- | :--- | :--- | :--- |\n| **PostgreSQL (Prisma)** | `.ts` / `.js` | `prisma/`, `src/core/config/db.*`, `prisma.user.repository.*` | `mongoose.*`, `user.model.*`, `mongoose.user.repository.*`, `seed.*` |\n| **MongoDB (Mongoose)** | `.ts` / `.js` | `src/core/config/db.*` (renamed from `mongoose.*`), `mongoose.user.repository.*`, `seed.*` | `prisma/` folder, `prisma.user.repository.*` |\n| **Redis Pub/Sub** | `.ts` / `.js` | `redisEventBus.*` | `src/core/events/providers/` directory |\n| **RabbitMQ** | `.ts` / `.js` | `providers/rabbitmq.bus.*` | `providers/kafka.bus.*`, `redisEventBus.*` |\n| **Apache Kafka** | `.ts` / `.js` | `providers/kafka.bus.*` | `providers/rabbitmq.bus.*`, `redisEventBus.*` |\n\n---\n\n## 💾 Database Integration: Mongoose vs. Prisma\n\n### A. Working with Mongoose (MongoDB)\nIf you chose MongoDB + Mongoose, use this pattern to add models and seed:\n\n1. **Write Schema & Model** (`src/modules/products/models/product.model.ts`):\n   ```typescript\n   import mongoose, { Schema, Document } from 'mongoose';\n\n   export interface IProduct extends Document {\n       name: string;\n       price: number;\n   }\n\n   const ProductSchema = new Schema({\n       name: { type: String, required: true },\n       price: { type: Number, required: true }\n   }, { timestamps: true });\n\n   export const ProductModel = mongoose.model<IProduct>('Product', ProductSchema);\n   ```\n2. **Seed Data** (`src/core/config/seed.ts`):\n   ```typescript\n   import { ProductModel } from '../../modules/products/models/product.model.js';\n   // Inside seed's main():\n   await ProductModel.create({ name: 'Development Server', price: 99.99 });\n   ```\n   Run seed using: `npm run db:seed`\n\n---\n\n### B. Working with Prisma (PostgreSQL)\nIf you chose PostgreSQL + Prisma, use this pattern:\n\n1. **Add Model to Schema** (`prisma/schema.prisma`):\n   ```prisma\n   model Product {\n     id        String   @id @default(uuid())\n     name      String\n     price     Float\n     createdAt DateTime @default(now())\n   }\n   ```\n2. **Apply Migrations**:\n   ```bash\n   npm run db:migrate\n   ```\n3. **Seed Data** (`prisma/seed.ts`):\n   ```typescript\n   // Inside seed's main():\n   await prisma.product.create({\n       data: { name: 'Development Server', price: 99.99 }\n   });\n   ```\n   Run seed using: `npm run db:seed`\n\n---\n\n## 📡 Event Messaging: Redis vs. RabbitMQ vs. Kafka\n\nThe application uses `dualModeEventBus` to abstract the underlying broker. You publish and subscribe identically regardless of your choice.\n\n### A. Publishing an Event (Universal Call)\nTo emit a message from any service or controller:\n```typescript\nimport dualModeEventBus from '../../core/events/dualModeEventBus.js';\n\nawait dualModeEventBus.publish('ORDER_COMPLETED', {\n    orderId: 'order_1001',\n    amount: 150.00,\n    email: 'buyer@domain.com'\n});\n```\n\n---\n\n### B. Subscribing to an Event (Universal Call)\nRegister your event listener inside `src/core/events/listeners/index.ts` so it loads on server boot:\n```typescript\nimport { IEventBus } from '../eventBus.interface.js';\nimport logger from '../../logger/structuredLogger.js';\n\nexport function registerListeners(eventBus: IEventBus): void {\n    eventBus.subscribe('ORDER_COMPLETED', async (payload: any) => {\n        logger.info(`📥 [Subscriber] Processing order ${payload.orderId}...`);\n        // Add business logic here\n    });\n}\n```\n\n---\n\n### C. Broker Mechanics under the hood:\n\n* **Redis Pub/Sub**: Subscribes to the channel named `ORDER_COMPLETED` using Node Redis client, fanning out received messages dynamically to registered local callbacks in memory.\n* **RabbitMQ**: Asserts a dedicated, unique queue named `q_ORDER_COMPLETED_<AppName>_<HandlerName>` bound to a fanout exchange, ensuring every listener gets its own duplicate copy of the published event (broadcasting pub/sub semantics).\n* **Apache Kafka**: Subscribes the consumer to a global topic. Incoming events are routed using message keys (e.g. `'ORDER_COMPLETED'`) to registered handler arrays in memory from a single consume loop, preventing multiple consumer execution crash states.\n","readmeFilename":"README.md"}