Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ representative at an online or offline event.

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
subha9.5roy350@gmail.com
ronichandrasarkar@gmail.com
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
Expand Down Expand Up @@ -115,7 +115,7 @@ the community.
## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
version 1.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.

Community Impact Guidelines were inspired by [Mozilla's code of conduct
Expand Down
71 changes: 67 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
"lint": "next lint"
},
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^6.7.2",
"@fortawesome/free-brands-svg-icons": "^6.7.2",
"@fortawesome/free-solid-svg-icons": "^6.7.2",
"@fortawesome/react-fontawesome": "^0.2.2",
"@google/generative-ai": "^0.21.0",
"date-fns": "^3.6.0",
"next": "14.2.3",
"react": "^18",
Expand Down
8 changes: 8 additions & 0 deletions src/app/http_codes/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import HttpCodeViewComponent from "@/components/http_codes/http_code_view";
import React from "react";

const HttpCodePage = () => {
return <HttpCodeViewComponent />;
};

export default HttpCodePage;
4 changes: 4 additions & 0 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ export default function RootLayout({
gtag('js', new Date());
gtag('config', '${process.env.NEXT_PUBLIC_GA4_ID}');`}
</Script>
<link
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/all.min.css"
rel="stylesheet"
></link>
</head>
<body className={inter.className}>{children}</body>
</html>
Expand Down
7 changes: 5 additions & 2 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
"use client";
import HeaderComponent from "@/components/header/header.component";
import HeroComponent from "@/components/hero/hero.component";
import RepositoryComponent from "@/components/repository/repository.component";
import { useState } from "react";

export default function Home() {
const [generateText, setGenerateText] = useState<string>("");
return (
<main>
{/* <HeaderComponent /> */}
<HeroComponent />
<RepositoryComponent />
<HeroComponent setGenerateText={setGenerateText} />
<RepositoryComponent generateText={generateText} />
</main>
);
}
37 changes: 37 additions & 0 deletions src/components/ai_model/ai_model.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import {
GoogleGenerativeAI,
HarmCategory,
HarmBlockThreshold,
} from "@google/generative-ai";

const apiKey = process.env.NEXT_PUBLIC_GEMINI_API_KEY;
const genAI = new GoogleGenerativeAI(apiKey as string);

const model = genAI.getGenerativeModel({
model: "gemini-1.5-pro",
});

const generationConfig = {
temperature: 1,
topP: 0.95,
topK: 64,
maxOutputTokens: 8192,
responseMimeType: "text/plain",
};

const safetySettings = [
{
category: HarmCategory.HARM_CATEGORY_HARASSMENT,
threshold: HarmBlockThreshold.BLOCK_LOW_AND_ABOVE,
},
{
category: HarmCategory.HARM_CATEGORY_HATE_SPEECH,
threshold: HarmBlockThreshold.BLOCK_LOW_AND_ABOVE,
},
];

export const aiGenerateModel = model.startChat({
generationConfig,
safetySettings,
history: [],
});
48 changes: 37 additions & 11 deletions src/components/hero/hero.component.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
import React from "react";
import React, { useState } from "react";
import NextGenerationViewComponent from "./next.generation.view.component";

const HeroComponent = () => {
interface IHeroComponentProps {
setGenerateText: (text: string) => void;
}

const HeroComponent: React.FC<IHeroComponentProps> = ({ setGenerateText }) => {
const [searchText, setSearchText] = useState<string>("");
const generateText = () => {
if (searchText.trim() === "") return;
setGenerateText(searchText);
setTimeout(() => setSearchText(""), 0);
};
return (
<div className="gradient-bg min-h-screen">
<div className="relative overflow-hidden">
Expand All @@ -10,23 +20,29 @@ const HeroComponent = () => {
<nav className="relative z-10 mx-auto max-w-8xl px-6 py-4">
<div className="flex items-center justify-between">
<div className="flex items-center space-x-16">
{/* <a href="#" className="flex items-center space-x-2">
{/* <a href="/" className="flex items-center space-x-2">
<img
src="https://ai-public.creatie.ai/gen_page/logo_placeholder.png"
src=""
alt="Logo"
className="h-8 w-auto"
/>
</a> */}
<div className="hidden md:flex items-center space-x-8">
<a href="#" className="text-white hover:text-custom transition">
ABOUT
</a>
<a
href="/http_codes"
className="text-white hover:text-custom transition"
>
HTTP CODES
</a>
<a
href="/repos"
className="text-white hover:text-custom transition"
>
REPOS
</a>
<a href="#" className="text-white hover:text-custom transition">
ABOUT
</a>
</div>
</div>
<div className="flex items-center space-x-4">
Expand All @@ -47,8 +63,8 @@ const HeroComponent = () => {
</span>
</h1>
<p className="text-xl text-gray-300 mb-12 max-w-2xl mx-auto">
Describe what you&apos;re looking for and let our AI help you
discover the perfect repository.
Type a technology or skill to explore and solve beginner-friendly
issues from GitHub projects
</p>

<div className="flex-grow flex flex-col items-center justify-center">
Expand All @@ -58,18 +74,28 @@ const HeroComponent = () => {
<i className="fas fa-sparkles text-gray-400"></i>
</div>
<input
value={searchText}
onChange={(e) => setSearchText(e.target.value)}
type="text"
className="block w-full pl-12 pr-32 py-4 bg-gray-800/30 backdrop-blur-sm border border-gray-700/50 rounded-xl focus:ring-2 focus:ring-blue-500/50 focus:border-blue-500/50 text-white placeholder-gray-400 transition-all duration-300 outline-none"
placeholder="Describe the repository you're looking for..."
placeholder="Enter a topic and find the best issue..."
/>

<div className="absolute inset-y-0 right-0 flex items-center pr-2">
<div
className="absolute inset-y-0 right-0 flex items-center pr-2"
onClick={generateText}
>
<button className="relative !rounded-button bg-gradient-to-r from-blue-900 via-emerald-800 to-blue-500 text-white font-medium px-6 py-2 mr-2 border border-transparent hover:border-white/20 transition-all duration-300 before:absolute before:inset-0 before:bg-gradient-to-r before:from-blue-500 before:via-blue-900 before:to-emerald-800 before:animate-border-gradient before:rounded-xl before:-z-10 before:blur-sm">
<i className="fa fa-wand-magic-sparkles mr-2"></i>Generate
</button>
</div>
</div>
</div>
<div className="text-gray-400 items-center pr-1">
<span className="text-sm text-red-400">
Trips: typescript+react+...
</span>
</div>
</div>
</main>
<div className="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[800px] h-[800px] bg-custom/20 rounded-full blur-3xl -z-10"></div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/hero/next.generation.view.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const NextGenerationViewComponent = () => {
W
</span>
<span className="text-gray-400 text-sm ml-2">
Next-Generation of AI Open Source
Next-Generation of Open Source
</span>
</div>
);
Expand Down
37 changes: 37 additions & 0 deletions src/components/http_codes/http_code_view.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import React from "react";
import httpCodes from "../../http_status_code.json";
import Link from "next/link";
import NavBar from "../nav_bar";

const HttpCodeViewComponent = () => {
return (
<div className="m-5">
<Link href="/">
<div className="mb-4">
<NavBar />
</div>
</Link>

<div className="grid grid-cols-1 md:grid-cols-3 gap-4 ">
{httpCodes.map((httpCode) => {
return (
<div
key={httpCode.code}
className={`p-4 rounded-2xl shadow-lg bg-gray-600 text-black`}
>
<div className="flex justify-between items-center mb-5">
<h1 className="text-2xl font-bold">{httpCode.code}</h1>
<span className="text-sm">{httpCode.message}</span>
</div>
<span className="bg-gradient-to-r from-[#0F172A] via-pink-700 to-gray-900 text-transparent bg-clip-text font-bold">
{httpCode.status}
</span>
</div>
);
})}
</div>
</div>
);
};

export default HttpCodeViewComponent;
24 changes: 24 additions & 0 deletions src/components/issues/issue.helper.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
export const extractRepoName = (url: string): string => {
const parts = url.split("repos/")[1];
return parts;
};

export const getRelativeTime = (isoString: string): string => {
const date = new Date(isoString);
const now = new Date();
const diffInSeconds = Math.floor((now.getTime() - date.getTime()) / 1000);
if (diffInSeconds < 60) return `${diffInSeconds} sec ago`;
const diffInMinutes = Math.floor(diffInSeconds / 60);
if (diffInMinutes < 60) return `${diffInMinutes} min ago`;
const diffInHours = Math.floor(diffInMinutes / 60);
if (diffInHours < 24)
return `${diffInHours} hour${diffInHours > 1 ? "s" : ""} ago`;
const diffInDays = Math.floor(diffInHours / 24);
if (diffInDays < 30)
return `${diffInDays} day${diffInDays > 1 ? "s" : ""} ago`;
const diffInMonths = Math.floor(diffInDays / 30);
if (diffInMonths < 12)
return `${diffInMonths} month${diffInMonths > 1 ? "s" : ""} ago`;
const diffInYears = Math.floor(diffInMonths / 12);
return `${diffInYears} year${diffInYears > 1 ? "s" : ""} ago`;
};
Loading