nodejs-quickstart-structure 2.0.1 → 2.1.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 (165) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +64 -66
  3. package/bin/index.js +5 -2
  4. package/lib/generator.js +10 -4
  5. package/lib/modules/app-setup.js +76 -6
  6. package/lib/modules/auth-setup.js +143 -0
  7. package/lib/modules/caching-setup.js +8 -1
  8. package/lib/modules/config-files.js +6 -0
  9. package/lib/modules/database-setup.js +2 -1
  10. package/lib/modules/project-setup.js +1 -0
  11. package/lib/prompts.js +39 -0
  12. package/package.json +5 -4
  13. package/templates/clean-architecture/js/src/domain/models/User.js +3 -1
  14. package/templates/clean-architecture/js/src/index.js.ejs +2 -0
  15. package/templates/clean-architecture/js/src/infrastructure/config/env.js.ejs +12 -3
  16. package/templates/clean-architecture/js/src/infrastructure/repositories/UserRepository.js.ejs +25 -2
  17. package/templates/clean-architecture/js/src/infrastructure/repositories/UserRepository.spec.js.ejs +38 -1
  18. package/templates/clean-architecture/js/src/infrastructure/webserver/server.js.ejs +3 -0
  19. package/templates/clean-architecture/js/src/infrastructure/webserver/server.spec.js.ejs +51 -0
  20. package/templates/clean-architecture/js/src/infrastructure/webserver/swagger.spec.js.ejs +14 -0
  21. package/templates/clean-architecture/js/src/interfaces/controllers/userController.js.ejs +41 -4
  22. package/templates/clean-architecture/js/src/interfaces/controllers/userController.spec.js.ejs +70 -5
  23. package/templates/clean-architecture/js/src/interfaces/graphql/context.js.ejs +13 -6
  24. package/templates/clean-architecture/js/src/interfaces/graphql/context.spec.js.ejs +55 -22
  25. package/templates/clean-architecture/js/src/interfaces/graphql/resolvers/user.resolvers.js.ejs +10 -5
  26. package/templates/clean-architecture/js/src/interfaces/graphql/resolvers/user.resolvers.spec.js.ejs +32 -10
  27. package/templates/clean-architecture/js/src/interfaces/graphql/typeDefs/user.types.js.ejs +1 -1
  28. package/templates/clean-architecture/js/src/interfaces/routes/api.js.ejs +15 -0
  29. package/templates/clean-architecture/js/src/interfaces/routes/api.spec.js.ejs +4 -0
  30. package/templates/clean-architecture/js/src/usecases/CreateUser.js.ejs +34 -0
  31. package/templates/clean-architecture/js/src/usecases/CreateUser.spec.js.ejs +12 -3
  32. package/templates/clean-architecture/js/src/usecases/DeleteUser.js.ejs +27 -0
  33. package/templates/clean-architecture/js/src/usecases/DeleteUser.spec.js.ejs +9 -1
  34. package/templates/clean-architecture/js/src/usecases/GetAllUsers.js.ejs +36 -0
  35. package/templates/clean-architecture/js/src/usecases/GetAllUsers.spec.js.ejs +23 -1
  36. package/templates/clean-architecture/js/src/usecases/GetUserById.js.ejs +36 -0
  37. package/templates/clean-architecture/js/src/usecases/GetUserById.spec.js.ejs +48 -0
  38. package/templates/clean-architecture/js/src/usecases/UpdateUser.js.ejs +28 -0
  39. package/templates/clean-architecture/js/src/usecases/UpdateUser.spec.js.ejs +9 -1
  40. package/templates/clean-architecture/js/src/utils/errorMessages.js +1 -0
  41. package/templates/clean-architecture/js/src/utils/httpCodes.js +2 -0
  42. package/templates/clean-architecture/ts/src/config/env.ts.ejs +12 -3
  43. package/templates/clean-architecture/ts/src/domain/user.ts +3 -1
  44. package/templates/clean-architecture/ts/src/index.ts.ejs +4 -0
  45. package/templates/clean-architecture/ts/src/infrastructure/repositories/UserRepository.spec.ts.ejs +71 -10
  46. package/templates/clean-architecture/ts/src/infrastructure/repositories/userRepository.ts.ejs +32 -3
  47. package/templates/clean-architecture/ts/src/interfaces/controllers/userController.spec.ts.ejs +43 -9
  48. package/templates/clean-architecture/ts/src/interfaces/controllers/userController.ts.ejs +57 -15
  49. package/templates/clean-architecture/ts/src/interfaces/graphql/context.spec.ts.ejs +57 -24
  50. package/templates/clean-architecture/ts/src/interfaces/graphql/context.ts.ejs +14 -8
  51. package/templates/clean-architecture/ts/src/interfaces/graphql/resolvers/user.resolvers.spec.ts.ejs +33 -10
  52. package/templates/clean-architecture/ts/src/interfaces/graphql/resolvers/user.resolvers.ts.ejs +15 -5
  53. package/templates/clean-architecture/ts/src/interfaces/graphql/typeDefs/user.types.ts.ejs +1 -1
  54. package/templates/clean-architecture/ts/src/interfaces/routes/userRoutes.spec.ts.ejs +9 -1
  55. package/templates/clean-architecture/ts/src/interfaces/routes/userRoutes.ts.ejs +16 -0
  56. package/templates/clean-architecture/ts/src/usecases/createUser.spec.ts.ejs +12 -3
  57. package/templates/clean-architecture/ts/src/usecases/createUser.ts.ejs +35 -0
  58. package/templates/clean-architecture/ts/src/usecases/deleteUser.spec.ts.ejs +10 -1
  59. package/templates/clean-architecture/ts/src/usecases/deleteUser.ts.ejs +24 -0
  60. package/templates/clean-architecture/ts/src/usecases/getAllUsers.spec.ts.ejs +9 -1
  61. package/templates/clean-architecture/ts/src/usecases/getAllUsers.ts.ejs +21 -0
  62. package/templates/clean-architecture/ts/src/usecases/getUserById.spec.ts.ejs +55 -0
  63. package/templates/clean-architecture/ts/src/usecases/getUserById.ts.ejs +23 -0
  64. package/templates/clean-architecture/ts/src/usecases/updateUser.spec.ts.ejs +10 -1
  65. package/templates/clean-architecture/ts/src/usecases/updateUser.ts.ejs +25 -0
  66. package/templates/clean-architecture/ts/src/utils/errorMessages.ts +1 -0
  67. package/templates/clean-architecture/ts/src/utils/httpCodes.ts +1 -0
  68. package/templates/common/.cursorrules.ejs +9 -0
  69. package/templates/common/.env.example.ejs +17 -10
  70. package/templates/common/README.md.ejs +63 -18
  71. package/templates/common/auth/js/controllers/authController.js.ejs +170 -0
  72. package/templates/common/auth/js/controllers/authController.spec.js.ejs +148 -0
  73. package/templates/common/auth/js/middleware/authMiddleware.js.ejs +58 -0
  74. package/templates/common/auth/js/middleware/authMiddleware.spec.js.ejs +108 -0
  75. package/templates/common/auth/js/routes/authRoutes.js.ejs +16 -0
  76. package/templates/common/auth/js/services/jwtService.js.ejs +54 -0
  77. package/templates/common/auth/js/services/jwtService.spec.js.ejs +84 -0
  78. package/templates/common/auth/ts/controllers/authController.spec.ts.ejs +161 -0
  79. package/templates/common/auth/ts/controllers/authController.ts.ejs +167 -0
  80. package/templates/common/auth/ts/middleware/authMiddleware.spec.ts.ejs +128 -0
  81. package/templates/common/auth/ts/middleware/authMiddleware.ts.ejs +59 -0
  82. package/templates/common/auth/ts/routes/authRoutes.ts.ejs +20 -0
  83. package/templates/common/auth/ts/services/jwtService.spec.ts.ejs +89 -0
  84. package/templates/common/auth/ts/services/jwtService.ts.ejs +60 -0
  85. package/templates/common/babel.config.js.ejs +5 -0
  86. package/templates/common/caching/clean/js/CreateUser.js.ejs +14 -5
  87. package/templates/common/caching/clean/js/DeleteUser.js.ejs +2 -1
  88. package/templates/common/caching/clean/js/GetUserById.js.ejs +39 -0
  89. package/templates/common/caching/clean/js/UpdateUser.js.ejs +2 -1
  90. package/templates/common/caching/clean/ts/createUser.ts.ejs +14 -6
  91. package/templates/common/caching/clean/ts/deleteUser.ts.ejs +2 -1
  92. package/templates/common/caching/clean/ts/getUserById.ts.ejs +32 -0
  93. package/templates/common/caching/clean/ts/updateUser.ts.ejs +2 -1
  94. package/templates/common/caching/js/memoryCache.spec.js.ejs +2 -0
  95. package/templates/common/caching/js/redisClient.spec.js.ejs +2 -0
  96. package/templates/common/caching/ts/memoryCache.spec.ts.ejs +2 -0
  97. package/templates/common/caching/ts/redisClient.spec.ts.ejs +2 -0
  98. package/templates/common/database/js/models/User.js.ejs +14 -1
  99. package/templates/common/database/js/models/User.js.mongoose.ejs +7 -0
  100. package/templates/common/database/js/models/User.spec.js.ejs +12 -0
  101. package/templates/common/database/js/mongoose.spec.js.ejs +2 -0
  102. package/templates/common/database/ts/models/User.spec.ts.ejs +10 -0
  103. package/templates/common/database/ts/models/User.ts.ejs +17 -0
  104. package/templates/common/database/ts/models/User.ts.mongoose.ejs +8 -0
  105. package/templates/common/database/ts/mongoose.spec.ts.ejs +2 -0
  106. package/templates/common/docker-compose.yml.ejs +12 -0
  107. package/templates/common/ecosystem.config.js.ejs +9 -3
  108. package/templates/common/eslint.config.mjs.ejs +3 -0
  109. package/templates/common/jest.config.js.ejs +13 -9
  110. package/templates/common/kafka/js/messaging/baseConsumer.js.ejs +1 -1
  111. package/templates/common/kafka/js/services/kafkaService.js.ejs +1 -1
  112. package/templates/common/migrations/init.js.ejs +5 -4
  113. package/templates/common/package.json.ejs +11 -2
  114. package/templates/common/prompts/project-context.md.ejs +8 -1
  115. package/templates/common/src/tests/e2e/e2e.users.test.js.ejs +149 -107
  116. package/templates/common/src/tests/e2e/e2e.users.test.ts.ejs +88 -47
  117. package/templates/common/swagger.yml.ejs +148 -0
  118. package/templates/common/tsconfig.eslint.json +15 -0
  119. package/templates/common/tsconfig.json +3 -1
  120. package/templates/common/views/ejs/index.ejs +264 -30
  121. package/templates/common/views/ejs/login.ejs.ejs +244 -0
  122. package/templates/common/views/ejs/signup.ejs.ejs +282 -0
  123. package/templates/common/views/pug/index.pug +269 -38
  124. package/templates/common/views/pug/login.pug.ejs +195 -0
  125. package/templates/common/views/pug/signup.pug.ejs +241 -0
  126. package/templates/db/mysql/V1__Initial_Setup.sql.ejs +6 -0
  127. package/templates/db/postgres/V1__Initial_Setup.sql.ejs +6 -0
  128. package/templates/mvc/js/src/config/env.js.ejs +12 -3
  129. package/templates/mvc/js/src/controllers/userController.js.ejs +29 -5
  130. package/templates/mvc/js/src/controllers/userController.spec.js.ejs +27 -12
  131. package/templates/mvc/js/src/graphql/context.js.ejs +14 -3
  132. package/templates/mvc/js/src/graphql/context.spec.js.ejs +36 -21
  133. package/templates/mvc/js/src/graphql/resolvers/user.resolvers.js.ejs +10 -5
  134. package/templates/mvc/js/src/graphql/resolvers/user.resolvers.spec.js.ejs +32 -10
  135. package/templates/mvc/js/src/graphql/typeDefs/user.types.js.ejs +1 -1
  136. package/templates/mvc/js/src/index.js.ejs +16 -3
  137. package/templates/mvc/js/src/routes/api.js.ejs +14 -0
  138. package/templates/mvc/js/src/routes/api.spec.js.ejs +3 -0
  139. package/templates/mvc/js/src/utils/errorMessages.js +1 -0
  140. package/templates/mvc/js/src/utils/httpCodes.js +1 -0
  141. package/templates/mvc/ts/src/config/env.ts.ejs +12 -3
  142. package/templates/mvc/ts/src/controllers/userController.spec.ts.ejs +95 -7
  143. package/templates/mvc/ts/src/controllers/userController.ts.ejs +68 -11
  144. package/templates/mvc/ts/src/graphql/context.spec.ts.ejs +36 -23
  145. package/templates/mvc/ts/src/graphql/context.ts.ejs +15 -6
  146. package/templates/mvc/ts/src/graphql/resolvers/user.resolvers.spec.ts.ejs +32 -10
  147. package/templates/mvc/ts/src/graphql/resolvers/user.resolvers.ts.ejs +15 -5
  148. package/templates/mvc/ts/src/graphql/typeDefs/user.types.ts.ejs +1 -1
  149. package/templates/mvc/ts/src/index.ts.ejs +15 -3
  150. package/templates/mvc/ts/src/routes/api.spec.ts.ejs +6 -0
  151. package/templates/mvc/ts/src/routes/api.ts.ejs +15 -0
  152. package/templates/mvc/ts/src/utils/errorMessages.ts +1 -0
  153. package/templates/mvc/ts/src/utils/httpCodes.ts +1 -0
  154. package/templates/clean-architecture/js/src/interfaces/routes/api.js +0 -12
  155. package/templates/clean-architecture/js/src/usecases/CreateUser.js +0 -14
  156. package/templates/clean-architecture/js/src/usecases/DeleteUser.js +0 -11
  157. package/templates/clean-architecture/js/src/usecases/GetAllUsers.js +0 -12
  158. package/templates/clean-architecture/js/src/usecases/UpdateUser.js +0 -11
  159. package/templates/clean-architecture/ts/src/interfaces/routes/userRoutes.ts +0 -13
  160. package/templates/clean-architecture/ts/src/usecases/createUser.ts +0 -13
  161. package/templates/clean-architecture/ts/src/usecases/deleteUser.ts +0 -9
  162. package/templates/clean-architecture/ts/src/usecases/getAllUsers.ts +0 -10
  163. package/templates/clean-architecture/ts/src/usecases/updateUser.ts +0 -9
  164. package/templates/mvc/js/src/routes/api.js +0 -10
  165. package/templates/mvc/ts/src/routes/api.ts +0 -12
