├── contributing.md ├── .eslintrc.json ├── app ├── favicon.ico ├── page.tsx ├── Chat │ ├── layout.tsx │ └── page.tsx ├── layout.tsx ├── api │ └── chat │ │ └── route.ts ├── Leaderboard │ └── page.tsx ├── globals.css ├── Imagen │ └── page.tsx ├── Home │ └── page.tsx └── Courses │ └── [name] │ └── page.tsx ├── public ├── bear.riv ├── logo.png ├── hero_use_case.riv ├── icons │ ├── html5.svg │ ├── css3.svg │ ├── azure.svg │ ├── devops.svg │ ├── git.svg │ ├── typescript.svg │ ├── tailwindcss.svg │ ├── bronzemedal.svg │ ├── javascript.svg │ ├── silvermedal.svg │ ├── github.svg │ ├── mongodb.svg │ ├── goldmedal.svg │ ├── docker.svg │ ├── nextjs.svg │ ├── graphql.svg │ ├── kubernetes.svg │ ├── reactjs.svg │ └── express.svg ├── vercel.svg └── next.svg ├── .env.example ├── postcss.config.js ├── gitpush.bat ├── lib └── utils.ts ├── next.config.js ├── utils ├── throttle.ts ├── usePrefersReducedMotion.ts └── useMediaBreakpoint.ts ├── styles ├── styles.module.css ├── ai.css ├── LoginFormComponent.css └── home.module.css ├── components ├── theme-provider.tsx ├── ui │ ├── label.tsx │ ├── progress.tsx │ ├── input.tsx │ ├── toggle.tsx │ ├── radio-group.tsx │ ├── button.tsx │ ├── card.tsx │ └── dropdown-menu.tsx ├── color-toggle.tsx ├── Confetti.tsx ├── RiveButton.tsx └── RiveHero.tsx ├── components.json ├── dockerfile ├── middleware.ts ├── .gitignore ├── tailwind.config.ts ├── tsconfig.json ├── LICENSE ├── package.json ├── tailwind.config.js ├── data ├── html5.d.ts ├── typescript.d.ts ├── javascript.d.ts ├── css3.d.ts ├── reactjs.d.ts ├── mongodb.d.ts ├── express.d.ts ├── azure.d.ts ├── nextjs.d.ts ├── tailwindcss.d.ts ├── git.d.ts ├── github.d.ts ├── docker.d.ts ├── devops.d.ts ├── graphql.d.ts └── kubernetes.d.ts ├── README.md └── CODE_OF_CONDUCT.md /contributing.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "next/core-web-vitals" 3 | } 4 | -------------------------------------------------------------------------------- /app/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kanugurajesh/Student-LMS/HEAD/app/favicon.ico -------------------------------------------------------------------------------- /public/bear.riv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kanugurajesh/Student-LMS/HEAD/public/bear.riv -------------------------------------------------------------------------------- /public/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kanugurajesh/Student-LMS/HEAD/public/logo.png -------------------------------------------------------------------------------- /public/hero_use_case.riv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kanugurajesh/Student-LMS/HEAD/public/hero_use_case.riv -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY= 2 | CLERK_SECRET_KEY= 3 | GOOGLE_API_KEY= 4 | HUGGING_API_KEY= -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /gitpush.bat: -------------------------------------------------------------------------------- 1 | git add . 2 | @REM take the commit message as the first command line argument 3 | git commit -m %1 4 | @REM push to the origin 5 | git push origin main -------------------------------------------------------------------------------- /lib/utils.ts: -------------------------------------------------------------------------------- 1 | import { type ClassValue, clsx } from "clsx" 2 | import { twMerge } from "tailwind-merge" 3 | 4 | export function cn(...inputs: ClassValue[]) { 5 | return twMerge(clsx(inputs)) 6 | } 7 | -------------------------------------------------------------------------------- /next.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('next').NextConfig} */ 2 | const nextConfig = { 3 | images: { 4 | domains: ['codehelp-portfolio-website.netlify.app','drive.google.com'] 5 | } 6 | } 7 | 8 | module.exports = nextConfig 9 | -------------------------------------------------------------------------------- /utils/throttle.ts: -------------------------------------------------------------------------------- 1 | export function throttle(f: Function, delay: number) { 2 | let timer = 0; 3 | return function (this: Function, ...args: any) { 4 | clearTimeout(timer); 5 | timer = window.setTimeout(() => f.apply(this, args), delay); 6 | }; 7 | } 8 | -------------------------------------------------------------------------------- /styles/styles.module.css: -------------------------------------------------------------------------------- 1 | .darkgradient { 2 | background-color: #2b4162; 3 | background-image: linear-gradient(315deg, #2b4162 0%, #12100e 74%); 4 | } 5 | 6 | .textwrap { 7 | width: 100%; 8 | height: 100%; 9 | display: flex; 10 | flex-direction: column; 11 | justify-content: center; 12 | text-wrap: wrap; 13 | } -------------------------------------------------------------------------------- /components/theme-provider.tsx: -------------------------------------------------------------------------------- 1 | "use client" 2 | 3 | import * as React from "react" 4 | import { ThemeProvider as NextThemesProvider } from "next-themes" 5 | import { type ThemeProviderProps } from "next-themes/dist/types" 6 | 7 | export function ThemeProvider({ children, ...props }: ThemeProviderProps) { 8 | return {children} 9 | } 10 | -------------------------------------------------------------------------------- /components.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://ui.shadcn.com/schema.json", 3 | "style": "default", 4 | "rsc": true, 5 | "tsx": true, 6 | "tailwind": { 7 | "config": "tailwind.config.js", 8 | "css": "app/globals.css", 9 | "baseColor": "slate", 10 | "cssVariables": true 11 | }, 12 | "aliases": { 13 | "components": "@/components", 14 | "utils": "@/lib/utils" 15 | } 16 | } -------------------------------------------------------------------------------- /dockerfile: -------------------------------------------------------------------------------- 1 | # import node 2 | FROM node:12.18.3-alpine3.12 3 | 4 | # set working directory 5 | WORKDIR /app 6 | 7 | # copy package.json and package-lock.json 8 | COPY package*.json ./ 9 | 10 | # install dependencies 11 | RUN npm install 12 | 13 | # copy app source code 14 | 15 | COPY . . 16 | 17 | # expose port 3000 18 | 19 | EXPOSE 3000 20 | 21 | # start app 22 | 23 | CMD ["npm", "run","start"] -------------------------------------------------------------------------------- /app/page.tsx: -------------------------------------------------------------------------------- 1 | import RiveHero from "@/components/RiveHero"; 2 | 3 | export default function Home() { 4 | return ( 5 | <> 6 | 12 |
13 | 14 |
15 | 16 | ) 17 | } 18 | -------------------------------------------------------------------------------- /middleware.ts: -------------------------------------------------------------------------------- 1 | import { authMiddleware } from "@clerk/nextjs"; 2 | 3 | // This example protects all routes including api/trpc routes 4 | // Please edit this to allow other routes to be public as needed. 5 | // See https://clerk.com/docs/references/nextjs/auth-middleware for more information about configuring your Middleware 6 | export default authMiddleware({}); 7 | 8 | export const config = { 9 | matcher: ['/((?!.+\\.[\\w]+$|_next).*)', '/', '/(api|trpc)(.*)'], 10 | }; 11 | -------------------------------------------------------------------------------- /public/icons/html5.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /styles/ai.css: -------------------------------------------------------------------------------- 1 | #imagecontainer { 2 | display: flex; 3 | justify-content: center; 4 | flex-direction: row; 5 | flex-wrap: wrap; 6 | gap: 30px; 7 | margin-top: 80px; 8 | } 9 | 10 | #imagecontainer img { 11 | width: 20%; 12 | height: 20%; 13 | box-shadow: 10px 10px 10px 10px rgba(0, 0, 0, 0.2); 14 | border-radius: 10px; 15 | transition: transform 0.2s ease-in-out; 16 | cursor: pointer; 17 | } 18 | 19 | #imagecontainer img:hover { 20 | transform: scale(1.05); 21 | } -------------------------------------------------------------------------------- /public/icons/css3.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /tailwind.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from 'tailwindcss' 2 | 3 | const config: Config = { 4 | content: [ 5 | './pages/**/*.{js,ts,jsx,tsx,mdx}', 6 | './components/**/*.{js,ts,jsx,tsx,mdx}', 7 | './app/**/*.{js,ts,jsx,tsx,mdx}', 8 | ], 9 | theme: { 10 | extend: { 11 | backgroundImage: { 12 | 'gradient-radial': 'radial-gradient(var(--tw-gradient-stops))', 13 | 'gradient-conic': 14 | 'conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))', 15 | }, 16 | }, 17 | }, 18 | plugins: [], 19 | } 20 | export default config 21 | -------------------------------------------------------------------------------- /public/vercel.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/azure.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/Chat/layout.tsx: -------------------------------------------------------------------------------- 1 | import { ThemeProvider } from '@/components/theme-provider' 2 | import ModeToggle from '@/components/color-toggle' 3 | 4 | export default function RootLayout({ 5 | children, 6 | }: { 7 | children: React.ReactNode 8 | }) { 9 | return ( 10 |
11 | 17 |
18 | 19 |
20 | {children} 21 |
22 |
23 | ) 24 | } 25 | -------------------------------------------------------------------------------- /app/layout.tsx: -------------------------------------------------------------------------------- 1 | import type { Metadata } from 'next' 2 | import { ClerkProvider } from '@clerk/nextjs' 3 | import { Inter } from 'next/font/google' 4 | import './globals.css' 5 | 6 | const inter = Inter({ subsets: ['latin'] }) 7 | 8 | export const metadata: Metadata = { 9 | title: 'Student LMS', 10 | description: 'A platform to recommend personalised learning paths to students', 11 | } 12 | 13 | export default function RootLayout({ 14 | children, 15 | }: { 16 | children: React.ReactNode 17 | }) { 18 | return ( 19 | 20 | 21 | {children} 22 | 23 | 24 | ) 25 | } 26 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "lib": ["dom", "dom.iterable", "esnext"], 5 | "allowJs": true, 6 | "skipLibCheck": true, 7 | "strict": true, 8 | "noEmit": true, 9 | "esModuleInterop": true, 10 | "module": "esnext", 11 | "moduleResolution": "bundler", 12 | "resolveJsonModule": true, 13 | "isolatedModules": true, 14 | "jsx": "preserve", 15 | "incremental": true, 16 | "plugins": [ 17 | { 18 | "name": "next" 19 | } 20 | ], 21 | "paths": { 22 | "@/*": ["./*"] 23 | } 24 | }, 25 | "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "data/leaderboard.js"], 26 | "exclude": ["node_modules"] 27 | } 28 | -------------------------------------------------------------------------------- /public/icons/devops.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /components/ui/label.tsx: -------------------------------------------------------------------------------- 1 | "use client" 2 | 3 | import * as React from "react" 4 | import * as LabelPrimitive from "@radix-ui/react-label" 5 | import { cva, type VariantProps } from "class-variance-authority" 6 | 7 | import { cn } from "@/lib/utils" 8 | 9 | const labelVariants = cva( 10 | "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70" 11 | ) 12 | 13 | const Label = React.forwardRef< 14 | React.ElementRef, 15 | React.ComponentPropsWithoutRef & 16 | VariantProps 17 | >(({ className, ...props }, ref) => ( 18 | 23 | )) 24 | Label.displayName = LabelPrimitive.Root.displayName 25 | 26 | export { Label } 27 | -------------------------------------------------------------------------------- /app/api/chat/route.ts: -------------------------------------------------------------------------------- 1 | import { NextRequest, NextResponse } from "next/server"; 2 | 3 | import { GoogleGenerativeAI } from "@google/generative-ai"; 4 | 5 | export async function POST(req: NextRequest) { 6 | 7 | // get prompt field from the request body 8 | const reqBody = await req.json(); 9 | const { userPrompt } = reqBody; 10 | const genAI = new GoogleGenerativeAI(process.env.GOOGLE_API_KEY as string); 11 | const model = genAI.getGenerativeModel({ model: "gemini-pro", generationConfig: { maxOutputTokens: 400 }}); 12 | 13 | try { 14 | const result = await model.generateContent(userPrompt); 15 | const response = await result.response; 16 | const text = response.text(); 17 | return NextResponse.json({ 18 | text 19 | }); 20 | } catch (error) { 21 | return NextResponse.json({ 22 | text: "Unable to process the prompt. Please try again." 23 | }); 24 | } 25 | } -------------------------------------------------------------------------------- /components/ui/progress.tsx: -------------------------------------------------------------------------------- 1 | "use client" 2 | 3 | import * as React from "react" 4 | import * as ProgressPrimitive from "@radix-ui/react-progress" 5 | 6 | import { cn } from "@/lib/utils" 7 | 8 | const Progress = React.forwardRef< 9 | React.ElementRef, 10 | React.ComponentPropsWithoutRef 11 | >(({ className, value, ...props }, ref) => ( 12 | 20 | 24 | 25 | )) 26 | Progress.displayName = ProgressPrimitive.Root.displayName 27 | 28 | export { Progress } 29 | -------------------------------------------------------------------------------- /components/ui/input.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react" 2 | 3 | import { cn } from "@/lib/utils" 4 | 5 | export interface InputProps 6 | extends React.InputHTMLAttributes {} 7 | 8 | const Input = React.forwardRef( 9 | ({ className, type, ...props }, ref) => { 10 | return ( 11 | 20 | ) 21 | } 22 | ) 23 | Input.displayName = "Input" 24 | 25 | export { Input } 26 | -------------------------------------------------------------------------------- /utils/usePrefersReducedMotion.ts: -------------------------------------------------------------------------------- 1 | import {useEffect, useState} from 'react'; 2 | 3 | // TODO: Remove this once its incorporated in rive-react 4 | export default function usePrefersReducedMotion(): boolean { 5 | const [prefersReducedMotion, setPrefersReducedMotion] = 6 | useState(false); 7 | 8 | useEffect(() => { 9 | const canListen = typeof window !== 'undefined' && 'matchMedia' in window; 10 | if (!canListen) { 11 | return; 12 | } 13 | 14 | const mediaQuery = window.matchMedia('(prefers-reduced-motion: reduce)'); 15 | function updatePrefersReducedMotion() { 16 | setPrefersReducedMotion(() => mediaQuery.matches); 17 | } 18 | mediaQuery.addEventListener('change', updatePrefersReducedMotion); 19 | updatePrefersReducedMotion(); 20 | return () => 21 | mediaQuery.removeEventListener('change', updatePrefersReducedMotion); 22 | }, []); 23 | 24 | return prefersReducedMotion; 25 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2023 kanugu rajesh 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /app/Leaderboard/page.tsx: -------------------------------------------------------------------------------- 1 | "use client" 2 | import React from 'react'; 3 | import { Card } from '@/components/ui/card'; 4 | 5 | export default function LeaderboardPage() { 6 | return ( 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 |
UsernameScore
Rajesh500pts
Shravan400pts
madhur300pts
yashwanth200pts
31 |
32 |
33 | ); 34 | } 35 | -------------------------------------------------------------------------------- /public/icons/git.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /public/next.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /utils/useMediaBreakpoint.ts: -------------------------------------------------------------------------------- 1 | // Reference: https://usehooks-ts.com/react-hook/use-media-query 2 | import { useEffect, useState } from 'react' 3 | 4 | function useMediaQuery(query: string): boolean { 5 | const getMatches = (query: string): boolean => { 6 | // Prevents SSR issues 7 | if (typeof window !== 'undefined') { 8 | return window.matchMedia(query).matches 9 | } 10 | return false 11 | } 12 | 13 | const [matches, setMatches] = useState(getMatches(query)) 14 | 15 | function handleChange() { 16 | setMatches(getMatches(query)) 17 | } 18 | 19 | useEffect(() => { 20 | const matchMedia = window.matchMedia(query) 21 | 22 | // Triggered at the first client-side load and if query changes 23 | handleChange() 24 | 25 | // Listen matchMedia 26 | if (matchMedia.addListener) { 27 | matchMedia.addListener(handleChange) 28 | } else { 29 | matchMedia.addEventListener('change', handleChange) 30 | } 31 | 32 | return () => { 33 | if (matchMedia.removeListener) { 34 | matchMedia.removeListener(handleChange) 35 | } else { 36 | matchMedia.removeEventListener('change', handleChange) 37 | } 38 | } 39 | // eslint-disable-next-line react-hooks/exhaustive-deps 40 | }, [query]) 41 | 42 | return matches 43 | } 44 | 45 | export default useMediaQuery; 46 | -------------------------------------------------------------------------------- /components/color-toggle.tsx: -------------------------------------------------------------------------------- 1 | "use client" 2 | 3 | import * as React from "react" 4 | import { Moon, Sun } from "lucide-react" 5 | import { useTheme } from "next-themes" 6 | 7 | import { Button } from "@/components/ui/button" 8 | import { 9 | DropdownMenu, 10 | DropdownMenuContent, 11 | DropdownMenuItem, 12 | DropdownMenuTrigger, 13 | } from "@/components/ui/dropdown-menu" 14 | 15 | export default function ModeToggle() { 16 | const { setTheme } = useTheme() 17 | 18 | return ( 19 | 20 | 21 | 26 | 27 | 28 | setTheme("light")}> 29 | Light 30 | 31 | setTheme("dark")}> 32 | Dark 33 | 34 | setTheme("system")}> 35 | System 36 | 37 | 38 | 39 | ) 40 | } 41 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "student-lms", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "dev": "next dev", 7 | "build": "next build", 8 | "start": "next start", 9 | "lint": "next lint" 10 | }, 11 | "dependencies": { 12 | "@clerk/nextjs": "^4.28.1", 13 | "@google/generative-ai": "^0.1.1", 14 | "@radix-ui/react-dropdown-menu": "^2.0.6", 15 | "@radix-ui/react-label": "^2.0.2", 16 | "@radix-ui/react-progress": "^1.0.3", 17 | "@radix-ui/react-radio-group": "^1.1.3", 18 | "@radix-ui/react-slot": "^1.0.2", 19 | "@radix-ui/react-toggle": "^1.0.3", 20 | "@rive-app/react-canvas": "^3.0.57", 21 | "class-variance-authority": "^0.7.0", 22 | "clsx": "^2.0.0", 23 | "lucide-react": "^0.295.0", 24 | "next": "14.0.3", 25 | "next-themes": "^0.2.1", 26 | "react": "^18", 27 | "react-canvas-confetti": "^1.4.0", 28 | "react-dom": "^18", 29 | "react-hot-toast": "^2.4.1", 30 | "react-markdown": "^9.0.1", 31 | "rive-react": "^4.6.2", 32 | "tailwind-merge": "^2.1.0", 33 | "tailwindcss-animate": "^1.0.7" 34 | }, 35 | "devDependencies": { 36 | "@types/node": "^20", 37 | "@types/react": "^18", 38 | "@types/react-dom": "^18", 39 | "autoprefixer": "^10.0.1", 40 | "eslint": "^8", 41 | "eslint-config-next": "14.0.4", 42 | "postcss": "^8", 43 | "tailwindcss": "^3.3.0", 44 | "typescript": "^5" 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /public/icons/typescript.svg: -------------------------------------------------------------------------------- 1 | 2 | file_type_typescript_official -------------------------------------------------------------------------------- /components/Confetti.tsx: -------------------------------------------------------------------------------- 1 | // @ts-nocheck 2 | import { useCallback, useEffect, useRef } from 'react'; 3 | 4 | import ReactCanvasConfetti from 'react-canvas-confetti'; 5 | 6 | export default function Confetti() { 7 | const refAnimationInstance = useRef(null); 8 | 9 | const getInstance = useCallback(instance => { 10 | refAnimationInstance.current = instance; 11 | }, []); 12 | 13 | const makeShot = useCallback((particleRatio, opts) => { 14 | refAnimationInstance.current && 15 | refAnimationInstance.current({ 16 | ...opts, 17 | origin: { y: 0.7 }, 18 | particleCount: Math.floor(200 * particleRatio) 19 | }); 20 | }, []); 21 | 22 | useEffect(() => fire(), []); 23 | 24 | const fire = useCallback(() => { 25 | makeShot(0.25, { 26 | spread: 26, 27 | startVelocity: 55 28 | }); 29 | 30 | makeShot(0.2, { 31 | spread: 60 32 | }); 33 | 34 | makeShot(0.35, { 35 | spread: 100, 36 | decay: 0.91, 37 | scalar: 0.8 38 | }); 39 | 40 | makeShot(0.1, { 41 | spread: 120, 42 | startVelocity: 25, 43 | decay: 0.92, 44 | scalar: 1.2 45 | }); 46 | 47 | makeShot(0.1, { 48 | spread: 120, 49 | startVelocity: 45 50 | }); 51 | }, [makeShot]); 52 | 53 | return ( 54 | 65 | ); 66 | } -------------------------------------------------------------------------------- /public/icons/tailwindcss.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /components/ui/toggle.tsx: -------------------------------------------------------------------------------- 1 | "use client" 2 | 3 | import * as React from "react" 4 | import * as TogglePrimitive from "@radix-ui/react-toggle" 5 | import { cva, type VariantProps } from "class-variance-authority" 6 | 7 | import { cn } from "@/lib/utils" 8 | 9 | const toggleVariants = cva( 10 | "inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground", 11 | { 12 | variants: { 13 | variant: { 14 | default: "bg-transparent", 15 | outline: 16 | "border border-input bg-transparent hover:bg-accent hover:text-accent-foreground", 17 | }, 18 | size: { 19 | default: "h-10 px-3", 20 | sm: "h-9 px-2.5", 21 | lg: "h-11 px-5", 22 | }, 23 | }, 24 | defaultVariants: { 25 | variant: "default", 26 | size: "default", 27 | }, 28 | } 29 | ) 30 | 31 | const Toggle = React.forwardRef< 32 | React.ElementRef, 33 | React.ComponentPropsWithoutRef & 34 | VariantProps 35 | >(({ className, variant, size, ...props }, ref) => ( 36 | 41 | )) 42 | 43 | Toggle.displayName = TogglePrimitive.Root.displayName 44 | 45 | export { Toggle, toggleVariants } 46 | -------------------------------------------------------------------------------- /components/ui/radio-group.tsx: -------------------------------------------------------------------------------- 1 | "use client" 2 | 3 | import * as React from "react" 4 | import * as RadioGroupPrimitive from "@radix-ui/react-radio-group" 5 | import { Circle } from "lucide-react" 6 | 7 | import { cn } from "@/lib/utils" 8 | 9 | const RadioGroup = React.forwardRef< 10 | React.ElementRef, 11 | React.ComponentPropsWithoutRef 12 | >(({ className, ...props }, ref) => { 13 | return ( 14 | 19 | ) 20 | }) 21 | RadioGroup.displayName = RadioGroupPrimitive.Root.displayName 22 | 23 | const RadioGroupItem = React.forwardRef< 24 | React.ElementRef, 25 | React.ComponentPropsWithoutRef 26 | >(({ className, ...props }, ref) => { 27 | return ( 28 | 36 | 37 | 38 | 39 | 40 | ) 41 | }) 42 | RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName 43 | 44 | export { RadioGroup, RadioGroupItem } 45 | -------------------------------------------------------------------------------- /public/icons/bronzemedal.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /public/icons/javascript.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /public/icons/silvermedal.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /app/globals.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | 5 | @layer base { 6 | :root { 7 | --background: 0 0% 100%; 8 | --foreground: 222.2 84% 4.9%; 9 | 10 | --card: 0 0% 100%; 11 | --card-foreground: 222.2 84% 4.9%; 12 | 13 | --popover: 0 0% 100%; 14 | --popover-foreground: 222.2 84% 4.9%; 15 | 16 | --primary: 222.2 47.4% 11.2%; 17 | --primary-foreground: 210 40% 98%; 18 | 19 | --secondary: 210 40% 96.1%; 20 | --secondary-foreground: 222.2 47.4% 11.2%; 21 | 22 | --muted: 210 40% 96.1%; 23 | --muted-foreground: 215.4 16.3% 46.9%; 24 | 25 | --accent: 210 40% 96.1%; 26 | --accent-foreground: 222.2 47.4% 11.2%; 27 | 28 | --destructive: 0 84.2% 60.2%; 29 | --destructive-foreground: 210 40% 98%; 30 | 31 | --border: 214.3 31.8% 91.4%; 32 | --input: 214.3 31.8% 91.4%; 33 | --ring: 222.2 84% 4.9%; 34 | 35 | --radius: 0.5rem; 36 | } 37 | 38 | .dark { 39 | --background: 222.2 84% 4.9%; 40 | --foreground: 210 40% 98%; 41 | 42 | --card: 222.2 84% 4.9%; 43 | --card-foreground: 210 40% 98%; 44 | 45 | --popover: 222.2 84% 4.9%; 46 | --popover-foreground: 210 40% 98%; 47 | 48 | --primary: 210 40% 98%; 49 | --primary-foreground: 222.2 47.4% 11.2%; 50 | 51 | --secondary: 217.2 32.6% 17.5%; 52 | --secondary-foreground: 210 40% 98%; 53 | 54 | --muted: 217.2 32.6% 17.5%; 55 | --muted-foreground: 215 20.2% 65.1%; 56 | 57 | --accent: 217.2 32.6% 17.5%; 58 | --accent-foreground: 210 40% 98%; 59 | 60 | --destructive: 0 62.8% 30.6%; 61 | --destructive-foreground: 210 40% 98%; 62 | 63 | --border: 217.2 32.6% 17.5%; 64 | --input: 217.2 32.6% 17.5%; 65 | --ring: 212.7 26.8% 83.9%; 66 | } 67 | } 68 | 69 | .backg { 70 | background-color: #d6e2ea; 71 | } 72 | 73 | @layer base { 74 | * { 75 | @apply border-border; 76 | } 77 | body { 78 | @apply bg-background text-foreground; 79 | } 80 | } -------------------------------------------------------------------------------- /components/RiveButton.tsx: -------------------------------------------------------------------------------- 1 | import { useCallback } from "react"; 2 | import { useRive, useStateMachineInput } from "@rive-app/react-canvas"; 3 | 4 | export default function RiveButton() { 5 | const { rive, RiveComponent } = useRive({ 6 | src: "/hero_use_case.riv", 7 | artboard: "Button", 8 | stateMachines: "State Machine 1", 9 | autoplay: true, 10 | shouldDisableRiveListeners: true, 11 | }); 12 | 13 | const isHoverInput = useStateMachineInput(rive, "State Machine 1", "isHover"); 14 | 15 | const onButtonActivate = useCallback(() => { 16 | if (rive && isHoverInput) { 17 | isHoverInput.value = true; 18 | } 19 | }, [rive, isHoverInput]); 20 | 21 | const onButtonDeactivate = useCallback(() => { 22 | if (rive && isHoverInput) { 23 | isHoverInput.value = false; 24 | } 25 | }, [rive, isHoverInput]); 26 | 27 | return ( 28 |
29 |

