start-it-cli 1.0.0

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.
@@ -0,0 +1,651 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.springBootTemplates = void 0;
4
+ exports.springBootTemplates = {
5
+ "REST API": {
6
+ name: "REST API",
7
+ description: "A Spring Boot REST API",
8
+ files: [
9
+ {
10
+ path: "pom.xml",
11
+ content: `<?xml version="1.0" encoding="UTF-8"?>
12
+ <project xmlns="http://maven.apache.org/POM/4.0.0"
13
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
14
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
15
+ http://maven.apache.org/xsd/maven-4.0.0.xsd">
16
+ <modelVersion>4.0.0</modelVersion>
17
+
18
+ <groupId>com.example</groupId>
19
+ <artifactId>rest-api</artifactId>
20
+ <version>1.0.0</version>
21
+ <packaging>jar</packaging>
22
+
23
+ <name>REST API</name>
24
+ <description>Spring Boot REST API</description>
25
+
26
+ <parent>
27
+ <groupId>org.springframework.boot</groupId>
28
+ <artifactId>spring-boot-starter-parent</artifactId>
29
+ <version>3.1.5</version>
30
+ <relativePath/>
31
+ </parent>
32
+
33
+ <properties>
34
+ <java.version>17</java.version>
35
+ </properties>
36
+
37
+ <dependencies>
38
+ <dependency>
39
+ <groupId>org.springframework.boot</groupId>
40
+ <artifactId>spring-boot-starter-web</artifactId>
41
+ </dependency>
42
+
43
+ <dependency>
44
+ <groupId>org.springframework.boot</groupId>
45
+ <artifactId>spring-boot-starter-test</artifactId>
46
+ <scope>test</scope>
47
+ </dependency>
48
+ </dependencies>
49
+
50
+ <build>
51
+ <plugins>
52
+ <plugin>
53
+ <groupId>org.springframework.boot</groupId>
54
+ <artifactId>spring-boot-maven-plugin</artifactId>
55
+ </plugin>
56
+ </plugins>
57
+ </build>
58
+ </project>
59
+ `,
60
+ },
61
+ {
62
+ path: "src/main/java/com/example/Application.java",
63
+ content: `package com.example;
64
+
65
+ import org.springframework.boot.SpringApplication;
66
+ import org.springframework.boot.autoconfigure.SpringBootApplication;
67
+
68
+ @SpringBootApplication
69
+ public class Application {
70
+
71
+ public static void main(String[] args) {
72
+ SpringApplication.run(Application.class, args);
73
+ }
74
+ }
75
+ `,
76
+ },
77
+ {
78
+ path: "src/main/java/com/example/controller/ApiController.java",
79
+ content: `package com.example.controller;
80
+
81
+ import org.springframework.web.bind.annotation.*;
82
+ import java.util.HashMap;
83
+ import java.util.Map;
84
+
85
+ @RestController
86
+ @RequestMapping("/api")
87
+ public class ApiController {
88
+
89
+ @GetMapping("/hello")
90
+ public Map<String, String> hello() {
91
+ Map<String, String> response = new HashMap<>();
92
+ response.put("message", "Hello from Spring Boot!");
93
+ return response;
94
+ }
95
+
96
+ @GetMapping("/health")
97
+ public Map<String, String> health() {
98
+ Map<String, String> response = new HashMap<>();
99
+ response.put("status", "UP");
100
+ return response;
101
+ }
102
+
103
+ @PostMapping("/echo")
104
+ public Map<String, Object> echo(@RequestBody Map<String, Object> request) {
105
+ return request;
106
+ }
107
+ }
108
+ `,
109
+ },
110
+ {
111
+ path: "src/main/resources/application.properties",
112
+ content: `spring.application.name=rest-api
113
+ server.port=8080
114
+ `,
115
+ },
116
+ {
117
+ path: "README.md",
118
+ content: `# Spring Boot REST API
119
+
120
+ A RESTful API built with Spring Boot.
121
+
122
+ ## Prerequisites
123
+
124
+ - Java 17+
125
+ - Maven 3.6+
126
+
127
+ ## Build
128
+
129
+ \`\`\`bash
130
+ mvn clean package
131
+ \`\`\`
132
+
133
+ ## Run
134
+
135
+ \`\`\`bash
136
+ mvn spring-boot:run
137
+ \`\`\`
138
+
139
+ The API will be available at \`http://localhost:8080\`
140
+
141
+ ## Endpoints
142
+
143
+ - \`GET /api/hello\` - Hello endpoint
144
+ - \`GET /api/health\` - Health check
145
+ - \`POST /api/echo\` - Echo endpoint
146
+
147
+ ## Project Structure
148
+
149
+ - \`src/main/java/com/example/Application.java\` - Main application class
150
+ - \`src/main/java/com/example/controller/\` - REST controllers
151
+ - \`src/main/resources/\` - Configuration files
152
+ `,
153
+ },
154
+ {
155
+ path: ".gitignore",
156
+ content: `# Maven
157
+ target/
158
+ pom.xml.tag
159
+ pom.xml.releaseBackup
160
+ pom.xml.versionsBackup
161
+ pom.xml.next
162
+ release.properties
163
+ dependency-reduced-pom.xml
164
+ buildNumber.properties
165
+ .mvn/timing.properties
166
+ .mvn/wrapper/maven-wrapper.jar
167
+
168
+ # IDE
169
+ .idea/
170
+ *.iml
171
+ *.iws
172
+ *.ipr
173
+ .vscode/
174
+ *.swp
175
+ *.swo
176
+
177
+ # OS
178
+ .DS_Store
179
+ Thumbs.db
180
+
181
+ # Logs
182
+ *.log
183
+ `,
184
+ },
185
+ ],
186
+ },
187
+ "Web Application": {
188
+ name: "Web Application",
189
+ description: "A Spring Boot web application",
190
+ files: [
191
+ {
192
+ path: "pom.xml",
193
+ content: `<?xml version="1.0" encoding="UTF-8"?>
194
+ <project xmlns="http://maven.apache.org/POM/4.0.0"
195
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
196
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
197
+ http://maven.apache.org/xsd/maven-4.0.0.xsd">
198
+ <modelVersion>4.0.0</modelVersion>
199
+
200
+ <groupId>com.example</groupId>
201
+ <artifactId>web-app</artifactId>
202
+ <version>1.0.0</version>
203
+ <packaging>jar</packaging>
204
+
205
+ <name>Web Application</name>
206
+ <description>Spring Boot Web Application</description>
207
+
208
+ <parent>
209
+ <groupId>org.springframework.boot</groupId>
210
+ <artifactId>spring-boot-starter-parent</artifactId>
211
+ <version>3.1.5</version>
212
+ <relativePath/>
213
+ </parent>
214
+
215
+ <properties>
216
+ <java.version>17</java.version>
217
+ </properties>
218
+
219
+ <dependencies>
220
+ <dependency>
221
+ <groupId>org.springframework.boot</groupId>
222
+ <artifactId>spring-boot-starter-web</artifactId>
223
+ </dependency>
224
+
225
+ <dependency>
226
+ <groupId>org.springframework.boot</groupId>
227
+ <artifactId>spring-boot-starter-thymeleaf</artifactId>
228
+ </dependency>
229
+
230
+ <dependency>
231
+ <groupId>org.springframework.boot</groupId>
232
+ <artifactId>spring-boot-starter-test</artifactId>
233
+ <scope>test</scope>
234
+ </dependency>
235
+ </dependencies>
236
+
237
+ <build>
238
+ <plugins>
239
+ <plugin>
240
+ <groupId>org.springframework.boot</groupId>
241
+ <artifactId>spring-boot-maven-plugin</artifactId>
242
+ </plugin>
243
+ </plugins>
244
+ </build>
245
+ </project>
246
+ `,
247
+ },
248
+ {
249
+ path: "src/main/java/com/example/Application.java",
250
+ content: `package com.example;
251
+
252
+ import org.springframework.boot.SpringApplication;
253
+ import org.springframework.boot.autoconfigure.SpringBootApplication;
254
+
255
+ @SpringBootApplication
256
+ public class Application {
257
+
258
+ public static void main(String[] args) {
259
+ SpringApplication.run(Application.class, args);
260
+ }
261
+ }
262
+ `,
263
+ },
264
+ {
265
+ path: "src/main/java/com/example/controller/WebController.java",
266
+ content: `package com.example.controller;
267
+
268
+ import org.springframework.stereotype.Controller;
269
+ import org.springframework.ui.Model;
270
+ import org.springframework.web.bind.annotation.GetMapping;
271
+
272
+ @Controller
273
+ public class WebController {
274
+
275
+ @GetMapping("/")
276
+ public String index(Model model) {
277
+ model.addAttribute("title", "Welcome to Spring Boot");
278
+ model.addAttribute("message", "This is a web application");
279
+ return "index";
280
+ }
281
+
282
+ @GetMapping("/about")
283
+ public String about(Model model) {
284
+ model.addAttribute("title", "About");
285
+ return "about";
286
+ }
287
+ }
288
+ `,
289
+ },
290
+ {
291
+ path: "src/main/resources/templates/index.html",
292
+ content: `<!DOCTYPE html>
293
+ <html xmlns:th="http://www.thymeleaf.org">
294
+ <head>
295
+ <meta charset="UTF-8">
296
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
297
+ <title th:text="\${title}">Home</title>
298
+ <style>
299
+ body {
300
+ font-family: Arial, sans-serif;
301
+ margin: 0;
302
+ padding: 20px;
303
+ background-color: #f5f5f5;
304
+ }
305
+ .container {
306
+ max-width: 800px;
307
+ margin: 0 auto;
308
+ background-color: white;
309
+ padding: 20px;
310
+ border-radius: 8px;
311
+ box-shadow: 0 2px 4px rgba(0,0,0,0.1);
312
+ }
313
+ h1 {
314
+ color: #333;
315
+ }
316
+ p {
317
+ color: #666;
318
+ }
319
+ a {
320
+ color: #007bff;
321
+ text-decoration: none;
322
+ }
323
+ a:hover {
324
+ text-decoration: underline;
325
+ }
326
+ </style>
327
+ </head>
328
+ <body>
329
+ <div class="container">
330
+ <h1 th:text="\${title}">Welcome</h1>
331
+ <p th:text="\${message}">Message</p>
332
+ <p><a href="/about">About</a></p>
333
+ </div>
334
+ </body>
335
+ </html>
336
+ `,
337
+ },
338
+ {
339
+ path: "src/main/resources/templates/about.html",
340
+ content: `<!DOCTYPE html>
341
+ <html xmlns:th="http://www.thymeleaf.org">
342
+ <head>
343
+ <meta charset="UTF-8">
344
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
345
+ <title th:text="\${title}">About</title>
346
+ <style>
347
+ body {
348
+ font-family: Arial, sans-serif;
349
+ margin: 0;
350
+ padding: 20px;
351
+ background-color: #f5f5f5;
352
+ }
353
+ .container {
354
+ max-width: 800px;
355
+ margin: 0 auto;
356
+ background-color: white;
357
+ padding: 20px;
358
+ border-radius: 8px;
359
+ box-shadow: 0 2px 4px rgba(0,0,0,0.1);
360
+ }
361
+ h1 {
362
+ color: #333;
363
+ }
364
+ p {
365
+ color: #666;
366
+ }
367
+ a {
368
+ color: #007bff;
369
+ text-decoration: none;
370
+ }
371
+ </style>
372
+ </head>
373
+ <body>
374
+ <div class="container">
375
+ <h1 th:text="\${title}">About</h1>
376
+ <p>This is a Spring Boot web application.</p>
377
+ <p><a href="/">Back to Home</a></p>
378
+ </div>
379
+ </body>
380
+ </html>
381
+ `,
382
+ },
383
+ {
384
+ path: "src/main/resources/application.properties",
385
+ content: `spring.application.name=web-app
386
+ server.port=8080
387
+ `,
388
+ },
389
+ {
390
+ path: "README.md",
391
+ content: `# Spring Boot Web Application
392
+
393
+ A web application built with Spring Boot and Thymeleaf.
394
+
395
+ ## Prerequisites
396
+
397
+ - Java 17+
398
+ - Maven 3.6+
399
+
400
+ ## Build
401
+
402
+ \`\`\`bash
403
+ mvn clean package
404
+ \`\`\`
405
+
406
+ ## Run
407
+
408
+ \`\`\`bash
409
+ mvn spring-boot:run
410
+ \`\`\`
411
+
412
+ The application will be available at \`http://localhost:8080\`
413
+
414
+ ## Project Structure
415
+
416
+ - \`src/main/java/com/example/\` - Java source code
417
+ - \`src/main/resources/templates/\` - HTML templates
418
+ - \`src/main/resources/\` - Configuration files
419
+ `,
420
+ },
421
+ {
422
+ path: ".gitignore",
423
+ content: `# Maven
424
+ target/
425
+ pom.xml.tag
426
+ pom.xml.releaseBackup
427
+ pom.xml.versionsBackup
428
+ pom.xml.next
429
+ release.properties
430
+ dependency-reduced-pom.xml
431
+ buildNumber.properties
432
+ .mvn/timing.properties
433
+ .mvn/wrapper/maven-wrapper.jar
434
+
435
+ # IDE
436
+ .idea/
437
+ *.iml
438
+ *.iws
439
+ *.ipr
440
+ .vscode/
441
+ *.swp
442
+ *.swo
443
+
444
+ # OS
445
+ .DS_Store
446
+ Thumbs.db
447
+
448
+ # Logs
449
+ *.log
450
+ `,
451
+ },
452
+ ],
453
+ },
454
+ Microservice: {
455
+ name: "Microservice",
456
+ description: "A Spring Boot microservice",
457
+ files: [
458
+ {
459
+ path: "pom.xml",
460
+ content: `<?xml version="1.0" encoding="UTF-8"?>
461
+ <project xmlns="http://maven.apache.org/POM/4.0.0"
462
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
463
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
464
+ http://maven.apache.org/xsd/maven-4.0.0.xsd">
465
+ <modelVersion>4.0.0</modelVersion>
466
+
467
+ <groupId>com.example</groupId>
468
+ <artifactId>microservice</artifactId>
469
+ <version>1.0.0</version>
470
+ <packaging>jar</packaging>
471
+
472
+ <name>Microservice</name>
473
+ <description>Spring Boot Microservice</description>
474
+
475
+ <parent>
476
+ <groupId>org.springframework.boot</groupId>
477
+ <artifactId>spring-boot-starter-parent</artifactId>
478
+ <version>3.1.5</version>
479
+ <relativePath/>
480
+ </parent>
481
+
482
+ <properties>
483
+ <java.version>17</java.version>
484
+ </properties>
485
+
486
+ <dependencies>
487
+ <dependency>
488
+ <groupId>org.springframework.boot</groupId>
489
+ <artifactId>spring-boot-starter-web</artifactId>
490
+ </dependency>
491
+
492
+ <dependency>
493
+ <groupId>org.springframework.boot</groupId>
494
+ <artifactId>spring-boot-starter-actuator</artifactId>
495
+ </dependency>
496
+
497
+ <dependency>
498
+ <groupId>org.springframework.boot</groupId>
499
+ <artifactId>spring-boot-starter-test</artifactId>
500
+ <scope>test</scope>
501
+ </dependency>
502
+ </dependencies>
503
+
504
+ <build>
505
+ <plugins>
506
+ <plugin>
507
+ <groupId>org.springframework.boot</groupId>
508
+ <artifactId>spring-boot-maven-plugin</artifactId>
509
+ </plugin>
510
+ </plugins>
511
+ </build>
512
+ </project>
513
+ `,
514
+ },
515
+ {
516
+ path: "src/main/java/com/example/Application.java",
517
+ content: `package com.example;
518
+
519
+ import org.springframework.boot.SpringApplication;
520
+ import org.springframework.boot.autoconfigure.SpringBootApplication;
521
+
522
+ @SpringBootApplication
523
+ public class Application {
524
+
525
+ public static void main(String[] args) {
526
+ SpringApplication.run(Application.class, args);
527
+ }
528
+ }
529
+ `,
530
+ },
531
+ {
532
+ path: "src/main/java/com/example/controller/ServiceController.java",
533
+ content: `package com.example.controller;
534
+
535
+ import org.springframework.web.bind.annotation.*;
536
+ import java.util.HashMap;
537
+ import java.util.Map;
538
+ import java.util.UUID;
539
+
540
+ @RestController
541
+ @RequestMapping("/service")
542
+ public class ServiceController {
543
+
544
+ private final String serviceId = UUID.randomUUID().toString();
545
+
546
+ @GetMapping("/info")
547
+ public Map<String, Object> info() {
548
+ Map<String, Object> response = new HashMap<>();
549
+ response.put("id", serviceId);
550
+ response.put("name", "Microservice");
551
+ response.put("version", "1.0.0");
552
+ return response;
553
+ }
554
+
555
+ @GetMapping("/health")
556
+ public Map<String, String> health() {
557
+ Map<String, String> response = new HashMap<>();
558
+ response.put("status", "healthy");
559
+ response.put("service_id", serviceId);
560
+ return response;
561
+ }
562
+
563
+ @GetMapping("/ready")
564
+ public Map<String, Boolean> ready() {
565
+ Map<String, Boolean> response = new HashMap<>();
566
+ response.put("ready", true);
567
+ return response;
568
+ }
569
+ }
570
+ `,
571
+ },
572
+ {
573
+ path: "src/main/resources/application.properties",
574
+ content: `spring.application.name=microservice
575
+ server.port=8080
576
+ management.endpoints.web.exposure.include=health,info
577
+ `,
578
+ },
579
+ {
580
+ path: "README.md",
581
+ content: `# Spring Boot Microservice
582
+
583
+ A microservice template built with Spring Boot.
584
+
585
+ ## Features
586
+
587
+ - Service discovery endpoints
588
+ - Health checks
589
+ - Readiness checks
590
+ - Actuator endpoints
591
+
592
+ ## Prerequisites
593
+
594
+ - Java 17+
595
+ - Maven 3.6+
596
+
597
+ ## Build
598
+
599
+ \`\`\`bash
600
+ mvn clean package
601
+ \`\`\`
602
+
603
+ ## Run
604
+
605
+ \`\`\`bash
606
+ mvn spring-boot:run
607
+ \`\`\`
608
+
609
+ ## Endpoints
610
+
611
+ - \`GET /service/info\` - Service information
612
+ - \`GET /service/health\` - Health check
613
+ - \`GET /service/ready\` - Readiness check
614
+ - \`GET /actuator/health\` - Actuator health
615
+ `,
616
+ },
617
+ {
618
+ path: ".gitignore",
619
+ content: `# Maven
620
+ target/
621
+ pom.xml.tag
622
+ pom.xml.releaseBackup
623
+ pom.xml.versionsBackup
624
+ pom.xml.next
625
+ release.properties
626
+ dependency-reduced-pom.xml
627
+ buildNumber.properties
628
+ .mvn/timing.properties
629
+ .mvn/wrapper/maven-wrapper.jar
630
+
631
+ # IDE
632
+ .idea/
633
+ *.iml
634
+ *.iws
635
+ *.ipr
636
+ .vscode/
637
+ *.swp
638
+ *.swo
639
+
640
+ # OS
641
+ .DS_Store
642
+ Thumbs.db
643
+
644
+ # Logs
645
+ *.log
646
+ `,
647
+ },
648
+ ],
649
+ },
650
+ };
651
+ //# sourceMappingURL=spring-boot.js.map
package/dist/types.js ADDED
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
package/package.json ADDED
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "start-it-cli",
3
+ "version": "1.0.0",
4
+ "description": "A prompt-based CLI tool to scaffold projects for Go, Flutter, React Native, Spring Boot, and more",
5
+ "main": "dist/index.js",
6
+ "bin": {
7
+ "start-it": "dist/cli.js"
8
+ },
9
+ "scripts": {
10
+ "build": "tsc",
11
+ "dev": "ts-node src/cli.ts",
12
+ "start": "node dist/cli.js",
13
+ "test": "jest",
14
+ "prepublishOnly": "npm run build"
15
+ },
16
+ "keywords": [
17
+ "cli",
18
+ "scaffold",
19
+ "project-generator",
20
+ "go",
21
+ "flutter",
22
+ "react-native",
23
+ "spring-boot"
24
+ ],
25
+ "author": "",
26
+ "license": "MIT",
27
+ "dependencies": {
28
+ "chalk": "^4.1.2",
29
+ "inquirer": "^8.2.5",
30
+ "fs-extra": "^11.1.1",
31
+ "ora": "^5.4.1"
32
+ },
33
+ "devDependencies": {
34
+ "@types/node": "^20.10.0",
35
+ "@types/inquirer": "^8.2.5",
36
+ "@types/fs-extra": "^11.0.4",
37
+ "typescript": "^5.3.3",
38
+ "ts-node": "^10.9.2",
39
+ "@types/jest": "^29.5.8",
40
+ "jest": "^29.7.0",
41
+ "ts-jest": "^29.1.1"
42
+ },
43
+ "engines": {
44
+ "node": ">=14.0.0"
45
+ },
46
+ "publishConfig": {
47
+ "access": "public"
48
+ }
49
+ }