@@ -7,12 +7,20 @@ servers:
7
7
  - url: http://localhost:3000
8
8
  description: Local Server
9
9
  components:
10
+ <%_ if (auth.includes('JWT')) { -%>
11
+ securitySchemes:
12
+ bearerAuth:
13
+ type: http
14
+ scheme: bearer
15
+ bearerFormat: JWT
16
+ <%_ } -%>
10
17
  schemas:
11
18
  User:
12
19
  type: object
13
20
  required:
14
21
  - name
15
22
  - email
23
+ <% if (auth.includes('JWT')) { %>- password<% } %>
16
24
  properties:
17
25
  id:
18
26
  type: integer
@@ -23,6 +31,12 @@ components:
23
31
  email:
24
32
  type: string
25
33
  description: The email of the user
34
+ <% if (auth.includes('JWT')) { %>
35
+ password:
36
+ type: string
37
+ writeOnly: true
38
+ description: The password of the user
39
+ <% } %>
26
40
  example:
27
41
  id: 1
28
42
  name: John Doe
@@ -30,7 +44,103 @@ components:
30
44
  tags:
31
45
  - name: Users
32
46
  description: The users managing API
47
+ <%_ if (auth.includes('JWT')) { -%>
48
+ - name: Auth
49
+ description: Authentication API
50
+ <%_ } -%>
33
51
  paths:
