Googolplexic commited on
Commit
85220b1
·
2 Parent(s): 742b39f76ac418

Merge branch 'ui'

Browse files
keygenServer/client/app/globals.css CHANGED
@@ -1,26 +1,176 @@
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
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  @import "tailwindcss";
2
 
3
  :root {
4
+ /* Sleek modern neumorphic palette */
5
+ --background: #f0f0f3;
6
+ --surface: #f8f9fa;
7
+ --foreground: #1a1a1a;
8
+ --text-muted: #6c757d;
9
+ --text-button: #2d3748;
10
+ --text-button-hover: #1a202c;
11
+
12
+ /* Refined shadow system - more subtle and realistic */
13
+ --shadow-light: #ffffff;
14
+ --shadow-dark: #d1d5db;
15
+ --shadow-darker: #c7cbcf;
16
 
17
+ /* Modern accent colors */
18
+ --primary: #475569;
19
+ --primary-dark: #334155;
20
+ --accent: #8b5cf6;
21
+ --success: #10b981;
22
+ --error: #ef4444;
23
+ --warning: #f59e0b;
24
  }
25
 
26
  @media (prefers-color-scheme: dark) {
27
  :root {
28
+ --background: #1e1e1e;
29
+ --surface: #2a2a2a;
30
+ --foreground: #ffffff;
31
+ --text-muted: #a0a0a0;
32
+ --text-button: #ffffff;
33
+ --text-button-hover: #f0f0f0;
34
+ --shadow-light: #2a2a2a;
35
+ --shadow-dark: #0a0a0a;
36
+ --shadow-darker: #000000;
37
  }
38
  }
39
 
40
  body {
41
  background: var(--background);
42
  color: var(--foreground);
43
+ font-family: var(--font-vollkorn), serif;
44
+ min-height: 100vh;
45
+ overflow-x: hidden;
46
+ /* Prevent horizontal scroll */
47
+ width: 100vw;
48
+ max-width: 100%;
49
+ }
50
+
51
+ /* Sleek Neumorphic Components - All Elements Pop Out */
52
+
53
+ /* Main container - elevated with subtle shadows */
54
+ .neuro-container {
55
+ background: var(--surface);
56
+ box-shadow:
57
+ 6px 6px 12px var(--shadow-dark),
58
+ -6px -6px 12px var(--shadow-light);
59
+ border-radius: 16px;
60
+ border: 1px solid rgba(255, 255, 255, 0.1);
61
+ width: 100%;
62
+ max-width: 100%;
63
+ box-sizing: border-box;
64
+ }
65
+
66
+ /* Cards - medium elevation, compact */
67
+ .neuro-card {
68
+ background: var(--surface);
69
+ box-shadow:
70
+ 4px 4px 8px var(--shadow-dark),
71
+ -4px -4px 8px var(--shadow-light);
72
+ border-radius: 12px;
73
+ border: 1px solid rgba(255, 255, 255, 0.05);
74
+ }
75
+
76
+ /* Primary action button - sleek and modern */
77
+ .neuro-button {
78
+ background: var(--surface);
79
+ color: var(--text-button);
80
+ box-shadow:
81
+ 3px 3px 6px var(--shadow-dark),
82
+ -3px -3px 6px var(--shadow-light);
83
+ border-radius: 10px;
84
+ border: 1px solid rgba(255, 255, 255, 0.1);
85
+ transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
86
+ display: flex;
87
+ align-items: center;
88
+ justify-content: center;
89
+ cursor: pointer;
90
  }
