nebula-starter-kit 0.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.
- package/README.md +107 -0
- package/dist/index.js +8 -0
- package/dist/run.js +112 -0
- package/dist/utils/addService.js +204 -0
- package/dist/utils/appName.js +75 -0
- package/dist/utils/deployNow.js +18 -0
- package/dist/utils/generateFiles.js +326 -0
- package/dist/utils/generateSchemas.js +58 -0
- package/dist/utils/listServices.js +24 -0
- package/dist/utils/replaceServiceNames.js +42 -0
- package/dist/utils/telemetryAddon.js +91 -0
- package/package.json +31 -0
- package/templates/core/audit/audit.controller.ts +125 -0
- package/templates/core/audit/audit.module.ts +10 -0
- package/templates/core/audit/audit.schema.ts +14 -0
- package/templates/core/audit/audit.service.ts +47 -0
- package/templates/core/auth/auth.controller.ts +207 -0
- package/templates/core/auth/auth.dto.ts +50 -0
- package/templates/core/auth/auth.module.ts +10 -0
- package/templates/core/auth/auth.service.ts +178 -0
- package/templates/core/auth/utils.ts +160 -0
- package/templates/core/constants/environment.db.ts +27 -0
- package/templates/core/constants/environment.module.ts +9 -0
- package/templates/core/constants/environment.service.ts +69 -0
- package/templates/core/core.controller.ts +35 -0
- package/templates/core/core.module.ts +22 -0
- package/templates/core/database/database.module.ts +20 -0
- package/templates/core/database/database.provider.ts +32 -0
- package/templates/core/database/database.service.ts +168 -0
- package/templates/core/database/database.types.ts +13 -0
- package/templates/core/filters/audit.decorator.ts +5 -0
- package/templates/core/filters/audit.interceptor.ts +74 -0
- package/templates/core/filters/http-exception.filter.ts +43 -0
- package/templates/core/filters/success-message.decorator.ts +5 -0
- package/templates/core/filters/success-response.interceptor.ts +35 -0
- package/templates/core/summarize/summarize.controller.ts +74 -0
- package/templates/core/summarize/summarize.dto.ts +13 -0
- package/templates/core/summarize/summarize.module.ts +9 -0
- package/templates/core/summarize/summarize.service.ts +54 -0
- package/templates/nest-cli.json +8 -0
- package/templates/package.json +52 -0
- package/templates/service/src/__name__.controller.ts +15 -0
- package/templates/service/src/__name__.module.ts +11 -0
- package/templates/service/src/__name__.schema.ts +15 -0
- package/templates/service/src/__name__.service.ts +12 -0
- package/templates/service/src/lambda.ts +60 -0
- package/templates/tsconfig.json +28 -0
- package/templates/ui/README.md +36 -0
- package/templates/ui/eslint.config.mjs +18 -0
- package/templates/ui/next.config.ts +8 -0
- package/templates/ui/package.json +33 -0
- package/templates/ui/postcss.config.mjs +7 -0
- package/templates/ui/public/file.svg +1 -0
- package/templates/ui/public/globe.svg +1 -0
- package/templates/ui/public/next.svg +1 -0
- package/templates/ui/public/vercel.svg +1 -0
- package/templates/ui/public/window.svg +1 -0
- package/templates/ui/src/app/LandingPage.tsx +98 -0
- package/templates/ui/src/app/ai/summarize/page.tsx +115 -0
- package/templates/ui/src/app/context/AuthContext.tsx +48 -0
- package/templates/ui/src/app/favicon.ico +0 -0
- package/templates/ui/src/app/globals.css +26 -0
- package/templates/ui/src/app/layout.tsx +37 -0
- package/templates/ui/src/app/page.tsx +7 -0
- package/templates/ui/src/app/services/page.tsx +99 -0
- package/templates/ui/src/components/Auth.css +252 -0
- package/templates/ui/src/components/Auth.tsx +455 -0
- package/templates/ui/src/components/Error.tsx +32 -0
- package/templates/ui/src/components/FormInput.tsx +77 -0
- package/templates/ui/src/components/Loading.tsx +10 -0
- package/templates/ui/src/components/Login.tsx +171 -0
- package/templates/ui/src/components/Popup.css +90 -0
- package/templates/ui/src/components/Signup.tsx +155 -0
- package/templates/ui/src/utils/axiosInstance.ts +37 -0
- package/templates/ui/src/utils/axiosRawInstance.ts +33 -0
- package/templates/ui/src/utils/util.constant.ts +0 -0
- package/templates/ui/src/utils/util.function.ts +165 -0
- package/templates/ui/src/utils/util.type.ts +64 -0
- package/templates/ui/src/utils/variables.ts +6 -0
- package/templates/ui/tailwind.config.js +8 -0
- package/templates/ui/tsconfig.json +43 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
@import "tailwindcss";
|
|
2
|
+
|
|
3
|
+
:root {
|
|
4
|
+
--background: #ffffff;
|
|
5
|
+
--foreground: #171717;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
@theme inline {
|
|
9
|
+
--color-background: var(--background);
|
|
10
|
+
--color-foreground: var(--foreground);
|
|
11
|
+
--font-sans: var(--font-geist-sans);
|
|
12
|
+
--font-mono: var(--font-geist-mono);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@media (prefers-color-scheme: dark) {
|
|
16
|
+
:root {
|
|
17
|
+
--background: #0a0a0a;
|
|
18
|
+
--foreground: #ededed;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
body {
|
|
23
|
+
background: var(--background);
|
|
24
|
+
color: var(--foreground);
|
|
25
|
+
font-family: Arial, Helvetica, sans-serif;
|
|
26
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { Metadata } from "next";
|
|
2
|
+
import { Geist, Geist_Mono } from "next/font/google";
|
|
3
|
+
import "./globals.css";
|
|
4
|
+
import { AuthProvider } from "./context/AuthContext";
|
|
5
|
+
|
|
6
|
+
const geistSans = Geist({
|
|
7
|
+
variable: "--font-geist-sans",
|
|
8
|
+
subsets: ["latin"],
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
const geistMono = Geist_Mono({
|
|
12
|
+
variable: "--font-geist-mono",
|
|
13
|
+
subsets: ["latin"],
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export const metadata: Metadata = {
|
|
17
|
+
title: "Create Next App",
|
|
18
|
+
description: "Generated by create next app",
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default function RootLayout({
|
|
22
|
+
children,
|
|
23
|
+
}: Readonly<{
|
|
24
|
+
children: React.ReactNode;
|
|
25
|
+
}>) {
|
|
26
|
+
return (
|
|
27
|
+
<html lang="en">
|
|
28
|
+
<body
|
|
29
|
+
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
|
|
30
|
+
>
|
|
31
|
+
<AuthProvider>
|
|
32
|
+
{children}
|
|
33
|
+
</AuthProvider>
|
|
34
|
+
</body>
|
|
35
|
+
</html>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useEffect, useState } from 'react';
|
|
4
|
+
import { useRouter } from 'next/navigation';
|
|
5
|
+
import { AxiosResponse } from 'axios';
|
|
6
|
+
import axiosInstance from '@/utils/axiosInstance';
|
|
7
|
+
import { useAuth } from '../context/AuthContext';
|
|
8
|
+
import { FaSignOutAlt } from 'react-icons/fa';
|
|
9
|
+
|
|
10
|
+
export default function ServicesPage() {
|
|
11
|
+
const [services, setServices] = useState<any[]>([]);
|
|
12
|
+
const [errors, setErrors] = useState({});
|
|
13
|
+
const [loading, setLoading] = useState<boolean>(true);
|
|
14
|
+
|
|
15
|
+
const { login, isLoggedIn, logout } = useAuth();
|
|
16
|
+
const router = useRouter()
|
|
17
|
+
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
async function fetchServices(page: number = 1) {
|
|
20
|
+
try {
|
|
21
|
+
setErrors({});
|
|
22
|
+
console.log('Fetching services for page:', page);
|
|
23
|
+
// setLoading(true);
|
|
24
|
+
const res: AxiosResponse = await axiosInstance.get(
|
|
25
|
+
`/`,
|
|
26
|
+
{
|
|
27
|
+
headers: {
|
|
28
|
+
'Content-Type': 'application/json',
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
);
|
|
32
|
+
console.log('Fetched services:', res.data?.services);
|
|
33
|
+
setServices(res.data?.services.map((service: any) => ({
|
|
34
|
+
name: service,
|
|
35
|
+
slug: service,
|
|
36
|
+
description: `Manage your ${service}`
|
|
37
|
+
})));
|
|
38
|
+
} catch (err: any) {
|
|
39
|
+
setLoading(false);
|
|
40
|
+
setErrors((prev) => ({
|
|
41
|
+
...prev,
|
|
42
|
+
fetchServicesError: err.message,
|
|
43
|
+
}));
|
|
44
|
+
console.error(err.message);
|
|
45
|
+
} finally {
|
|
46
|
+
setLoading(false);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
fetchServices()
|
|
50
|
+
}, []);
|
|
51
|
+
|
|
52
|
+
if (!isLoggedIn){
|
|
53
|
+
router.push('/')
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<div className="min-h-screen bg-gray-50 p-10">
|
|
58
|
+
<div className="">
|
|
59
|
+
{isLoggedIn && (
|
|
60
|
+
<>
|
|
61
|
+
<span className="cursor-pointer mr-4 absolute right-8 top-8">
|
|
62
|
+
<FaSignOutAlt
|
|
63
|
+
color="#e83245"
|
|
64
|
+
onClick={() => {
|
|
65
|
+
logout();
|
|
66
|
+
}}
|
|
67
|
+
/>
|
|
68
|
+
</span>
|
|
69
|
+
</>
|
|
70
|
+
)}
|
|
71
|
+
</div>
|
|
72
|
+
<h1 className="text-3xl font-bold mb-8">Services</h1>
|
|
73
|
+
|
|
74
|
+
<div className="grid md:grid-cols-2 lg:grid-cols-3 gap-6">
|
|
75
|
+
{services.map((service) => (
|
|
76
|
+
<div
|
|
77
|
+
key={service.slug}
|
|
78
|
+
className="bg-white p-6 rounded-xl shadow hover:shadow-lg transition"
|
|
79
|
+
>
|
|
80
|
+
<h2 className="text-xl font-semibold mb-2">
|
|
81
|
+
{service.name}
|
|
82
|
+
</h2>
|
|
83
|
+
|
|
84
|
+
<p className="text-gray-500 mb-4">
|
|
85
|
+
{service.description}
|
|
86
|
+
</p>
|
|
87
|
+
|
|
88
|
+
<button
|
|
89
|
+
onClick={() => router.push(`/services/${service.slug}`)}
|
|
90
|
+
className="bg-blue-600 text-white px-4 py-2 rounded-lg cursor-pointer"
|
|
91
|
+
>
|
|
92
|
+
Open
|
|
93
|
+
</button>
|
|
94
|
+
</div>
|
|
95
|
+
))}
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
);
|
|
99
|
+
}
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
.container {
|
|
2
|
+
width: 100%;
|
|
3
|
+
margin: 0.2rem auto;
|
|
4
|
+
max-width: 400px;
|
|
5
|
+
min-width: 300px;
|
|
6
|
+
min-height: 10rem;
|
|
7
|
+
padding: 0.5rem;
|
|
8
|
+
background: #fff;
|
|
9
|
+
border-radius: 12px;
|
|
10
|
+
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.form-group {
|
|
14
|
+
margin-bottom: 0.3rem;
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
input {
|
|
20
|
+
padding: 0.65rem;
|
|
21
|
+
border: none;
|
|
22
|
+
outline: none;
|
|
23
|
+
font-size: 1rem;
|
|
24
|
+
width: 100%;
|
|
25
|
+
background: transparent;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.input-wrapper {
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
border: 1px solid #ccc;
|
|
32
|
+
border-radius: 8px;
|
|
33
|
+
padding: 0rem;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
input:-webkit-autofill,
|
|
37
|
+
input:-webkit-autofill:hover,
|
|
38
|
+
input:-webkit-autofill:focus {
|
|
39
|
+
-webkit-box-shadow: 0 0 0 1000px white inset !important;
|
|
40
|
+
box-shadow: 0 0 0 1000px white inset !important;
|
|
41
|
+
-webkit-text-fill-color: #000;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
input:focus {
|
|
45
|
+
outline: none;
|
|
46
|
+
background-color: transparent;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/* button {
|
|
50
|
+
outline: none;
|
|
51
|
+
border: none;
|
|
52
|
+
background: transparent;
|
|
53
|
+
cursor: pointer; */
|
|
54
|
+
/* } */
|
|
55
|
+
|
|
56
|
+
.submit-btn {
|
|
57
|
+
background-color: #5b1de1;
|
|
58
|
+
color: #fff;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.click-link {
|
|
62
|
+
cursor: pointer;
|
|
63
|
+
color: #5b1de1;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.error-input {
|
|
67
|
+
border-color: #e63946;
|
|
68
|
+
background: #ffe6e6;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.transparent {
|
|
72
|
+
background: transparent;
|
|
73
|
+
color: transparent;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.error {
|
|
77
|
+
color: #e63946;
|
|
78
|
+
font-size: 0.875rem;
|
|
79
|
+
margin-top: 0.25rem;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.title {
|
|
83
|
+
text-align: center;
|
|
84
|
+
font-size: 1.5rem;
|
|
85
|
+
font-weight: bold;
|
|
86
|
+
margin-bottom: 1rem;
|
|
87
|
+
color: #333;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.header,
|
|
91
|
+
.scoreItem {
|
|
92
|
+
display: flex;
|
|
93
|
+
justify-content: space-between;
|
|
94
|
+
padding: 1rem 1rem;
|
|
95
|
+
font-size: 1rem;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.header {
|
|
99
|
+
background: #3a6096;
|
|
100
|
+
color: #fff;
|
|
101
|
+
font-weight: 600;
|
|
102
|
+
border-radius: 12px 12px 0 0;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.scoreItem {
|
|
106
|
+
background: #f3f4f6;
|
|
107
|
+
border-bottom: 1px solid #e5e7eb;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.scoreItem:hover {
|
|
111
|
+
background: #e5e7eb;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.user {
|
|
115
|
+
font-weight: 500;
|
|
116
|
+
color: #444;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.points {
|
|
120
|
+
font-weight: bold;
|
|
121
|
+
color: #2563eb;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.spinner {
|
|
125
|
+
border: 4px solid #f3f3f3;
|
|
126
|
+
border-top: 4px solid #2563eb;
|
|
127
|
+
border-radius: 50%;
|
|
128
|
+
width: 40px;
|
|
129
|
+
height: 40px;
|
|
130
|
+
animation: spin 1s linear infinite;
|
|
131
|
+
margin: 2rem auto;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.toggleBtn {
|
|
135
|
+
background: #054f80;
|
|
136
|
+
color: white;
|
|
137
|
+
cursor: pointer;
|
|
138
|
+
margin-bottom: 5px;
|
|
139
|
+
margin-right: 5px;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.toggleBtn:hover {
|
|
143
|
+
background: #078ce4;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.submit {
|
|
147
|
+
background: #180eaa;
|
|
148
|
+
color: white;
|
|
149
|
+
margin-bottom: 5px;
|
|
150
|
+
margin-right: 5px;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.submit:hover {
|
|
154
|
+
background: #1507e0;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.signout {
|
|
158
|
+
background: #e83245;
|
|
159
|
+
color: white;
|
|
160
|
+
margin-bottom: 5px;
|
|
161
|
+
margin-right: 5px;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.signout:hover {
|
|
165
|
+
background: #ee415e;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.pagination {
|
|
169
|
+
display: flex;
|
|
170
|
+
justify-content: center;
|
|
171
|
+
align-items: center;
|
|
172
|
+
gap: 0.75rem;
|
|
173
|
+
margin-top: 1.5rem;
|
|
174
|
+
flex-wrap: wrap; /* helps on mobile */
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.page-btn {
|
|
178
|
+
background: #007bff;
|
|
179
|
+
color: #fff;
|
|
180
|
+
border: none;
|
|
181
|
+
padding: 0.5rem 1rem;
|
|
182
|
+
border-radius: 6px;
|
|
183
|
+
font-size: 0.9rem;
|
|
184
|
+
cursor: pointer;
|
|
185
|
+
transition:
|
|
186
|
+
background 0.2s ease-in-out,
|
|
187
|
+
transform 0.1s;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.page-btn:hover:not(:disabled) {
|
|
191
|
+
background: #0056b3;
|
|
192
|
+
transform: translateY(-2px);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.page-btn:disabled {
|
|
196
|
+
background: #ddd;
|
|
197
|
+
color: #666;
|
|
198
|
+
cursor: not-allowed;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.page-info {
|
|
202
|
+
font-size: 0.95rem;
|
|
203
|
+
font-weight: 500;
|
|
204
|
+
color: #333;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.page-btn.first,
|
|
208
|
+
.page-btn.last {
|
|
209
|
+
display: inline-flex;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.centered {
|
|
213
|
+
text-align: center;
|
|
214
|
+
}
|
|
215
|
+
/* Hide first & last buttons on small screens */
|
|
216
|
+
@media (max-width: 500px) {
|
|
217
|
+
.container {
|
|
218
|
+
width: 100%;
|
|
219
|
+
min-width: unset;
|
|
220
|
+
margin: 1rem auto;
|
|
221
|
+
padding: 0 1rem;
|
|
222
|
+
}
|
|
223
|
+
.mobile-hide,
|
|
224
|
+
.page-btn.last {
|
|
225
|
+
display: none;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
@keyframes spin {
|
|
230
|
+
0% {
|
|
231
|
+
transform: rotate(0deg);
|
|
232
|
+
}
|
|
233
|
+
100% {
|
|
234
|
+
transform: rotate(360deg);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
@media (min-width: 768px) {
|
|
239
|
+
.container {
|
|
240
|
+
max-width: 800px;
|
|
241
|
+
margin: 2rem auto;
|
|
242
|
+
}
|
|
243
|
+
.title {
|
|
244
|
+
font-size: 2.5rem;
|
|
245
|
+
}
|
|
246
|
+
.header,
|
|
247
|
+
.scoreItem {
|
|
248
|
+
text-align: center;
|
|
249
|
+
font-size: 1rem;
|
|
250
|
+
padding: 1rem 1rem;
|
|
251
|
+
}
|
|
252
|
+
}
|