52
+ <%_ if (auth.includes('JWT')) { -%>
53
+ /api/auth/login:
54
+ post:
55
+ summary: Login and receive a JWT token
56
+ tags:
57
+ - Auth
58
+ requestBody:
59
+ required: true
60
+ content:
61
+ application/json:
62
+ schema:
63
+ type: object
64
+ required:
65
+ - email
66
+ - password
67
+ properties:
68
+ email:
69
+ type: string
70
+ password:
71
+ type: string
72
+ responses:
73
+ '200':
74
+ description: Login successful
75
+ content:
76
+ application/json:
77
+ schema:
78
+ type: object
79
+ properties:
80
+ token:
81
+ type: string
82
+ accessToken:
83
+ type: string
84
+ refreshToken:
85
+ type: string
86
+ '401':
87
+ description: Invalid credentials
88
+ /api/auth/refresh:
89
+ post:
90
+ summary: Refresh access token using a refresh token
91
+ tags:
92
+ - Auth
93
+ requestBody:
94
+ required: true
95
+ content:
96
+ application/json:
97
+ schema:
98
+ type: object
99
+ required:
100
+ - refreshToken
101
+ properties:
102
+ refreshToken:
103
+ type: string
104
+ responses:
105
+ '200':
106
+ description: Token refreshed successfully
107
+ content:
108
+ application/json:
109
+ schema:
110
+ type: object
111
+ properties:
112
+ accessToken:
113
+ type: string
114
+ refreshToken:
115
+ type: string
116
+ '401':
117
+ description: Invalid refresh token
118
+ /api/auth/logout:
119
+ post:
120
+ summary: Logout and revoke refresh token
121
+ tags:
122
+ - Auth
123
+ security:
124
+ - bearerAuth: []
125
+ requestBody:
126
+ content:
127
+ application/json:
128
+ schema:
129
+ type: object
130
+ properties:
131
+ refreshToken:
132
+ type: string
133
+ responses:
134
+ '200':
135
+ description: Logged out successfully
136
+ content:
137
+ application/json:
138
+ schema:
139
+ type: object
140
+ properties:
141
+ message:
142
+ type: string
143
+ <%_ } -%>
34
144
  /api/users:
