├── .eslintrc.json ├── public ├── demo.gif ├── vercel.svg └── next.svg ├── src ├── app │ ├── favicon.ico │ ├── components │ │ ├── SessionProvider.js │ │ ├── SignInButton.js │ │ ├── EditApiKeyModal.js │ │ ├── Notification.js │ │ ├── CreateApiKeyModal.js │ │ ├── ApiDemo.tsx │ │ ├── ApiKeysTable.js │ │ └── Sidebar.js │ ├── lib │ │ ├── supabaseClient.js │ │ ├── auth.ts │ │ ├── apiKeyUtils.ts │ │ └── githubUtils.ts │ ├── protected │ │ └── page.js │ ├── api │ │ ├── validate-key │ │ │ └── route.js │ │ ├── github-summarizer │ │ │ ├── chain.js │ │ │ └── route.js │ │ ├── auth │ │ │ └── [...nextauth] │ │ │ │ └── route.ts │ │ └── api-keys │ │ │ ├── route.ts │ │ │ └── [id] │ │ │ └── route.ts │ ├── layout.tsx │ ├── privacy-policy │ │ └── page.tsx │ ├── terms-of-service │ │ └── page.tsx │ ├── globals.css │ ├── playground │ │ └── page.tsx │ ├── dashboards │ │ └── page.js │ └── page.tsx ├── middleware.ts ├── lib │ └── utils.ts └── components │ └── ui │ ├── textarea.tsx │ ├── input.tsx │ ├── badge.tsx │ ├── button.tsx │ └── card.tsx ├── jsconfig.json ├── next.config.mjs ├── postcss.config.mjs ├── next.config.js ├── components.json ├── .gitignore ├── tsconfig.json ├── package.json ├── .cursorrules ├── tailwind.config.js ├── README.md └── LICENSE /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "next/core-web-vitals" 3 | } 4 | -------------------------------------------------------------------------------- /public/demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emarco177/dandi/main/public/demo.gif -------------------------------------------------------------------------------- /src/app/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emarco177/dandi/main/src/app/favicon.ico -------------------------------------------------------------------------------- /jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "paths": { 4 | "@/*": ["./src/*"] 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /next.config.mjs: -------------------------------------------------------------------------------- 1 | /** @type {import('next').NextConfig} */ 2 | const nextConfig = {}; 3 | 4 | export default nextConfig; 5 | -------------------------------------------------------------------------------- /src/middleware.ts: -------------------------------------------------------------------------------- 1 | export { default } from "next-auth/middleware"; 2 | 3 | export const config = { 4 | matcher: ["/dashboards"], 5 | }; -------------------------------------------------------------------------------- /postcss.config.mjs: -------------------------------------------------------------------------------- 1 | /** @type {import('postcss-load-config').Config} */ 2 | const config = { 3 | plugins: { 4 | tailwindcss: {}, 5 | }, 6 | }; 7 | 8 | export default config; 9 | -------------------------------------------------------------------------------- /next.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('next').NextConfig} */ 2 | const nextConfig = { 3 | images: { 4 | domains: ['lh3.googleusercontent.com'], 5 | }, 6 | }; 7 | 8 | module.exports = nextConfig; -------------------------------------------------------------------------------- /src/lib/utils.ts: -------------------------------------------------------------------------------- 1 | import { clsx, type ClassValue } from "clsx" 2 | import { twMerge } from "tailwind-merge" 3 | 4 | export function cn(...inputs: ClassValue[]) { 5 | return twMerge(clsx(inputs)) 6 | } 7 | -------------------------------------------------------------------------------- /src/app/components/SessionProvider.js: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import { SessionProvider } from "next-auth/react"; 4 | 5 | export default function NextAuthSessionProvider({ children }) { 6 | return {children}; 7 | } -------------------------------------------------------------------------------- /src/app/lib/supabaseClient.js: -------------------------------------------------------------------------------- 1 | import { createClient } from '@supabase/supabase-js' 2 | 3 | const supabaseUrl = process.env.NEXT_PUBLIC_SUPABASE_URL 4 | const supabaseAnonKey = process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY 5 | 6 | export const supabase = createClient(supabaseUrl, supabaseAnonKey) 7 | -------------------------------------------------------------------------------- /src/app/protected/page.js: -------------------------------------------------------------------------------- 1 | const ProtectedPage = () => { 2 | return ( 3 |
4 |

Protected Page

5 |

This is a protected page that can only be accessed with a valid API key.

6 |
7 | ); 8 | }; 9 | 10 | export default ProtectedPage; -------------------------------------------------------------------------------- /components.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://ui.shadcn.com/schema.json", 3 | "style": "new-york", 4 | "rsc": true, 5 | "tsx": true, 6 | "tailwind": { 7 | "config": "tailwind.config.js", 8 | "css": "src/app/globals.css", 9 | "baseColor": "zinc", 10 | "cssVariables": true, 11 | "prefix": "" 12 | }, 13 | "aliases": { 14 | "components": "@/components", 15 | "utils": "@/lib/utils", 16 | "ui": "@/components/ui", 17 | "lib": "@/lib", 18 | "hooks": "@/hooks" 19 | } 20 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | .yarn/install-state.gz 8 | 9 | # testing 10 | /coverage 11 | 12 | # next.js 13 | /.next/ 14 | /out/ 15 | 16 | # production 17 | /build 18 | 19 | # misc 20 | .DS_Store 21 | *.pem 22 | 23 | # debug 24 | npm-debug.log* 25 | yarn-debug.log* 26 | yarn-error.log* 27 | 28 | # local env files 29 | .env*.local 30 | 31 | # vercel 32 | .vercel 33 | 34 | # typescript 35 | *.tsbuildinfo 36 | next-env.d.ts 37 | -------------------------------------------------------------------------------- /public/vercel.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/lib/auth.ts: -------------------------------------------------------------------------------- 1 | import { getServerSession } from "next-auth/next"; 2 | import { } from "@/app/api/auth/[...nextauth]/route"; 3 | import { supabase } from './supabaseClient'; 4 | 5 | export async function getSessionUser() { 6 | const session = await getServerSession(); 7 | if (!session || !session.user?.email) { 8 | return null; 9 | } 10 | 11 | const { data: user, error } = await supabase 12 | .from('users') 13 | .select('id') 14 | .eq('email', session.user.email) 15 | .single(); 16 | 17 | if (error || !user) { 18 | console.error('Error fetching user:', error); 19 | return null; 20 | } 21 | 22 | return user; 23 | } -------------------------------------------------------------------------------- /src/app/components/SignInButton.js: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import { signIn, signOut, useSession } from "next-auth/react"; 4 | 5 | export default function SignInButton() { 6 | const { data: session } = useSession(); 7 | 8 | if (session && session.user) { 9 | return ( 10 |
11 |

{session.user.name}

12 | Profile 13 | 16 |
17 | ); 18 | } 19 | return ( 20 | 23 | ); 24 | } -------------------------------------------------------------------------------- /src/components/ui/textarea.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react" 2 | 3 | import { cn } from "@/lib/utils" 4 | 5 | export interface TextareaProps 6 | extends React.TextareaHTMLAttributes {} 7 | 8 | const Textarea = React.forwardRef( 9 | ({ className, ...props }, ref) => { 10 | return ( 11 |