4 |
Privacy Policy
5 |
Last updated: [Current Date]
6 |
7 | Dandi Github Analyzer (“we”, “our”, or “us”) is committed to protecting your privacy. This Privacy Policy explains how we collect, use, and share information about you when you use our website and services.
8 |
9 |
Information We Collect
10 |
11 | We collect information you provide directly to us, such as when you create an account, use our services, or communicate with us. This may include your name, email address, and GitHub account information.
12 |
13 |
How We Use Your Information
14 |
15 | We use the information we collect to provide, maintain, and improve our services, to communicate with you, and to comply with legal obligations.
16 |
17 |
Data Sharing and Disclosure
18 |
19 | We do not sell your personal information. We may share your information with third-party service providers who perform services on our behalf, or when required by law.
20 |
21 |
Your Rights and Choices
22 |
23 | You have the right to access, correct, or delete your personal information. You can manage your information through your account settings or by contacting us.
24 |
25 |
Changes to This Policy
26 |
27 | We may update this Privacy Policy from time to time. We will notify you of any changes by posting the new Privacy Policy on this page.
28 |
29 |
Contact Us
30 |
31 | If you have any questions about this Privacy Policy, please contact us at [Your Contact Email].
32 |
33 |
34 | );
35 | }
--------------------------------------------------------------------------------
/src/app/api/api-keys/[id]/route.ts:
--------------------------------------------------------------------------------
1 | import { NextResponse } from 'next/server';
2 | import { getSessionUser } from '@/app/lib/auth';
3 | import { supabase } from '@/app/lib/supabaseClient';
4 |
5 | export async function GET(request: Request, { params }: { params: { id: string } }) {
6 | const user = await getSessionUser();
7 | if (!user) {
8 | return NextResponse.json({ error: 'Unauthorized' }, { status: 401 });
9 | }
10 |
11 | const { data, error } = await supabase
12 | .from('api_keys')
13 | .select('*')
14 | .eq('id', params.id)
15 | .eq('user_id', user.id)
16 | .single();
17 |
18 | if (error) {
19 | console.error('Error fetching API key:', error);
20 | return NextResponse.json({ error: 'Internal Server Error' }, { status: 500 });
21 | }
22 |
23 | if (!data) {
24 | return NextResponse.json({ error: 'API Key not found' }, { status: 404 });
25 | }
26 |
27 | return NextResponse.json(data);
28 | }
29 |
30 | export async function PUT(request: Request, { params }: { params: { id: string } }) {
31 | const user = await getSessionUser();
32 | if (!user) {
33 | return NextResponse.json({ error: 'Unauthorized' }, { status: 401 });
34 | }
35 |
36 | const { name } = await request.json();
37 |
38 | const { data, error } = await supabase
39 | .from('api_keys')
40 | .update({ name })
41 | .eq('id', params.id)
42 | .eq('user_id', user.id)
43 | .select();
44 |
45 | if (error) {
46 | console.error('Error updating API key:', error);
47 | return NextResponse.json({ error: 'Internal Server Error' }, { status: 500 });
48 | }
49 |
50 | if (data.length === 0) {
51 | return NextResponse.json({ error: 'API Key not found' }, { status: 404 });
52 | }
53 |
54 | return NextResponse.json(data[0]);
55 | }
56 |
57 | export async function DELETE(request: Request, { params }: { params: { id: string } }) {
58 | const user = await getSessionUser();
59 | if (!user) {
60 | return NextResponse.json({ error: 'Unauthorized' }, { status: 401 });
61 | }
62 |
63 | const { error } = await supabase
64 | .from('api_keys')
65 | .delete()
66 | .eq('id', params.id)
67 | .eq('user_id', user.id);
68 |
69 | if (error) {
70 | console.error('Error deleting API key:', error);
71 | return NextResponse.json({ error: 'Internal Server Error' }, { status: 500 });
72 | }
73 |
74 | return NextResponse.json({ message: 'API Key deleted successfully' });
75 | }
--------------------------------------------------------------------------------
/src/app/components/CreateApiKeyModal.js:
--------------------------------------------------------------------------------
1 | import { useState } from 'react';
2 |
3 | export default function CreateApiKeyModal({ isOpen, onClose, onCreate }) {
4 | const [newKeyName, setNewKeyName] = useState("");
5 | const [newKeyLimit, setNewKeyLimit] = useState(1000);
6 |
7 | const handleSubmit = (e) => {
8 | e.preventDefault();
9 | onCreate(newKeyName, newKeyLimit);
10 | setNewKeyName("");
11 | setNewKeyLimit(1000);
12 | };
13 |
14 | if (!isOpen) return null;
15 |
16 | return (
17 |
4 |
Terms of Service
5 |
Last updated: [Current Date]
6 |
7 | Please read these Terms of Service (“Terms”, “Terms of Service”) carefully before using the Dandi Github Analyzer website and service.
8 |
9 |
1. Agreement to Terms
10 |
11 | By accessing or using our service, you agree to be bound by these Terms. If you disagree with any part of the terms, then you may not access the service.
12 |
13 |
2. Use of Service
14 |
15 | You agree to use the service only for purposes that are permitted by these Terms and any applicable law, regulation, or generally accepted practices or guidelines in the relevant jurisdictions.
16 |
17 |
3. Intellectual Property
18 |
19 | The service and its original content, features, and functionality are and will remain the exclusive property of Dandi Github Analyzer and its licensors.
20 |
21 |
4. Termination
22 |
23 | We may terminate or suspend access to our service immediately, without prior notice or liability, for any reason whatsoever, including without limitation if you breach the Terms.
24 |
25 |
5. Limitation of Liability
26 |
27 | In no event shall Dandi Github Analyzer, nor its directors, employees, partners, agents, suppliers, or affiliates, be liable for any indirect, incidental, special, consequential or punitive damages.
28 |
29 |
6. Changes
30 |
31 | We reserve the right, at our sole discretion, to modify or replace these Terms at any time. By continuing to access or use our service after those revisions become effective, you agree to be bound by the revised terms.
32 |
33 |
Contact Us
34 |
35 | If you have any questions about these Terms, please contact us at [Your Contact Email].
36 |
37 |
38 | );
39 | }
--------------------------------------------------------------------------------
/src/app/components/ApiDemo.tsx:
--------------------------------------------------------------------------------
1 | 'use client';
2 |
3 | import { useState } from 'react';
4 | import { useRouter } from 'next/navigation';
5 | import { useSession } from 'next-auth/react';
6 | import { Button } from "@/components/ui/button"
7 | import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@/components/ui/card"
8 | import { Textarea } from "@/components/ui/textarea"
9 |
10 | export function ApiDemo() {
11 | const [payload, setPayload] = useState(JSON.stringify({ githubUrl: "https://github.com/assafelovic/gpt-researcher" }, null, 2))
12 | const [response, setResponse] = useState(JSON.stringify({
13 | "summary": "GPT Researcher is an autonomous agent designed for comprehensive online research on various tasks. It aims to provide detailed, factual, and unbiased research reports by leveraging AI technology. The project addresses issues of misinformation, speed, determinism, and reliability in research tasks.",
14 | "cool_facts": [
15 | "The project leverages both `gpt-4o-mini` and `gpt-4o` (128K context) to complete research tasks, optimizing costs and achieving an average completion time of around 2 minutes at a cost of ~$0.005.",
16 | "GPT Researcher offers the ability to generate long and detailed research reports (over 2K words) by aggregating over 20 web sources per research task to ensure objective and factual conclusions."
17 | ],
18 | "stars": 14076,
19 | "latestVersion": "v3.0.8",
20 | "websiteUrl": "https://gptr.dev",
21 | "licenseType": "Apache-2.0"
22 | }, null, 2))
23 | const [isLoading, setIsLoading] = useState(false)
24 | const router = useRouter();
25 | const { data: session } = useSession();
26 |
27 | const handleSubmit = async () => {
28 | if (session) {
29 | router.push('/playground');
30 | } else {
31 | router.push('/api/auth/signin');
32 | }
33 | }
34 |
35 | return (
36 |