35
145
  get:
36
146
  summary: Returns the list of all the users
@@ -45,6 +155,10 @@ paths:
45
155
  type: array
46
156
  items:
47
157
  $ref: '#/components/schemas/User'
158
+ <%_ if (auth.includes('JWT')) { -%>
159
+ security:
160
+ - bearerAuth: []
161
+ <%_ } -%>
48
162
  post:
49
163
  summary: Create a new user
50
164
  tags:
@@ -65,6 +179,32 @@ paths:
65
179
  '500':
66
180
  description: Some server error
67
181
  /api/users/{id}:
182
+ get:
183
+ summary: Get a user by ID
184
+ tags:
185
+ - Users
186
+ parameters:
187
+ - in: path
188
+ name: id
189
+ schema:
190
+ type: string
191
+ required: true
192
+ description: The user id
193
+ responses:
194
+ '200':
195
+ description: The user details
196
+ content:
197
+ application/json:
198
+ schema:
199
+ $ref: '#/components/schemas/User'
200
+ '404':
201
+ description: User not found
202
+ '500':
203
+ description: Some server error
204
+ <%_ if (auth.includes('JWT')) { -%>
205
+ security:
206
+ - bearerAuth: []
207
+ <%_ } -%>
68
208
  patch:
69
209
  summary: Update an existing user