91
+
92
+ .neuro-button:hover {
93
+ color: var(--text-button-hover);
94
+ transform: translateY(-1px);
95
+ box-shadow:
96
+ 4px 4px 8px var(--shadow-dark),
97
+ -4px -4px 8px var(--shadow-light);
98
+ }
99
+
100
+ .neuro-button:active {
101
+ transform: translateY(0px);
102
+ box-shadow:
103
+ 2px 2px 4px var(--shadow-dark),
104
+ -2px -2px 4px var(--shadow-light);
105
+ }
106
+
107
+ /* Accent button for primary actions */
108
+ .neuro-button-primary {
109
+ background: linear-gradient(135deg, var(--primary), var(--primary-dark));
110
+ color: white;
111
+ box-shadow:
112
+ 3px 3px 6px var(--shadow-dark),
113
+ -3px -3px 6px var(--shadow-light);
114
+ border-radius: 10px;
115
+ border: none;
116
+ transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
117
+ display: flex;
118
+ align-items: center;
119
+ justify-content: center;
120
+ cursor: pointer;
121
+ }
122
+
123
+ .neuro-button-primary:hover {
124
+ transform: translateY(-1px);
125
+ box-shadow:
126
+ 4px 4px 8px var(--shadow-dark),
127
+ -4px -4px 8px var(--shadow-light);
128
+ }
129
+
130
+ .neuro-button-primary:active {
131
+ transform: translateY(0px);
132
+ box-shadow:
133
+ 2px 2px 4px var(--shadow-dark),
134
+ -2px -2px 4px var(--shadow-light);
135
+ }
136
+
137
+ /* Content display areas - minimal elevation */
138
+ .neuro-display {
139
+ background: var(--background);
140
+ box-shadow:
141
+ 2px 2px 4px var(--shadow-dark),
142
+ -2px -2px 4px var(--shadow-light);
143
+ border-radius: 8px;
144
+ border: 1px solid rgba(255, 255, 255, 0.03);
145
+ }
146
+
147
+ /* Input fields - completely flat, no shadows */
148
+ .neuro-input {
149
+ background: var(--background);
150
+ border: 1px solid var(--shadow-dark);
151
+ border-radius: 6px;
152
+ outline: none;
153
+ transition: border-color 0.15s ease;
154
+ }
155
+
156
+ .neuro-input:focus {
157
+ border-color: var(--primary);
158
+ box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
159
+ }
160
+
161
+ /* Text color utilities */
162
+ .text-primary {
163
+ color: var(--foreground);
164
+ }
165
+
166
+ .text-secondary {
167
+ color: var(--text-muted);
168
+ }
169
+
170
+ .text-button {
171
+ color: var(--text-button);
172
+ }
173
+
174
+ .text-button:hover {
175
+ color: var(--text-button-hover);
176
+ }
keygenServer/client/app/layout.tsx CHANGED
@@ -1,20 +1,16 @@
1
  import type { Metadata } from "next";
2
- import { Geist, Geist_Mono } from "next/font/google";
3
  import "./globals.css";
4
 
5
- const geistSans = Geist({
6
- variable: "--font-geist-sans",
7
- subsets: ["latin"],
8
- });
9
-
10
- const geistMono = Geist_Mono({
11
- variable: "--font-geist-mono",
12
  subsets: ["latin"],
 
13
  });
14
 
15
  export const metadata: Metadata = {
16
- title: "Create Next App",
17
- description: "Generated by create next app",
18
  };
19
 
