deploy-bbc 1.1.0 → 1.2.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.
- package/.cspell.json +38 -0
- package/CLAUDE.md +85 -11
- package/README.md +358 -0
- package/cli/package.json +9 -9
- package/cli/src/cli/index.ts +8 -3
- package/cli/src/helpers/generate-docker-compose.ts +1 -1
- package/cli/src/helpers/generate-dockerfile.ts +1 -1
- package/cli/src/helpers/log-next-steps.ts +23 -20
- package/cli/src/helpers/scaffold-project.ts +30 -4
- package/cli/src/installers/auth.ts +1 -1
- package/cli/src/templates/base/.env.example +1 -1
- package/cli/src/templates/base/package.json +2 -1
- package/cli/src/templates/base/src/config/index.ts +1 -1
- package/cli/src/templates/base/src/controllers/user/create-user.controller.ts +84 -0
- package/cli/src/templates/base/src/controllers/user/delete-user.controller.ts +60 -0
- package/cli/src/templates/base/src/controllers/user/get-user.controller.ts +74 -0
- package/cli/src/templates/base/src/controllers/user/get-users.controller.ts +41 -0
- package/cli/src/templates/base/src/controllers/user/update-user.controller.ts +111 -0
- package/cli/src/templates/base/src/models/user.model.ts +83 -0
- package/cli/src/templates/base/src/routes/index.ts +5 -0
- package/cli/src/templates/base/src/routes/user.route.ts +17 -0
- package/cli/src/templates/base/src/types/common/api-response.types.ts +30 -0
- package/cli/src/templates/base/src/types/index.ts +5 -2
- package/cli/src/templates/base/src/types/models/user.types.ts +26 -0
- package/cli/src/templates/base-bun-native/.env.example +1 -1
- package/cli/src/templates/base-bun-native/package.json +2 -1
- package/cli/src/templates/base-bun-native/src/config/index.ts +1 -1
- package/cli/src/templates/base-bun-native/src/controllers/user/create-user.controller.ts +76 -0
- package/cli/src/templates/base-bun-native/src/controllers/user/delete-user.controller.ts +53 -0
- package/cli/src/templates/base-bun-native/src/controllers/user/get-user.controller.ts +67 -0
- package/cli/src/templates/base-bun-native/src/controllers/user/get-users.controller.ts +40 -0
- package/cli/src/templates/base-bun-native/src/controllers/user/update-user.controller.ts +101 -0
- package/cli/src/templates/base-bun-native/src/index.ts +3 -3
- package/cli/src/templates/base-bun-native/src/models/user.model.ts +83 -0
- package/cli/src/templates/base-bun-native/src/routes/index.ts +10 -6
- package/cli/src/templates/base-bun-native/src/routes/user.route.ts +50 -0
- package/cli/src/templates/base-bun-native/src/types/common/api-response.types.ts +30 -0
- package/cli/src/templates/base-bun-native/src/types/index.ts +5 -2
- package/cli/src/templates/base-bun-native/src/types/models/user.types.ts +26 -0
- package/cli/src/templates/base-express/.env.example +1 -1
- package/cli/src/templates/base-express/package.json +2 -1
- package/cli/src/templates/base-express/src/config/index.ts +1 -1
- package/cli/src/templates/base-express/src/controllers/user/create-user.controller.ts +75 -0
- package/cli/src/templates/base-express/src/controllers/user/delete-user.controller.ts +56 -0
- package/cli/src/templates/base-express/src/controllers/user/get-user.controller.ts +70 -0
- package/cli/src/templates/base-express/src/controllers/user/get-users.controller.ts +41 -0
- package/cli/src/templates/base-express/src/controllers/user/update-user.controller.ts +102 -0
- package/cli/src/templates/base-express/src/models/user.model.ts +83 -0
- package/cli/src/templates/base-express/src/routes/index.ts +5 -0
- package/cli/src/templates/base-express/src/routes/user.route.ts +17 -0
- package/cli/src/templates/base-express/src/types/common/api-response.types.ts +30 -0
- package/cli/src/templates/base-express/src/types/index.ts +5 -2
- package/cli/src/templates/base-express/src/types/models/user.types.ts +26 -0
- package/cli/src/utils/parse-name-and-path.ts +18 -2
- package/package.json +3 -3
package/.cspell.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "0.2",
|
|
3
|
+
"language": "en",
|
|
4
|
+
"words": [
|
|
5
|
+
"Aritra",
|
|
6
|
+
"Sarkar",
|
|
7
|
+
"aritra",
|
|
8
|
+
"bunx",
|
|
9
|
+
"hono",
|
|
10
|
+
"drizzle",
|
|
11
|
+
"bullmq",
|
|
12
|
+
"inngest",
|
|
13
|
+
"upstash",
|
|
14
|
+
"logtail",
|
|
15
|
+
"resend",
|
|
16
|
+
"sendgrid",
|
|
17
|
+
"nodemailer",
|
|
18
|
+
"socketio",
|
|
19
|
+
"vitest",
|
|
20
|
+
"postgres",
|
|
21
|
+
"mongodb",
|
|
22
|
+
"redis",
|
|
23
|
+
"Cloudflare",
|
|
24
|
+
"openai",
|
|
25
|
+
"anthropic",
|
|
26
|
+
"gemini",
|
|
27
|
+
"vercel",
|
|
28
|
+
"clack",
|
|
29
|
+
"natemoo"
|
|
30
|
+
],
|
|
31
|
+
"ignorePaths": [
|
|
32
|
+
"node_modules",
|
|
33
|
+
"dist",
|
|
34
|
+
"build",
|
|
35
|
+
"*.min.js",
|
|
36
|
+
".git"
|
|
37
|
+
]
|
|
38
|
+
}
|
package/CLAUDE.md
CHANGED
|
@@ -105,20 +105,86 @@ This document outlines the coding conventions and guidelines for the `create-bac
|
|
|
105
105
|
|
|
106
106
|
---
|
|
107
107
|
|
|
108
|
-
## 📦 Type &
|
|
108
|
+
## 📦 Type Naming & Usage
|
|
109
109
|
|
|
110
|
-
### Use `PascalCase` for types,
|
|
110
|
+
### Use `PascalCase` for types, enums, and classes
|
|
111
111
|
|
|
112
112
|
```typescript
|
|
113
|
-
✅
|
|
113
|
+
✅ type CliResults = { }
|
|
114
114
|
✅ type InstallerOptions = { }
|
|
115
115
|
✅ enum AvailablePackages { }
|
|
116
116
|
✅ class ProjectScaffold { }
|
|
117
117
|
|
|
118
|
-
❌
|
|
118
|
+
❌ type cli_results = { }
|
|
119
119
|
❌ type installer_options = { }
|
|
120
120
|
```
|
|
121
121
|
|
|
122
|
+
### ⚠️ ALWAYS use `type` instead of `interface`
|
|
123
|
+
|
|
124
|
+
```typescript
|
|
125
|
+
✅ type CliResults = {
|
|
126
|
+
appName: string;
|
|
127
|
+
flags: {
|
|
128
|
+
noGit: boolean;
|
|
129
|
+
noInstall: boolean;
|
|
130
|
+
};
|
|
131
|
+
packages: string[];
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
✅ type ScaffoldOptions = {
|
|
135
|
+
projectDir: string;
|
|
136
|
+
appName: string;
|
|
137
|
+
packages: string[];
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
❌ interface CliResults {
|
|
141
|
+
appName: string;
|
|
142
|
+
flags: {
|
|
143
|
+
noGit: boolean;
|
|
144
|
+
noInstall: boolean;
|
|
145
|
+
};
|
|
146
|
+
packages: string[];
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
❌ interface ScaffoldOptions {
|
|
150
|
+
projectDir: string;
|
|
151
|
+
appName: string;
|
|
152
|
+
packages: string[];
|
|
153
|
+
}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
**Why `type` over `interface`?**
|
|
157
|
+
|
|
158
|
+
- **Consistency**: Single way to define object shapes
|
|
159
|
+
- **Flexibility**: Types support unions, intersections, and mapped types more naturally
|
|
160
|
+
- **Composability**: Better for complex type operations and transformations
|
|
161
|
+
- **Simplicity**: One less concept to remember
|
|
162
|
+
- **Modern practice**: Aligns with contemporary TypeScript patterns
|
|
163
|
+
|
|
164
|
+
**Extending types:**
|
|
165
|
+
|
|
166
|
+
```typescript
|
|
167
|
+
✅ type BaseOptions = {
|
|
168
|
+
projectDir: string;
|
|
169
|
+
appName: string;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
✅ type ExtendedOptions = BaseOptions & {
|
|
173
|
+
packages: string[];
|
|
174
|
+
flags: Record<string, boolean>;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
❌ interface BaseOptions {
|
|
178
|
+
projectDir: string;
|
|
179
|
+
appName: string;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
❌ interface ExtendedOptions extends BaseOptions {
|
|
183
|
+
packages: string[];
|
|
184
|
+
flags: Record<string, boolean>;
|
|
185
|
+
}
|
|
186
|
+
```
|
|
187
|
+
|
|
122
188
|
---
|
|
123
189
|
|
|
124
190
|
## 🗂️ Import/Export Conventions
|
|
@@ -163,7 +229,7 @@ import { install_dependencies } from "./install-dependencies.js";
|
|
|
163
229
|
const DEFAULT_PROJECT_DIR = process.cwd();
|
|
164
230
|
const TEMPLATE_BASE_PATH = "../templates/base";
|
|
165
231
|
|
|
166
|
-
|
|
232
|
+
type ScaffoldOptions = {
|
|
167
233
|
projectDir: string;
|
|
168
234
|
appName: string;
|
|
169
235
|
packages: string[];
|
|
@@ -247,7 +313,9 @@ To enforce these conventions, configure ESLint:
|
|
|
247
313
|
"selector": "typeLike",
|
|
248
314
|
"format": ["PascalCase"]
|
|
249
315
|
}
|
|
250
|
-
]
|
|
316
|
+
],
|
|
317
|
+
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
|
|
318
|
+
"@typescript-eslint/no-empty-interface": "error"
|
|
251
319
|
}
|
|
252
320
|
}
|
|
253
321
|
```
|
|
@@ -262,6 +330,7 @@ To enforce these conventions, configure ESLint:
|
|
|
262
330
|
❌ function createProject() { } // camelCase function
|
|
263
331
|
❌ const project_dir = ""; // snake_case variable
|
|
264
332
|
❌ src/CreateProject.ts // PascalCase file
|
|
333
|
+
❌ interface CliResults { } // Using interface
|
|
265
334
|
```
|
|
266
335
|
|
|
267
336
|
### ✅ Do stick to the rules
|
|
@@ -270,6 +339,7 @@ To enforce these conventions, configure ESLint:
|
|
|
270
339
|
✅ function create_project() { } // snake_case function
|
|
271
340
|
✅ const projectDir = ""; // camelCase variable
|
|
272
341
|
✅ src/create-project.ts // kebab-case file
|
|
342
|
+
✅ type CliResults = { } // Using type
|
|
273
343
|
```
|
|
274
344
|
|
|
275
345
|
---
|
|
@@ -283,9 +353,10 @@ To enforce these conventions, configure ESLint:
|
|
|
283
353
|
| **Functions** | `snake_case` | `function create_project()` |
|
|
284
354
|
| **Variables** | `camelCase` | `const projectDir` |
|
|
285
355
|
| **Constants** | `SCREAMING_SNAKE_CASE` | `const MAX_RETRIES` |
|
|
286
|
-
| **Types
|
|
356
|
+
| **Types** | `PascalCase` + `type` keyword | `type CliResults = { }` |
|
|
287
357
|
| **Enums** | `PascalCase` | `enum AvailablePackages` |
|
|
288
358
|
| **Classes** | `PascalCase` | `class ProjectScaffold` |
|
|
359
|
+
| **Object Shapes** | Use `type`, NOT `interface` | `type Config = { }` |
|
|
289
360
|
|
|
290
361
|
---
|
|
291
362
|
|
|
@@ -294,10 +365,11 @@ To enforce these conventions, configure ESLint:
|
|
|
294
365
|
When contributing to this project, please:
|
|
295
366
|
|
|
296
367
|
1. ✅ Follow ALL conventions outlined in this document
|
|
297
|
-
2. ✅
|
|
298
|
-
3. ✅
|
|
299
|
-
4. ✅
|
|
300
|
-
5. ✅
|
|
368
|
+
2. ✅ Use `type` instead of `interface` for all object type definitions
|
|
369
|
+
3. ✅ Run linting before committing: `bun run lint`
|
|
370
|
+
4. ✅ Format code: `bun run format`
|
|
371
|
+
5. ✅ Use descriptive commit messages
|
|
372
|
+
6. ✅ Add JSDoc comments for exported functions
|
|
301
373
|
|
|
302
374
|
---
|
|
303
375
|
|
|
@@ -310,6 +382,7 @@ These conventions are chosen to:
|
|
|
310
382
|
- **Reduce cognitive load** when working with multiple languages
|
|
311
383
|
- **Follow industry standards** where applicable
|
|
312
384
|
- **Enable better tooling support**
|
|
385
|
+
- **Simplify type definitions** by using only `type` declarations
|
|
313
386
|
|
|
314
387
|
---
|
|
315
388
|
|
|
@@ -318,6 +391,7 @@ These conventions are chosen to:
|
|
|
318
391
|
- [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript)
|
|
319
392
|
- [TypeScript Style Guide](https://google.github.io/styleguide/tsguide.html)
|
|
320
393
|
- [File Naming Conventions](https://github.com/kettanaito/naming-cheatsheet)
|
|
394
|
+
- [Types vs Interfaces](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#differences-between-type-aliases-and-interfaces)
|
|
321
395
|
|
|
322
396
|
---
|
|
323
397
|
|
package/README.md
CHANGED
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
# deploy-bbc
|
|
2
|
+
|
|
3
|
+
> A powerful CLI tool to bootstrap production-ready backend applications with Bun
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
`deploy-bbc` (Best Backend Code) is an interactive command-line tool that scaffolds modern, type-safe backend applications using Bun. It provides a comprehensive set of integrations for databases, authentication, AI services, cloud providers, and more - all configured and ready to use.
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- **Three Framework Options**: Choose between Hono, Express, or Bun Native HTTP
|
|
12
|
+
- **Production-Ready Templates**: Pre-configured with best practices and error handling
|
|
13
|
+
- **30+ Integrations**: Databases, auth, AI, cloud storage, queues, and more
|
|
14
|
+
- **Type-Safe**: Full TypeScript support with strict typing
|
|
15
|
+
- **Docker Ready**: Automatic Dockerfile and docker-compose generation
|
|
16
|
+
- **Developer Experience**: Built-in validation, testing, and API documentation options
|
|
17
|
+
- **Zero Config**: Works out of the box with sensible defaults
|
|
18
|
+
|
|
19
|
+
## Quick Start
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
# Using npx (recommended)
|
|
23
|
+
npx deploy-bbc my-backend
|
|
24
|
+
|
|
25
|
+
# Using bun
|
|
26
|
+
bunx deploy-bbc my-backend
|
|
27
|
+
|
|
28
|
+
# Using npm
|
|
29
|
+
npm create backend-app my-backend
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Follow the interactive prompts to select your framework and integrations.
|
|
33
|
+
|
|
34
|
+
## Installation
|
|
35
|
+
|
|
36
|
+
### As a CLI Tool
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
# Install globally
|
|
40
|
+
npm install -g deploy-bbc
|
|
41
|
+
|
|
42
|
+
# Run
|
|
43
|
+
deploy-bbc my-app-name
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### From Source
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
# Clone the repository
|
|
50
|
+
git clone https://github.com/aritra69/deploy-bbc.git
|
|
51
|
+
cd deploy-bbc
|
|
52
|
+
|
|
53
|
+
# Install dependencies
|
|
54
|
+
bun install
|
|
55
|
+
|
|
56
|
+
# Build
|
|
57
|
+
bun run build
|
|
58
|
+
|
|
59
|
+
# Link for local development
|
|
60
|
+
npm link
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Usage
|
|
64
|
+
|
|
65
|
+
### Interactive Mode
|
|
66
|
+
|
|
67
|
+
Simply run the CLI and answer the prompts:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
deploy-bbc my-backend
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
You'll be prompted to:
|
|
74
|
+
|
|
75
|
+
1. Choose a framework (Hono, Express, or Bun Native)
|
|
76
|
+
2. Select integrations (databases, auth, AI services, etc.)
|
|
77
|
+
3. Configure additional options
|
|
78
|
+
|
|
79
|
+
### CLI Flags
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
deploy-bbc my-backend [options]
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
#### General Options
|
|
86
|
+
|
|
87
|
+
- `--no-git` - Skip Git initialization
|
|
88
|
+
- `--no-install` - Skip dependency installation
|
|
89
|
+
- `--default` - Use default configuration (Hono with no extras)
|
|
90
|
+
- `--CI` - Run in CI mode (non-interactive)
|
|
91
|
+
|
|
92
|
+
#### Database Options
|
|
93
|
+
|
|
94
|
+
- `--postgres` - Add PostgreSQL with Drizzle ORM
|
|
95
|
+
- `--mysql` - Add MySQL with Drizzle ORM
|
|
96
|
+
- `--mongodb` - Add MongoDB with Mongoose
|
|
97
|
+
- `--redis` - Add Redis support
|
|
98
|
+
|
|
99
|
+
#### Authentication Options
|
|
100
|
+
|
|
101
|
+
- `--jwt` - Add JWT authentication
|
|
102
|
+
- `--oauth` - Add OAuth 2.0 support
|
|
103
|
+
- `--session` - Add session-based authentication
|
|
104
|
+
|
|
105
|
+
#### AI Integration Options
|
|
106
|
+
|
|
107
|
+
- `--openai` - Add OpenAI integration
|
|
108
|
+
- `--anthropic` - Add Anthropic Claude integration
|
|
109
|
+
- `--gemini` - Add Google Gemini integration
|
|
110
|
+
- `--vercel-ai` - Add Vercel AI SDK
|
|
111
|
+
|
|
112
|
+
#### Cloud Provider Options
|
|
113
|
+
|
|
114
|
+
- `--aws` - Add AWS SDK (S3, SES)
|
|
115
|
+
- `--gcp` - Add Google Cloud Platform SDK
|
|
116
|
+
- `--azure` - Add Azure SDK
|
|
117
|
+
- `--cloudflare-r2` - Add Cloudflare R2 storage
|
|
118
|
+
|
|
119
|
+
#### Communication Options
|
|
120
|
+
|
|
121
|
+
- `--resend` - Add Resend email service
|
|
122
|
+
- `--sendgrid` - Add SendGrid email service
|
|
123
|
+
- `--nodemailer` - Add Nodemailer
|
|
124
|
+
- `--socketio` - Add Socket.IO for WebSockets
|
|
125
|
+
- `--sse` - Add Server-Sent Events
|
|
126
|
+
|
|
127
|
+
#### Infrastructure Options
|
|
128
|
+
|
|
129
|
+
- `--bullmq` - Add BullMQ job queue
|
|
130
|
+
- `--inngest` - Add Inngest workflow engine
|
|
131
|
+
- `--upstash-ratelimit` - Add Upstash rate limiting
|
|
132
|
+
- `--custom-ratelimit` - Add custom rate limiting
|
|
133
|
+
- `--sentry` - Add Sentry error tracking
|
|
134
|
+
- `--logtail` - Add Logtail logging
|
|
135
|
+
|
|
136
|
+
#### Developer Experience Options
|
|
137
|
+
|
|
138
|
+
- `--swagger` - Add Swagger/OpenAPI documentation
|
|
139
|
+
- `--scalar` - Add Scalar API documentation
|
|
140
|
+
- `--vitest` - Add Vitest testing framework
|
|
141
|
+
- `--zod` - Add Zod validation
|
|
142
|
+
- `--yup` - Add Yup validation
|
|
143
|
+
|
|
144
|
+
### Example Commands
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
# Create a Hono app with PostgreSQL and JWT auth
|
|
148
|
+
deploy-bbc my-api --postgres --jwt
|
|
149
|
+
|
|
150
|
+
# Create an Express app with full stack
|
|
151
|
+
deploy-bbc my-app --postgres --redis --jwt --openai --aws --swagger
|
|
152
|
+
|
|
153
|
+
# Create a minimal Bun native app
|
|
154
|
+
deploy-bbc my-api --default
|
|
155
|
+
|
|
156
|
+
# Create without Git initialization
|
|
157
|
+
deploy-bbc my-api --no-git --postgres --jwt
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## Framework Options
|
|
161
|
+
|
|
162
|
+
### Hono (Default)
|
|
163
|
+
|
|
164
|
+
Ultra-fast web framework optimized for Bun and edge runtimes. Lightweight and type-safe.
|
|
165
|
+
|
|
166
|
+
### Express
|
|
167
|
+
|
|
168
|
+
Battle-tested Node.js framework with extensive ecosystem and middleware support.
|
|
169
|
+
|
|
170
|
+
### Bun Native HTTP
|
|
171
|
+
|
|
172
|
+
Use Bun's native HTTP server for maximum performance with minimal overhead.
|
|
173
|
+
|
|
174
|
+
## Available Integrations
|
|
175
|
+
|
|
176
|
+
### Databases
|
|
177
|
+
|
|
178
|
+
- **PostgreSQL** - Relational database with Drizzle ORM
|
|
179
|
+
- **MySQL** - Relational database with Drizzle ORM
|
|
180
|
+
- **MongoDB** - Document database with Mongoose ODM
|
|
181
|
+
- **Redis** - In-memory data store for caching and sessions
|
|
182
|
+
|
|
183
|
+
### Authentication
|
|
184
|
+
|
|
185
|
+
- **JWT** - JSON Web Token authentication with utilities
|
|
186
|
+
- **OAuth 2.0** - Third-party authentication (Google, GitHub, etc.)
|
|
187
|
+
- **Session** - Traditional session-based authentication
|
|
188
|
+
|
|
189
|
+
### AI & Machine Learning
|
|
190
|
+
|
|
191
|
+
- **OpenAI** - GPT models integration
|
|
192
|
+
- **Anthropic** - Claude AI integration
|
|
193
|
+
- **Google Gemini** - Gemini AI models
|
|
194
|
+
- **Vercel AI SDK** - Multi-provider AI SDK with streaming support
|
|
195
|
+
|
|
196
|
+
### Cloud & Storage
|
|
197
|
+
|
|
198
|
+
- **AWS** - S3 storage, SES email, and more
|
|
199
|
+
- **Google Cloud Platform** - Cloud Storage and services
|
|
200
|
+
- **Azure** - Blob storage and Azure services
|
|
201
|
+
- **Cloudflare R2** - S3-compatible object storage
|
|
202
|
+
|
|
203
|
+
### Communication
|
|
204
|
+
|
|
205
|
+
- **Resend** - Modern transactional email
|
|
206
|
+
- **SendGrid** - Email delivery service
|
|
207
|
+
- **Nodemailer** - Flexible email sending
|
|
208
|
+
- **Socket.IO** - Real-time bidirectional communication
|
|
209
|
+
- **Server-Sent Events** - Server-to-client streaming
|
|
210
|
+
|
|
211
|
+
### Infrastructure
|
|
212
|
+
|
|
213
|
+
- **BullMQ** - Redis-based job queue
|
|
214
|
+
- **Inngest** - Durable workflow engine
|
|
215
|
+
- **Rate Limiting** - Upstash or custom implementation
|
|
216
|
+
- **Sentry** - Error tracking and monitoring
|
|
217
|
+
- **Logtail** - Log management and analytics
|
|
218
|
+
|
|
219
|
+
### Developer Experience
|
|
220
|
+
|
|
221
|
+
- **Swagger/OpenAPI** - Interactive API documentation
|
|
222
|
+
- **Scalar** - Beautiful API documentation
|
|
223
|
+
- **Vitest** - Fast unit testing framework
|
|
224
|
+
- **Zod** - TypeScript-first schema validation
|
|
225
|
+
- **Yup** - Object schema validation
|
|
226
|
+
|
|
227
|
+
## Project Structure
|
|
228
|
+
|
|
229
|
+
```plaintext
|
|
230
|
+
my-backend/
|
|
231
|
+
├── src/
|
|
232
|
+
│ ├── config/ # Configuration files
|
|
233
|
+
│ ├── middleware/ # Express/Hono middleware
|
|
234
|
+
│ ├── routes/ # API routes
|
|
235
|
+
│ ├── services/ # Business logic
|
|
236
|
+
│ ├── db/ # Database configuration
|
|
237
|
+
│ ├── utils/ # Utility functions
|
|
238
|
+
│ ├── types/ # TypeScript types
|
|
239
|
+
│ └── index.ts # Application entry point
|
|
240
|
+
├── .env.example # Environment variables template
|
|
241
|
+
├── .gitignore
|
|
242
|
+
├── package.json
|
|
243
|
+
├── tsconfig.json
|
|
244
|
+
├── Dockerfile # Docker configuration
|
|
245
|
+
├── docker-compose.yml # Docker Compose setup
|
|
246
|
+
└── README.md
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
## Development
|
|
250
|
+
|
|
251
|
+
### Prerequisites
|
|
252
|
+
|
|
253
|
+
- Node.js >= 18.0.0
|
|
254
|
+
- Bun >= 1.0.0 (recommended)
|
|
255
|
+
|
|
256
|
+
### Commands
|
|
257
|
+
|
|
258
|
+
```bash
|
|
259
|
+
# Development mode with hot reload
|
|
260
|
+
bun run dev
|
|
261
|
+
|
|
262
|
+
# Build the project
|
|
263
|
+
bun run build
|
|
264
|
+
|
|
265
|
+
# Type checking
|
|
266
|
+
bun run type-check
|
|
267
|
+
|
|
268
|
+
# Lint code
|
|
269
|
+
bun run lint
|
|
270
|
+
|
|
271
|
+
# Format code
|
|
272
|
+
bun run format
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
### Contributing
|
|
276
|
+
|
|
277
|
+
We welcome contributions! Please follow these steps:
|
|
278
|
+
|
|
279
|
+
1. Fork the repository
|
|
280
|
+
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
|
|
281
|
+
3. Follow the coding conventions in `CLAUDE.md`
|
|
282
|
+
4. Commit your changes (`git commit -m 'Add amazing feature'`)
|
|
283
|
+
5. Push to the branch (`git push origin feature/amazing-feature`)
|
|
284
|
+
6. Open a Pull Request
|
|
285
|
+
|
|
286
|
+
#### Coding Conventions
|
|
287
|
+
|
|
288
|
+
This project follows specific naming conventions:
|
|
289
|
+
|
|
290
|
+
- **Files/Folders**: `kebab-case`
|
|
291
|
+
- **Functions**: `snake_case`
|
|
292
|
+
- **Variables**: `snake_case`
|
|
293
|
+
- **Types**: `PascalCase` (use `type`, not `interface`)
|
|
294
|
+
- **Constants**: `SCREAMING_SNAKE_CASE`
|
|
295
|
+
|
|
296
|
+
See `CLAUDE.md` for complete guidelines.
|
|
297
|
+
|
|
298
|
+
## Docker Support
|
|
299
|
+
|
|
300
|
+
Every generated project includes Docker configuration:
|
|
301
|
+
|
|
302
|
+
```bash
|
|
303
|
+
# Build and run with Docker Compose
|
|
304
|
+
docker-compose up
|
|
305
|
+
|
|
306
|
+
# Build Docker image
|
|
307
|
+
docker build -t my-backend .
|
|
308
|
+
|
|
309
|
+
# Run container
|
|
310
|
+
docker run -p 8000:8000 my-backend
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
## Environment Variables
|
|
314
|
+
|
|
315
|
+
Each integration adds its required environment variables to `.env.example`. Copy it to `.env` and fill in your values:
|
|
316
|
+
|
|
317
|
+
```bash
|
|
318
|
+
cp .env.example .env
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
## License
|
|
322
|
+
|
|
323
|
+
MIT License - see LICENSE file for details
|
|
324
|
+
|
|
325
|
+
## Author
|
|
326
|
+
|
|
327
|
+
### Aritra Sarkar
|
|
328
|
+
|
|
329
|
+
- GitHub: [@aritra69](https://github.com/aritra69)
|
|
330
|
+
- Email: <aritrasarkar2002@gmail.com>
|
|
331
|
+
|
|
332
|
+
## Contributors
|
|
333
|
+
|
|
334
|
+
This project exists thanks to all the people who contribute.
|
|
335
|
+
|
|
336
|
+
[](https://github.com/aritra69/deploy-bbc/graphs/contributors)
|
|
337
|
+
|
|
338
|
+
### How to Contribute
|
|
339
|
+
|
|
340
|
+
We appreciate all contributions! See the [Contributing](#contributing) section above for guidelines.
|
|
341
|
+
|
|
342
|
+
## Support
|
|
343
|
+
|
|
344
|
+
- Issues: [GitHub Issues](https://github.com/aritra69/deploy-bbc/issues)
|
|
345
|
+
- Discussions: [GitHub Discussions](https://github.com/aritra69/deploy-bbc/discussions)
|
|
346
|
+
|
|
347
|
+
## Acknowledgments
|
|
348
|
+
|
|
349
|
+
Built with:
|
|
350
|
+
|
|
351
|
+
- [Bun](https://bun.sh) - Fast all-in-one JavaScript runtime
|
|
352
|
+
- [Hono](https://hono.dev) - Ultra-fast web framework
|
|
353
|
+
- [Drizzle ORM](https://orm.drizzle.team) - TypeScript ORM
|
|
354
|
+
- [Clack](https://github.com/natemoo-re/clack) - Interactive CLI prompts
|
|
355
|
+
|
|
356
|
+
---
|
|
357
|
+
|
|
358
|
+
**Star this repository if you find it helpful!**
|
package/cli/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "deploy-bbc",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "CLI to bootstrap production-ready backends with Bun (Best Backend Code)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -38,17 +38,17 @@
|
|
|
38
38
|
"url": "https://github.com/aritra69/deploy-bbc/issues"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@clack/prompts": "^0.
|
|
42
|
-
"chalk": "^5.
|
|
43
|
-
"commander": "^
|
|
44
|
-
"execa": "^
|
|
45
|
-
"fs-extra": "^11.
|
|
46
|
-
"ora": "^
|
|
41
|
+
"@clack/prompts": "^0.11.0",
|
|
42
|
+
"chalk": "^5.6.2",
|
|
43
|
+
"commander": "^14.0.2",
|
|
44
|
+
"execa": "^9.6.1",
|
|
45
|
+
"fs-extra": "^11.3.3",
|
|
46
|
+
"ora": "^9.1.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@types/bun": "latest",
|
|
50
50
|
"@types/fs-extra": "^11.0.4",
|
|
51
|
-
"@types/node": "^
|
|
52
|
-
"typescript": "^5.
|
|
51
|
+
"@types/node": "^25.0.10",
|
|
52
|
+
"typescript": "^5.9.3"
|
|
53
53
|
}
|
|
54
54
|
}
|
package/cli/src/cli/index.ts
CHANGED
|
@@ -100,12 +100,17 @@ export const run_cli = async (): Promise<CliResults> => {
|
|
|
100
100
|
projectName: () =>
|
|
101
101
|
p.text({
|
|
102
102
|
message: "What will your project be called?",
|
|
103
|
-
placeholder: "my-awesome-api",
|
|
103
|
+
placeholder: "my-awesome-api (or . for current directory)",
|
|
104
104
|
defaultValue: cliProvidedName || "my-backend",
|
|
105
105
|
validate: (value) => {
|
|
106
106
|
if (!value) return "Please enter a project name";
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
// Allow '.' for current directory or paths
|
|
108
|
+
if (value === "." || value.startsWith("./") || value.startsWith("../") || value.startsWith("~/")) {
|
|
109
|
+
return; // Valid path
|
|
110
|
+
}
|
|
111
|
+
// Otherwise check for valid name format
|
|
112
|
+
if (!/^[a-z0-9-_/]+$/i.test(value))
|
|
113
|
+
return "Only letters, numbers, dashes, underscores, and slashes";
|
|
109
114
|
},
|
|
110
115
|
}),
|
|
111
116
|
|