70
210
  tags:
@@ -98,6 +238,10 @@ paths:
98
238
  description: User not found
99
239
  '500':
100
240
  description: Some server error
241
+ <%_ if (auth.includes('JWT')) { -%>
242
+ security:
243
+ - bearerAuth: []
244
+ <%_ } -%>
101
245
  delete:
102
246
  summary: Delete an existing user
103
247
  tags:
@@ -116,3 +260,7 @@ paths:
116
260
  description: User not found
117
261
  '500':
118
262
  description: Some server error
263
+ <%_ if (auth.includes('JWT')) { -%>
264
+ security:
265
+ - bearerAuth: []
266
+ <%_ } -%>
@@ -0,0 +1,15 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "noEmit": true,
5
+ "allowJs": true
6
+ },
7
+ "include": [
8
+ "src/**/*",
9
+ "tests/**/*",
10
+ "migrations/**/*.js",
11
+ "*.js",
12
+ "*.mjs",
13
+ "scripts/**/*.js"
14
+ ]
15
+ }
@@ -8,9 +8,11 @@
8
8
  "esModuleInterop": true,
9
9
  "skipLibCheck": true,
10
10
  "forceConsistentCasingInFileNames": true,
11
+ "allowJs": true,
11
12
  "baseUrl": ".",