20
  export default function RootLayout({
@@ -25,7 +21,7 @@ export default function RootLayout({
25
  return (
26
  <html lang="en">
27
  <body
28
- className={`${geistSans.variable} ${geistMono.variable} antialiased`}
29
  >
30
  {children}
31
  </body>
 
1
  import type { Metadata } from "next";
2
+ import { Vollkorn } from "next/font/google";
3
  import "./globals.css";
4
 
5
+ const vollkorn = Vollkorn({
6
+ variable: "--font-vollkorn",
 
 
 
 
 
7
  subsets: ["latin"],
8
+ weight: ["400", "500", "600", "700"],
9
  });
10
 
11
  export const metadata: Metadata = {
12
+ title: "API Key Generator",
13
+ description: "Generate and manage your API keys",
14
  };
15
 
16
  export default function RootLayout({
 
21
  return (
22
  <html lang="en">
23
  <body
24
+ className={`${vollkorn.variable} antialiased font-vollkorn`}
25
  >
26
  {children}
27
  </body>
keygenServer/client/app/main/page.tsx CHANGED
@@ -10,7 +10,6 @@ export default function MainPage() {
10
  const [apiKey, setApiKey] = useState('');
11
  const [error, setError] = useState('');
12
  const router = useRouter();
13
-
14
  useEffect(() => {
15
  const unsub = auth.onAuthStateChanged((user) => {
16
  if (!user) {
@@ -22,7 +21,7 @@ export default function MainPage() {
22
  }
23
  });
24
  return () => unsub();
25
- }, []);
26
 
27
  const generateApiKey = async () => {
28
  try {
@@ -47,40 +46,149 @@ export default function MainPage() {
47
  }
48
  };
49
 
50
- if (loading) return <p>Loading...</p>;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
 
52
  return (
53
- <main className="p-4">
54
- <h1 className="text-xl mb-4">Welcome, {userDisplayName}!</h1>
55
-
56
- <div className="space-y-4">
57
- <button
58
- onClick={generateApiKey}
59
- className="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded"
60
- >
61
- Generate API Key
62
- </button>
63
-
64
- {apiKey && (
65
- <div className="mt-4 p-4 bg-gray-100 rounded">
66
- <p className="font-semibold">Your API Key:</p>
67
- <code className="block mt-2 p-2 bg-white rounded border">{apiKey}</code>
 
 
 
68
  </div>
69
- )}
70
 
71
- {error && (
72
- <div className="mt-4 p-4 bg-red-100 text-red-700 rounded">
73
- {error}
74
- </div>
75
- )}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
 
77
- <button
78
- onClick={() => auth.signOut().then(() => router.push('/'))}
79
- className="bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded"
80
- >
81
- Logout
82
- </button>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
  </div>
84
- </main>
85
  );
86
  }
 
10
  const [apiKey, setApiKey] = useState('');
11
  const [error, setError] = useState('');
12
  const router = useRouter();
 
13
  useEffect(() => {
14
  const unsub = auth.onAuthStateChanged((user) => {
15
  if (!user) {
 
21
  }
22
  });
23
  return () => unsub();
24
+ }, [router]);
25
 
26
  const generateApiKey = async () => {
27
  try {
 
46
  }
47
  };
48
 
49
+ const copyToClipboard = async () => {
50
+ try {
51
+ await navigator.clipboard.writeText(apiKey);
52
+ const toast = document.createElement('div');
53
+ toast.textContent = 'API key copied to clipboard!';
54
+ toast.className = 'fixed top-4 right-4 neuro-card px-4 py-2 text-sm text-primary font-medium z-50 transition-opacity duration-300';
55
+ document.body.appendChild(toast);
56
+ setTimeout(() => {
57
+ toast.style.opacity = '0';
58
+ setTimeout(() => document.body.removeChild(toast), 300);
59
+ }, 2000);
60
+ } catch (err) {
61
+ console.error('Failed to copy to clipboard:', err);
62
+ }
63
+ }; if (loading) {
64
+ return (
65
+ <div className="min-h-screen flex items-center justify-center">
66
+ <div className="neuro-container p-6">
67
+ <div className="flex items-center space-x-3">
68
+ <div className="animate-spin rounded-full h-6 w-6 border-b-2 border-blue-500"></div>
69
+ <span className="text-base text-secondary">Loading...</span>
70
+ </div>
71
+ </div>
72
+ </div>
73
+ );
74
+ }
75
 
76
  return (
77
+ <div className="min-h-screen p-4 md:p-6 flex justify-center items-center">
78
+ <div className="w-full max-w-4xl py-6 ">
79
+ {/* Header */}
80
+ <div className="neuro-container p-4 md:p-6 mb-6">
81
+ <div className="flex justify-between items-center gap-4">
82
+ <div>
83
+ <h1 className="text-xl md:text-2xl font-bold text-primary mb-1">
84
+ Welcome back, {userDisplayName}!
85
+ </h1>
86
+ <p className="text-sm md:text-base text-secondary">
87
+ Generate your MCP API key for monitoring APIs
88
+ </p>
89
+ </div> <button
90
+ onClick={() => auth.signOut().then(() => router.push('/'))}
91
+ className="neuro-button px-3 py-2 md:px-4 md:py-2 text-sm md:text-base text-button font-medium"
92
+ >
93
+ Sign Out
94
+ </button>
95
  </div>
96
+ </div>
97
 
98
+ {/* Main Content */}
99
+ <div className="grid grid-cols-1 lg:grid-cols-2 gap-4 md:gap-6"> {/* API Key Generation */}
100
+ <div className="neuro-card p-4 md:p-6">
101
+ <h2 className="text-lg md:text-xl font-semibold text-primary mb-4">
102
+ Generate MCP API Key
103
+ </h2>
104
+
105
+ <div className="space-y-4">
106
+ <button
107
+ onClick={generateApiKey}
108
+ className="neuro-button-primary w-full py-3 px-4 text-base md:text-lg font-semibold"
109
+ >
110
+ <span className="flex items-center justify-center space-x-2">
111
+ <span>Generate New MCP API Key</span>
112
+ </span>
113
+ </button> {apiKey && (
114
+ <div className="neuro-display p-4">
115
+ <div className="flex justify-between items-center mb-3">
116
+ <h3 className="text-sm md:text-base font-semibold text-primary">Your MCP API Key</h3>
117
+ <button
118
+ onClick={copyToClipboard}
119
+ className="neuro-button px-2 py-1 text-xs text-button"
120
+ title="Copy to clipboard"
121
+ >
122
+ <svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
123
+ <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" />
124
+ </svg>
125
+ </button>
126
+ </div>
127
+ <div className="neuro-input p-3">
128
+ <code className="text-sm text-primary font-mono break-all">
129
+ {apiKey}
130
+ </code>
131
+ </div>
132
+ <p className="text-xs text-secondary mt-2">
133
+ Keep this key secure
134
+ </p>
135
+ </div>
136
+ )} {error && (
137
+ <div className="neuro-display p-3 border-l-4 border-red-400">
138
+ <div className="flex items-center">
139
+ <svg className="w-4 h-4 text-red-500 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
140
+ <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
141
+ </svg>
142
+ <span className="text-red-700 text-sm font-medium">{error}</span>
143
+ </div>
144
+ </div>
145
+ )}
146
+ </div>
147
+ </div> {/* User Info & Instructions */}
148
+ <div className="space-y-4">
149
+ {/* User Profile */}
150
+ <div className="neuro-card p-4 md:p-6">
151
+ <h2 className="text-lg md:text-xl font-semibold text-primary mb-4">
152
+ Account Information
153
+ </h2>
154
+ <div className="space-y-3">
155
+ <div className="neuro-display p-3 flex flex-col space-y-4">
156
+ <div>
157
+ <label className="text-xs font-medium text-secondary">Email</label>
158
+ <p className="text-primary font-medium">{userEmail}</p>
159
+ </div>
160
 
161
+ <div>
162
+ <label className="text-xs font-medium text-secondary">Display Name</label>
163
+ <p className="text-primary font-medium">{userDisplayName}</p>
164
+ </div>
165
+ </div>
166
+ </div>
167
+ </div>
168
+
169
+ {/* Usage Instructions */}
170
+ <div className="neuro-card p-4 md:p-6">
171
+ <h2 className="text-lg md:text-xl font-semibold text-primary mb-4">
172
+ How to Use Your MCP API Key
173
+ </h2>
174
+ <div className="space-y-3 text-sm text-secondary">
175
+ <div className="flex items-start space-x-3">
176
+ <span className="flex-shrink-0 w-5 h-5 bg-slate-600 text-white rounded-full flex items-center justify-center text-xs font-semibold">1</span>
177
+ <p>Use this key with the MCP API monitoring system to track APIs</p>
178
+ </div>
179
+ <div className="flex items-start space-x-3">
180
+ <span className="flex-shrink-0 w-5 h-5 bg-slate-600 text-white rounded-full flex items-center justify-center text-xs font-semibold">2</span>
181
+ <p>Set up API monitoring rules for automated API calls</p>
182
+ </div>
183
+ <div className="flex items-start space-x-3">
184
+ <span className="flex-shrink-0 w-5 h-5 bg-slate-600 text-white rounded-full flex items-center justify-center text-xs font-semibold">3</span>
185
+ <p>Monitor API responses and receive alerts when services change</p>
186
+ </div>
187
+ </div>
188
+ </div>
189
+ </div>
190
+ </div>
191
  </div>
192
+ </div>
193
  );
194
  }
keygenServer/client/app/page.tsx CHANGED
@@ -17,12 +17,38 @@ export default function LoginPage() {
17
  };
18
 
19
  return (
20
- <main className="p-4">
21
- <h1 className="text-xl mb-4">Sign In</h1>
22
- <button onClick={signInWithGoogle} className="bg-blue-500 text-white px-4 py-2 rounded">
23
- Sign in with Google
24
- </button>
25
- </main>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  );
27
  }
28
 
 
17
  };
18
 
19
  return (
20
+ <div className="min-h-screen flex items-center justify-center p-3 md:p-6 max-w-2xl mx-auto">
21
+ <div className="neuro-container w-full max-w-md p-4 md:p-8">
22
+ <div className="text-center mb-6 md:mb-8">
23
+ <h1 className="text-2xl md:text-4xl font-bold mb-4 text-primary">
24
+ MCP API Monitoring System
25
+ </h1>
26
+ <p className="text-sm md:text-lg text-secondary">
27
+ Sign in to generate and view your MCP API key
28
+ </p>
29
+ </div>
30
+ <div className="space-y-4 md:space-y-6">
31
+ <button
32
+ onClick={signInWithGoogle}
33
+ className="neuro-button-primary w-full py-3 px-4 md:py-4 md:px-6 text-base md:text-lg font-semibold"
34
+ >
35
+ <svg className="w-5 h-5 md:w-6 md:h-6 mr-3" viewBox="0 0 24 24">
36
+ <path fill="#4285F4" d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z" />
37
+ <path fill="#34A853" d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z" />
38
+ <path fill="#FBBC05" d="M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z" />
39
+ <path fill="#EA4335" d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z" />
40
+ </svg>
41
+ <span>Continue with Google</span>
42
+ </button>
43
+
44
+ <div className="neuro-display p-4">
45
+ <p className="text-sm text-secondary text-center">
46
+ Generate your MCP API key, then head to your MCP-enabled application to start.
47
+ </p>
48
+ </div>
49
+ </div>
50
+ </div>
51
+ </div>
52
  );
53
  }
54