33 | Explore 34 |

35 |
36 |
37 | 47 | START NOW 48 | 49 |
51 |
52 |
53 | ); 54 | } 55 | -------------------------------------------------------------------------------- /components/ui/button.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react" 2 | import { Slot } from "@radix-ui/react-slot" 3 | import { cva, type VariantProps } from "class-variance-authority" 4 | 5 | import { cn } from "@/lib/utils" 6 | 7 | const buttonVariants = cva( 8 | "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", 9 | { 10 | variants: { 11 | variant: { 12 | default: "bg-primary text-primary-foreground hover:bg-primary/90", 13 | destructive: 14 | "bg-destructive text-destructive-foreground hover:bg-destructive/90", 15 | outline: 16 | "border border-input bg-background hover:bg-accent hover:text-accent-foreground", 17 | secondary: 18 | "bg-secondary text-secondary-foreground hover:bg-secondary/80", 19 | ghost: "hover:bg-accent hover:text-accent-foreground", 20 | link: "text-primary underline-offset-4 hover:underline", 21 | }, 22 | size: { 23 | default: "h-10 px-4 py-2", 24 | sm: "h-9 rounded-md px-3", 25 | lg: "h-11 rounded-md px-8", 26 | icon: "h-10 w-10", 27 | }, 28 | }, 29 | defaultVariants: { 30 | variant: "default", 31 | size: "default", 32 | }, 33 | } 34 | ) 35 | 36 | export interface ButtonProps 37 | extends React.ButtonHTMLAttributes, 38 | VariantProps { 39 | asChild?: boolean 40 | } 41 | 42 | const Button = React.forwardRef( 43 | ({ className, variant, size, asChild = false, ...props }, ref) => { 44 | const Comp = asChild ? Slot : "button" 45 | return ( 46 | 51 | ) 52 | } 53 | ) 54 | Button.displayName = "Button" 55 | 56 | export { Button, buttonVariants } 57 | -------------------------------------------------------------------------------- /public/icons/github.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Github-color 6 | Created with Sketch. 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /public/icons/mongodb.svg: -------------------------------------------------------------------------------- 1 | 2 | folder_type_mongodb -------------------------------------------------------------------------------- /components/ui/card.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react" 2 | 3 | import { cn } from "@/lib/utils" 4 | 5 | const Card = React.forwardRef< 6 | HTMLDivElement, 7 | React.HTMLAttributes 8 | >(({ className, ...props }, ref) => ( 9 |
17 | )) 18 | Card.displayName = "Card" 19 | 20 | const CardHeader = React.forwardRef< 21 | HTMLDivElement, 22 | React.HTMLAttributes 23 | >(({ className, ...props }, ref) => ( 24 |
29 | )) 30 | CardHeader.displayName = "CardHeader" 31 | 32 | const CardTitle = React.forwardRef< 33 | HTMLParagraphElement, 34 | React.HTMLAttributes 35 | >(({ className, ...props }, ref) => ( 36 |

44 | )) 45 | CardTitle.displayName = "CardTitle" 46 | 47 | const CardDescription = React.forwardRef< 48 | HTMLParagraphElement, 49 | React.HTMLAttributes 50 | >(({ className, ...props }, ref) => ( 51 |

56 | )) 57 | CardDescription.displayName = "CardDescription" 58 | 59 | const CardContent = React.forwardRef< 60 | HTMLDivElement, 61 | React.HTMLAttributes 62 | >(({ className, ...props }, ref) => ( 63 |

64 | )) 65 | CardContent.displayName = "CardContent" 66 | 67 | const CardFooter = React.forwardRef< 68 | HTMLDivElement, 69 | React.HTMLAttributes 70 | >(({ className, ...props }, ref) => ( 71 |
76 | )) 77 | CardFooter.displayName = "CardFooter" 78 | 79 | export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent } 80 | -------------------------------------------------------------------------------- /public/icons/goldmedal.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /public/icons/docker.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tailwind.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('tailwindcss').Config} */ 2 | module.exports = { 3 | darkMode: ["class"], 4 | content: [ 5 | './pages/**/*.{ts,tsx}', 6 | './components/**/*.{ts,tsx}', 7 | './app/**/*.{ts,tsx}', 8 | './src/**/*.{ts,tsx}', 9 | ], 10 | theme: { 11 | container: { 12 | center: true, 13 | padding: "2rem", 14 | screens: { 15 | "2xl": "1400px", 16 | }, 17 | }, 18 | extend: { 19 | colors: { 20 | border: "hsl(var(--border))", 21 | input: "hsl(var(--input))", 22 | ring: "hsl(var(--ring))", 23 | background: "hsl(var(--background))", 24 | foreground: "hsl(var(--foreground))", 25 | primary: { 26 | DEFAULT: "hsl(var(--primary))", 27 | foreground: "hsl(var(--primary-foreground))", 28 | }, 29 | secondary: { 30 | DEFAULT: "hsl(var(--secondary))", 31 | foreground: "hsl(var(--secondary-foreground))", 32 | }, 33 | destructive: { 34 | DEFAULT: "hsl(var(--destructive))", 35 | foreground: "hsl(var(--destructive-foreground))", 36 | }, 37 | muted: { 38 | DEFAULT: "hsl(var(--muted))", 39 | foreground: "hsl(var(--muted-foreground))", 40 | }, 41 | accent: { 42 | DEFAULT: "hsl(var(--accent))", 43 | foreground: "hsl(var(--accent-foreground))", 44 | }, 45 | popover: { 46 | DEFAULT: "hsl(var(--popover))", 47 | foreground: "hsl(var(--popover-foreground))", 48 | }, 49 | card: { 50 | DEFAULT: "hsl(var(--card))", 51 | foreground: "hsl(var(--card-foreground))", 52 | }, 53 | }, 54 | borderRadius: { 55 | lg: "var(--radius)", 56 | md: "calc(var(--radius) - 2px)", 57 | sm: "calc(var(--radius) - 4px)", 58 | }, 59 | keyframes: { 60 | "accordion-down": { 61 | from: { height: 0 }, 62 | to: { height: "var(--radix-accordion-content-height)" }, 63 | }, 64 | "accordion-up": { 65 | from: { height: "var(--radix-accordion-content-height)" }, 66 | to: { height: 0 }, 67 | }, 68 | }, 69 | animation: { 70 | "accordion-down": "accordion-down 0.2s ease-out", 71 | "accordion-up": "accordion-up 0.2s ease-out", 72 | }, 73 | }, 74 | }, 75 | plugins: [require("tailwindcss-animate")], 76 | } -------------------------------------------------------------------------------- /app/Imagen/page.tsx: -------------------------------------------------------------------------------- 1 | // @ts-nocheck 2 | "use client" 3 | import React, { useState } from "react"; 4 | import { cn } from "@/lib/utils"; 5 | import "@/styles/ai.css" 6 | 7 | const ImageGenerator = () => { 8 | const [text, setText] = useState(""); 9 | 10 | const onSubmit = async (e) => { 11 | e.preventDefault(); 12 | 13 | // create a div element 14 | const div = document.createElement("div"); 15 | div.id = "imagecontainer"; 16 | 17 | // append div into the body 18 | document.body.appendChild(div); 19 | 20 | const requestOptions = { 21 | method: 'POST', 22 | body: JSON.stringify({ 'text': `${text}` }), // Replace 'Your JSON payload here' with your actual JSON payload 23 | headers: { 24 | "accept": "*/*", 25 | "accept-language": "en-US,en;q=0.9", 26 | "content-type": "application/json", 27 | // "Referer": "http://localhost:3000/", 28 | "Referrer-Policy": "strict-origin-when-cross-origin" 29 | }, 30 | }; 31 | 32 | // fetch("http://129.154.41.10:5000/generate", { 33 | // "headers": { 34 | 35 | // }, 36 | // "body": "{\"text\":\"programming\"}", 37 | // "method": "POST" 38 | // }); 39 | 40 | await fetch('http://129.154.41.10:5000/generate', requestOptions) 41 | .then(response => response.json()) 42 | .then(data => { 43 | const imageString = data.serializedImages; // Assuming the image string is returned in the 'image' property of the response JSON 44 | for (let imagePhoto in imageString) { 45 | const image = new Image(); 46 | let imagen = imageString[imagePhoto]; 47 | image.src = `data:image/jpeg;charset=utf-8;base64, ${imagen}`; 48 | document.getElementById("imagecontainer").appendChild(image); 49 | } 50 | }) 51 | .catch(error => { 52 | console.error('Error:', error); 53 | }); 54 | } 55 | 56 | return ( 57 |
58 |