12
13
  "paths": {
13
- "@/*": ["src/*"]
14
+ "@/*": ["src/*"],
15
+ "@tests/*": ["tests/*"]
14
16
  }
15
17
  },
16
18
  "include": [
@@ -4,48 +4,282 @@
4
4
  <meta charset="UTF-8">
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
6
  <title><%= projectName %></title>
7
- <link rel="stylesheet" href="/css/style.css">
7
+ <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap" rel="stylesheet">
8
+ <style>
9
+ :root {
10
+ --primary: #6366f1;
11
+ --primary-glow: rgba(99, 102, 241, 0.4);
12
+ --bg-dark: #0f172a;
13
+ --card-bg: rgba(255, 255, 255, 0.03);
14
+ --card-border: rgba(255, 255, 255, 0.08);
15
+ --text-main: #f8fafc;
16
+ --text-muted: #94a3b8;
17
+ --success: #22c55e;
18
+ }
19
+
20
+ * {
21
+ margin: 0;
22
+ padding: 0;
23
+ box-sizing: border-box;
24
+ font-family: 'Poppins', sans-serif;
25
+ }
26
+
27
+ body {
28
+ background-color: var(--bg-dark);
29
+ color: var(--text-main);
30
+ min-height: 100vh;
31
+ display: flex;
32
+ align-items: center;
33
+ justify-content: center;
34
+ overflow-x: hidden;
35
+ position: relative;
36
+ padding: 40px 20px;
37
+ }
38
+
39
+ /* Animated Background Blobs */
40
+ .background-blobs {
41
+ position: absolute;
42
+ width: 100%;
43
+ height: 100%;
44
+ z-index: -1;
45
+ filter: blur(100px);
46
+ }
47
+
48
+ .blob {
49
+ position: absolute;
50
+ width: 500px;
51
+ height: 500px;
52
+ border-radius: 50%;
53
+ opacity: 0.3;
54
+ animation: float 25s infinite alternate;
55
+ }
56
+
57
+ .blob-1 {
58
+ background: radial-gradient(circle, #6366f1 0%, transparent 70%);
59
+ top: -200px;
60
+ left: -100px;
61
+ }
62
+
63
+ .blob-2 {
64
+ background: radial-gradient(circle, #ec4899 0%, transparent 70%);
65
+ bottom: -200px;
66
+ right: -100px;
67
+ animation-delay: -5s;
68
+ }
69
+
70
+ @keyframes float {
71
+ 0% { transform: translate(0, 0) scale(1); }
72
+ 100% { transform: translate(150px, 80px) scale(1.3); }
73
+ }
74
+
75
+ .container {
76
+ width: 100%;
77
+ max-width: 1000px;
78
+ z-index: 1;
79
+ animation: fadeIn 0.8s ease-out;
80
+ }
81
+
82
+ @keyframes fadeIn {
83
+ from { opacity: 0; transform: translateY(20px); }
84
+ to { opacity: 1; transform: translateY(0); }
85
+ }
86
+
87
+ .hero-card {
88
+ background: var(--card-bg);
89
+ backdrop-filter: blur(16px);
90
+ -webkit-backdrop-filter: blur(16px);
91
+ border: 1px solid var(--card-border);
92
+ border-radius: 32px;
93
+ padding: 60px 40px;
94
+ text-align: center;
95
+ box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
96
+ margin-bottom: 40px;
97
+ }
98
+
99
+ .logo {
100
+ font-size: 64px;
101
+ margin-bottom: 24px;
102
+ display: inline-block;
103
+ animation: bounce 3s infinite ease-in-out;
104
+ }
105
+
106
+ @keyframes bounce {
107
+ 0%, 100% { transform: translateY(0); }
108
+ 50% { transform: translateY(-10px); }
109
+ }
110
+
111
+ h1 {
112
+ font-size: 48px;
113
+ font-weight: 600;
114
+ margin-bottom: 12px;
115
+ background: linear-gradient(to right, #fff, #94a3b8);
116
+ -webkit-background-clip: text;
117
+ -webkit-text-fill-color: transparent;
118
+ }
119
+
120
+ .subtitle {
121
+ font-size: 18px;
122
+ color: var(--text-muted);
123
+ margin-bottom: 40px;
124
+ max-width: 600px;
125
+ margin-left: auto;
126
+ margin-right: auto;
127
+ }
128
+
129
+ .btn-group {
130
+ display: flex;
131
+ gap: 16px;
132
+ justify-content: center;
133
+ flex-wrap: wrap;
134
+ }
135
+
136
+ .btn {
137
+ padding: 14px 28px;
138
+ border-radius: 14px;
139
+ font-size: 16px;
140
+ font-weight: 600;
141
+ text-decoration: none;
142
+ transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
143
+ display: flex;
144
+ align-items: center;
145
+ gap: 8px;
146
+ }
147
+
148
+ .btn-primary {
149
+ background: var(--primary);
150
+ color: white;
151
+ box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.3);
152
+ }
153
+
154
+ .btn-primary:hover {
155
+ transform: scale(1.05);
156
+ background: #4f46e5;
157
+ box-shadow: 0 15px 25px -5px rgba(99, 102, 241, 0.4);
158
+ }
159
+
160
+ .btn-secondary {
161
+ background: rgba(255, 255, 255, 0.05);
162
+ color: white;
163
+ border: 1px solid var(--card-border);
164
+ }
165
+
166
+ .btn-secondary:hover {
167
+ background: rgba(255, 255, 255, 0.1);
168
+ transform: scale(1.05);
169
+ }
170
+
171
+ .feature-grid {
172
+ display: grid;
173
+ grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
174
+ gap: 24px;
175
+ }
176
+
177
+ .feature-card {
178
+ background: var(--card-bg);
179
+ backdrop-filter: blur(8px);
180
+ border: 1px solid var(--card-border);
181
+ border-radius: 20px;
182
+ padding: 24px;
183
+ transition: all 0.3s ease;
184
+ }
185
+
186
+ .feature-card:hover {
187
+ transform: translateY(-5px);
188
+ background: rgba(255, 255, 255, 0.06);
189
+ border-color: var(--primary);
190
+ }
191
+
192
+ .feature-card h3 {
193
+ font-size: 14px;
194
+ text-transform: uppercase;
195
+ letter-spacing: 1px;
196
+ color: var(--text-muted);
197
+ margin-bottom: 8px;
198
+ }
199
+
200
+ .feature-card p {
201
+ font-size: 20px;
202
+ font-weight: 600;
203
+ color: #fff;
204
+ }
205
+
206
+ .status-badge {
207
+ display: inline-flex;
208
+ align-items: center;
209
+ gap: 8px;
210
+ background: rgba(34, 197, 94, 0.1);
211
+ border: 1px solid rgba(34, 197, 94, 0.2);
212
+ color: var(--success);
213
+ padding: 8px 16px;
214
+ border-radius: 99px;
215
+ font-size: 14px;
216
+ font-weight: 500;
217
+ margin-top: 32px;
218
+ }
219
+
220
+ footer {
221
+ margin-top: 60px;
222
+ text-align: center;
223
+ font-size: 14px;
224
+ color: var(--text-muted);
225
+ }
226
+
227
+ /* Responsive */
228
+ @media (max-width: 640px) {
229
+ h1 { font-size: 32px; }
230
+ .hero-card { padding: 40px 20px; }
231
+ }
232
+ </style>
8
233
  </head>
9
234
  <body>
235
+ <div class="background-blobs">
236
+ <div class="blob blob-1"></div>
237
+ <div class="blob blob-2"></div>
238
+ </div>
239
+
10
240
  <div class="container">
11
- <header class="header">
241
+ <div class="hero-card">
12
242
  <div class="logo">🚀</div>
13
243
  <h1>Welcome to <%= projectName %></h1>
14
- <p class="subtitle">A production-ready Node.js microservice starter.</p>
15
- </header>
244
+ <p class="subtitle">Your enterprise-grade Node.js microservice is live and ready for production.</p>
16
245
 
17
- <div class="card-grid">
18
- <div class="card">
19
- <h3>Architecture</h3>
20
- <p><%= architecture %></p>
21
- </div>
22
- <div class="card">
23
- <h3>Database</h3>
24
- <p><%= database %></p>
25
- </div>
26
- <div class="card">
27
- <h3>Communication</h3>
28
- <p><%= communication %></p>
246
+ <div class="btn-group">
247
+ <% if (typeof auth !== 'undefined' && auth.includes('JWT')) { %>
248
+ <a href="/login" class="btn btn-primary">Sign In</a>
249
+ <a href="/signup" class="btn btn-secondary">Create Account</a>
250
+ <% } %>
251
+ <a href="<%= communication === 'GraphQL' ? '/graphql' : '/api-docs' %>" class="btn btn-secondary">
252
+ <span>Explore Docs</span>
253
+ <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1="10" y1="14" x2="21" y2="3"></line></svg>
254
+ </a>
29
255
  </div>
256
+
257
+ <% if (communication === 'Kafka') { %>
258
+ <div class="status-badge">
259
+ <span class="dot"></span>
260
+ 🔄 Kafka Connected
261
+ </div>
262
+ <% } else { %>
263
+ <div class="status-badge">
264
+ ✅ API Service Active
265
+ </div>
266
+ <% } %>
30
267
  </div>
31
268
 
32
- <% if (communication === 'Kafka') { %>
33
- <div class="status-card">
34
- <div class="status-icon">🔄</div>
35
- <div class="status-content">
36
- <h3>Kafka Connected</h3>
37
- <p>Connection to broker established successfully.</p>
269
+ <div class="feature-grid">
270
+ <div class="feature-card">
271
+ <h3>Architecture</h3>
272
+ <p><%= architecture %></p>
38
273
  </div>
39
- </div>
40
- <% } else { %>
41
- <div class="status-card">
42
- <div class="status-icon">✅</div>
43
- <div class="status-content">
44
- <h3>API Active</h3>
45
- <p>REST API is running and ready to accept requests.</p>
274
+ <div class="feature-card">
275
+ <h3>Core Stack</h3>
276
+ <p><%= database %> & <%= communication %></p>
277
+ </div>
278
+ <div class="feature-card">
279
+ <h3>Environment</h3>
280
+ <p>Node.js & Docker Ready</p>
46
281
  </div>
47
282
  </div>
48
- <% } %>
49
283
 
50
284
  <footer>
51
285
  <p>Generated with ❤️ by Node.js Quickstart Generator</p>