Imagen

59 |
60 | { 61 | setText(e.target.value); 62 | }} /> 63 | 64 |
65 |
66 | ) 67 | } 68 | 69 | export default ImageGenerator; -------------------------------------------------------------------------------- /styles/LoginFormComponent.css: -------------------------------------------------------------------------------- 1 | .login-form-component-root { 2 | --border-radius-1x: 2px; 3 | --border-radius-2x: calc(var(--border-radius-1x) * 2); 4 | 5 | --spacing-half: 4px; 6 | --spacing-1x: 8px; 7 | --spacing-2x: calc(var(--spacing-1x) * 2); 8 | --spacing-3x: calc(var(--spacing-1x) * 3); 9 | --spacing-4x: calc(var(--spacing-1x) * 4); 10 | 11 | --font-size-16: 16px; 12 | --login-form-el-height: 80px; 13 | 14 | box-sizing: border-box; 15 | display: flex; 16 | flex-direction: column; 17 | align-items: center; 18 | justify-content: center; 19 | font-size: 10px; 20 | color: #000000; 21 | 22 | height: 100%; 23 | min-width: 400px; 24 | margin: 0 auto; 25 | } 26 | 27 | .around { 28 | margin-top: 0; 29 | background-color: #d6e2ea; 30 | margin-bottom: 20px; 31 | } 32 | 33 | .container { 34 | display: flex; 35 | flex-direction: column; 36 | align-items: center; 37 | justify-content: center; 38 | height: 100%; 39 | } 40 | 41 | .form-container { 42 | border-radius: var(--border-radius-2x); 43 | background-color: #ffffff; 44 | padding: var(--spacing-4x); 45 | box-sizing: border-box; 46 | } 47 | 48 | .form-container label { 49 | display: block; 50 | margin-bottom: var(--spacing-half); 51 | box-sizing: border-box; 52 | } 53 | 54 | .form-container input { 55 | height: var(--login-form-el-height); 56 | width: 100%; 57 | box-sizing: border-box; 58 | line-height: var(--login-form-el-height); 59 | font-size: var(--font-size-16); 60 | color: #000000; 61 | background-color: #f1f1f1; 62 | outline: none; 63 | padding: 3px 4px; 64 | cursor: text; 65 | border: none; 66 | height: 30px; 67 | border-radius: var(--border-radius-1x); 68 | } 69 | 70 | .form-container input:focus { 71 | border: 2px solid #000000; 72 | } 73 | 74 | .login-btn { 75 | display: block; 76 | border: none; 77 | padding: 0; 78 | 79 | height: var(--login-form-el-height); 80 | width: 100%; 81 | text-align: center; 82 | line-height: var(--login-btn-height); 83 | font-size: var(--font-size-16); 84 | border-radius: 0 0 10px 10px; 85 | margin: 0 0 var(--spacing-2x); 86 | height: 30px; 87 | cursor: pointer; 88 | font-weight: 500; 89 | background-color: #303030; 90 | color: #f1f1f1; 91 | } 92 | 93 | .rive-wrapper { 94 | width: 100%; 95 | } 96 | 97 | .rive-container { 98 | width: 500px; 99 | height: 400px; 100 | margin: 0 auto; 101 | } 102 | 103 | @media screen and (max-width: 768px) { 104 | .login-form-component-root { 105 | min-width: 100%; 106 | } 107 | 108 | .rive-container { 109 | min-height: 300px; 110 | min-width: 300px; 111 | } 112 | } -------------------------------------------------------------------------------- /public/icons/nextjs.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /data/html5.d.ts: -------------------------------------------------------------------------------- 1 | export const data = { 2 | "questions": [ 3 | { 4 | "question": "What does HTML stand for?", 5 | "options": [ 6 | "Hyper Text Markup Language", 7 | "Hyperlinks and Text Markup Language", 8 | "Home Tool Markup Language", 9 | "None of the above" 10 | ], 11 | "correctOption": "Hyper Text Markup Language" 12 | }, 13 | { 14 | "question": "Which tag is used to define an HTML table?", 15 | "options": [ 16 | "", 17 | "", 18 | "
", 19 | "" 20 | ], 21 | "correctOption": "" 22 | }, 23 | { 24 | "question": "Which attribute is used to specify that an input field must be filled out?", 25 | "options": [ 26 | "required", 27 | "validate", 28 | "mandatory", 29 | "fill" 30 | ], 31 | "correctOption": "required" 32 | }, 33 | { 34 | "question": "Which tag is used to define a hyperlink in HTML?", 35 | "options": [ 36 | "", 37 | "", 38 | "", 39 | "" 40 | ], 41 | "correctOption": "" 42 | }, 43 | { 44 | "question": "Which tag is used to define a list item in HTML?", 45 | "options": [ 46 | "
  • ", 47 | "