├── app ├── (pages) │ ├── quiz │ │ ├── components │ │ │ ├── Questions │ │ │ │ ├── components │ │ │ │ │ └── AnswerOptions │ │ │ │ │ │ ├── MultipleSelect │ │ │ │ │ │ ├── styles.module.scss │ │ │ │ │ │ └── MultipleSelect.tsx │ │ │ │ │ │ ├── Matching │ │ │ │ │ │ └── styles.module.scss │ │ │ │ │ │ └── styles.module.scss │ │ │ │ └── styles.module.scss │ │ │ ├── QuizSetup │ │ │ │ ├── styles.module.scss │ │ │ │ └── QuizSetup.tsx │ │ │ └── Results │ │ │ │ ├── Results.tsx │ │ │ │ └── styles.module.scss │ │ ├── styles.module.scss │ │ ├── page.tsx │ │ └── playground │ │ │ ├── page.tsx │ │ │ └── styles.module.scss │ ├── algorithms │ │ ├── styles.module.scss │ │ ├── page.tsx │ │ ├── components │ │ │ ├── AlgorthmsSetUp │ │ │ │ ├── styles.module.scss │ │ │ │ └── AlgorthmsSetUp.tsx │ │ │ └── AlgorthmsStart │ │ │ │ ├── AlgorthmsStart.tsx │ │ │ │ └── styles.module.scss │ │ └── playground │ │ │ ├── styles.module.scss │ │ │ ├── Workspace │ │ │ ├── Workspace.tsx │ │ │ └── styles.module.scss │ │ │ └── page.tsx │ └── activity-selector │ │ ├── page.tsx │ │ └── styles.module.scss ├── components │ ├── Ballon │ │ ├── styles.module.scss │ │ └── Ballon.tsx │ ├── Separator │ │ ├── styles.module.scss │ │ └── Separator.tsx │ ├── TextBox │ │ ├── TextBox.tsx │ │ └── styles.module.scss │ ├── ButtonBack │ │ ├── ButtonBack.tsx │ │ └── styles.module.scss │ ├── SnackProvider │ │ └── SnackProvider.tsx │ ├── ButtonClose │ │ ├── ButtonClose.tsx │ │ └── styles.module.scss │ ├── TextBoxApiKey │ │ ├── TextBoxApiKey.tsx │ │ └── styles.module.scss │ ├── Loading │ │ ├── Loading.tsx │ │ └── styles.module.scss │ ├── Button │ │ ├── ButtonLink.tsx │ │ ├── Button.tsx │ │ └── styles.module.scss │ ├── Header │ │ ├── Header.tsx │ │ └── styles.module.scss │ ├── Modal │ │ ├── styles.module.scss │ │ └── Modal.tsx │ ├── Footer │ │ ├── Footer.tsx │ │ └── styles.module.scss │ ├── ButtonCopy │ │ ├── ButtonCopy.tsx │ │ └── styles.module.scss │ ├── Combobox │ │ ├── styles.module.scss │ │ └── Combobox.tsx │ ├── Levels │ │ ├── styles.module.scss │ │ └── Levels.tsx │ ├── CodeEditor │ │ ├── styles.module.scss │ │ └── CodeEditor.tsx │ ├── CircularProgress │ │ └── CircularProgress.tsx │ ├── QuizBot │ │ ├── ParseTextToJSX.tsx │ │ ├── QuizBot.tsx │ │ └── styles.module.scss │ └── AlgorithmBot │ │ ├── styles.module.scss │ │ └── AlgorithmBot.tsx ├── utils │ ├── helpers.ts │ ├── dataFetch.ts │ └── store.ts ├── interfaces │ ├── languages.ts │ ├── quiz.ts │ └── algorithm.ts ├── api │ ├── _services │ │ ├── successfulResponses.ts │ │ └── errors.ts │ ├── chat │ │ └── route.ts │ └── runcode │ │ └── route.tsx ├── layout.tsx ├── page.tsx ├── globals.css └── page.module.css ├── public ├── grid.png ├── quiz.png ├── c_icon.png ├── aws_icon.png ├── backcode.webp ├── cpp_icon.png ├── css_icon.png ├── go_icon.png ├── html_icon.png ├── java_icon.png ├── lua_icon.png ├── node_icon.png ├── perl_icon.png ├── php_icon.png ├── ruby_icon.png ├── rust_icon.png ├── sql_icon.png ├── vue_icon.png ├── azure_icon.png ├── csharp_icon.png ├── django_icon.png ├── docker_icon.png ├── frame_code.png ├── frame_code2.png ├── kotlin_icon.png ├── mongo_icon.png ├── python_icon.png ├── react_icon.png ├── scala_icon.png ├── swift_icon.png ├── angular_icon.png ├── bootstrap_icon.png ├── flutter_icon.png ├── jenkins_icon.png ├── tailwind_icon.png ├── terraform_icon.png ├── javascript_icon.png ├── typescript_icon.png └── logo.svg ├── .eslintrc.json ├── next.config.mjs ├── .gitignore ├── tsconfig.json ├── package.json └── README.md /app/(pages)/quiz/components/Questions/components/AnswerOptions/MultipleSelect/styles.module.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/grid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AletzMan/code_challenge_and_quiz/HEAD/public/grid.png -------------------------------------------------------------------------------- /public/quiz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AletzMan/code_challenge_and_quiz/HEAD/public/quiz.png -------------------------------------------------------------------------------- /public/c_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AletzMan/code_challenge_and_quiz/HEAD/public/c_icon.png -------------------------------------------------------------------------------- /public/aws_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AletzMan/code_challenge_and_quiz/HEAD/public/aws_icon.png -------------------------------------------------------------------------------- /public/backcode.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AletzMan/code_challenge_and_quiz/HEAD/public/backcode.webp -------------------------------------------------------------------------------- /public/cpp_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AletzMan/code_challenge_and_quiz/HEAD/public/cpp_icon.png -------------------------------------------------------------------------------- /public/css_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AletzMan/code_challenge_and_quiz/HEAD/public/css_icon.png -------------------------------------------------------------------------------- /public/go_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AletzMan/code_challenge_and_quiz/HEAD/public/go_icon.png -------------------------------------------------------------------------------- /public/html_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AletzMan/code_challenge_and_quiz/HEAD/public/html_icon.png -------------------------------------------------------------------------------- /public/java_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AletzMan/code_challenge_and_quiz/HEAD/public/java_icon.png -------------------------------------------------------------------------------- /public/lua_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AletzMan/code_challenge_and_quiz/HEAD/public/lua_icon.png -------------------------------------------------------------------------------- /public/node_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AletzMan/code_challenge_and_quiz/HEAD/public/node_icon.png -------------------------------------------------------------------------------- /public/perl_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AletzMan/code_challenge_and_quiz/HEAD/public/perl_icon.png -------------------------------------------------------------------------------- /public/php_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AletzMan/code_challenge_and_quiz/HEAD/public/php_icon.png -------------------------------------------------------------------------------- /public/ruby_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AletzMan/code_challenge_and_quiz/HEAD/public/ruby_icon.png -------------------------------------------------------------------------------- /public/rust_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AletzMan/code_challenge_and_quiz/HEAD/public/rust_icon.png -------------------------------------------------------------------------------- /public/sql_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AletzMan/code_challenge_and_quiz/HEAD/public/sql_icon.png -------------------------------------------------------------------------------- /public/vue_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AletzMan/code_challenge_and_quiz/HEAD/public/vue_icon.png -------------------------------------------------------------------------------- /public/azure_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AletzMan/code_challenge_and_quiz/HEAD/public/azure_icon.png -------------------------------------------------------------------------------- /public/csharp_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AletzMan/code_challenge_and_quiz/HEAD/public/csharp_icon.png -------------------------------------------------------------------------------- /public/django_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AletzMan/code_challenge_and_quiz/HEAD/public/django_icon.png -------------------------------------------------------------------------------- /public/docker_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AletzMan/code_challenge_and_quiz/HEAD/public/docker_icon.png -------------------------------------------------------------------------------- /public/frame_code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AletzMan/code_challenge_and_quiz/HEAD/public/frame_code.png -------------------------------------------------------------------------------- /public/frame_code2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AletzMan/code_challenge_and_quiz/HEAD/public/frame_code2.png -------------------------------------------------------------------------------- /public/kotlin_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AletzMan/code_challenge_and_quiz/HEAD/public/kotlin_icon.png -------------------------------------------------------------------------------- /public/mongo_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AletzMan/code_challenge_and_quiz/HEAD/public/mongo_icon.png -------------------------------------------------------------------------------- /public/python_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AletzMan/code_challenge_and_quiz/HEAD/public/python_icon.png -------------------------------------------------------------------------------- /public/react_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AletzMan/code_challenge_and_quiz/HEAD/public/react_icon.png -------------------------------------------------------------------------------- /public/scala_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AletzMan/code_challenge_and_quiz/HEAD/public/scala_icon.png -------------------------------------------------------------------------------- /public/swift_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AletzMan/code_challenge_and_quiz/HEAD/public/swift_icon.png -------------------------------------------------------------------------------- /public/angular_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AletzMan/code_challenge_and_quiz/HEAD/public/angular_icon.png -------------------------------------------------------------------------------- /public/bootstrap_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AletzMan/code_challenge_and_quiz/HEAD/public/bootstrap_icon.png -------------------------------------------------------------------------------- /public/flutter_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AletzMan/code_challenge_and_quiz/HEAD/public/flutter_icon.png -------------------------------------------------------------------------------- /public/jenkins_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AletzMan/code_challenge_and_quiz/HEAD/public/jenkins_icon.png -------------------------------------------------------------------------------- /public/tailwind_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AletzMan/code_challenge_and_quiz/HEAD/public/tailwind_icon.png -------------------------------------------------------------------------------- /public/terraform_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AletzMan/code_challenge_and_quiz/HEAD/public/terraform_icon.png -------------------------------------------------------------------------------- /public/javascript_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AletzMan/code_challenge_and_quiz/HEAD/public/javascript_icon.png -------------------------------------------------------------------------------- /public/typescript_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AletzMan/code_challenge_and_quiz/HEAD/public/typescript_icon.png -------------------------------------------------------------------------------- /app/components/Ballon/styles.module.scss: -------------------------------------------------------------------------------- 1 | .animation { 2 | position: absolute; 3 | top: 1em; 4 | right: 1em; 5 | } -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "next/core-web-vitals", 3 | "rules": { 4 | "semi": [ 5 | 1, 6 | "never" 7 | ] 8 | } 9 | } -------------------------------------------------------------------------------- /app/components/Separator/styles.module.scss: -------------------------------------------------------------------------------- 1 | .separator { 2 | height: 1px; 3 | width: 100%; 4 | border: 1px solid #FFFFFF09; 5 | margin: 0.5em 0; 6 | } -------------------------------------------------------------------------------- /app/components/Separator/Separator.tsx: -------------------------------------------------------------------------------- 1 | import styles from "./styles.module.scss" 2 | 3 | export function Separator() { 4 | 5 | return ( 6 |
7 | ) 8 | } -------------------------------------------------------------------------------- /next.config.mjs: -------------------------------------------------------------------------------- 1 | /** @type {import('next').NextConfig} */ 2 | const nextConfig = { 3 | reactStrictMode: false, 4 | images: { 5 | unoptimized: true, 6 | }, 7 | } 8 | 9 | export default nextConfig 10 | -------------------------------------------------------------------------------- /app/components/TextBox/TextBox.tsx: -------------------------------------------------------------------------------- 1 | import { InputHTMLAttributes } from "react" 2 | import styles from "./styles.module.scss" 3 | 4 | 5 | export function TextBox(props: InputHTMLAttributes) { 6 | return ( 7 | 8 | 9 | 10 | ) 11 | } -------------------------------------------------------------------------------- /app/components/ButtonBack/ButtonBack.tsx: -------------------------------------------------------------------------------- 1 | import Link from "next/link" 2 | import { TargetIcon } from "../Icons" 3 | import styles from "./styles.module.scss" 4 | 5 | 6 | interface Props { 7 | href: string 8 | children: JSX.Element 9 | } 10 | export const ButtonBack = ({ href, children }: Props) => { 11 | return ( 12 | {children} 13 | ) 14 | } -------------------------------------------------------------------------------- /app/components/SnackProvider/SnackProvider.tsx: -------------------------------------------------------------------------------- 1 | 2 | "use client" 3 | 4 | import { SnackbarProvider } from "notistack" 5 | 6 | interface Props { 7 | children: JSX.Element 8 | } 9 | 10 | export function SnackProvider({ children }: Props) { 11 | return ( 12 | 13 | {children} 14 | 15 | ) 16 | } -------------------------------------------------------------------------------- /app/components/ButtonClose/ButtonClose.tsx: -------------------------------------------------------------------------------- 1 | import { ButtonHTMLAttributes } from "react" 2 | import styles from "./styles.module.scss" 3 | import { CloseIcon } from "../Icons" 4 | 5 | 6 | export function ButtonClose(props: ButtonHTMLAttributes) { 7 | 8 | return ( 9 | 13 | ) 14 | } -------------------------------------------------------------------------------- /app/components/TextBox/styles.module.scss: -------------------------------------------------------------------------------- 1 | .input { 2 | padding: 0.25em 1em; 3 | font-size: 1.1em; 4 | color: var(--font-color); 5 | font-family: var(--font-family); 6 | border-radius: 0.25em; 7 | border: 1px solid var(--grayblack-color); 8 | background-color: var(--black-color); 9 | 10 | &:focus { 11 | outline: 2px solid var(--purple-color); 12 | } 13 | 14 | &:disabled { 15 | opacity: 0.7; 16 | cursor: not-allowed; 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /app/utils/helpers.ts: -------------------------------------------------------------------------------- 1 | interface ICurrentDate { 2 | date: string 3 | hour: string 4 | } 5 | 6 | export const GetCurrentDay = (): ICurrentDate => { 7 | const now = new Date() 8 | const day = now.getDate() 9 | const month = now.getMonth() 10 | const hour = now.getHours() 11 | const minute = now.getMinutes() 12 | 13 | 14 | const newDate: ICurrentDate = { 15 | date: `${day} ${month}`, 16 | hour: `${hour}:${minute}` 17 | } 18 | 19 | 20 | return newDate 21 | } -------------------------------------------------------------------------------- /app/(pages)/algorithms/styles.module.scss: -------------------------------------------------------------------------------- 1 | .main { 2 | position: relative; 3 | display: flex; 4 | flex-direction: column; 5 | align-items: center; 6 | justify-content: flex-start; 7 | gap: 0.5em; 8 | margin: 0.5em; 9 | height: calc(100svh - 1em); 10 | border-radius: 0.25em; 11 | border: 1px solid var(--grayblack-color); 12 | z-index: 50; 13 | } 14 | 15 | 16 | .header { 17 | display: flex; 18 | justify-content: flex-start; 19 | width: 100%; 20 | padding: 0.5em; 21 | } -------------------------------------------------------------------------------- /app/(pages)/quiz/styles.module.scss: -------------------------------------------------------------------------------- 1 | .main { 2 | position: relative; 3 | display: flex; 4 | flex-direction: column; 5 | align-items: center; 6 | justify-content: space-between; 7 | gap: 1em; 8 | height: calc(100svh - 1em); 9 | margin: 0.5em; 10 | border: 1px solid var(--gray-color); 11 | border-radius: 0.25em; 12 | background-color: #10101010; 13 | } 14 | 15 | .header { 16 | display: flex; 17 | justify-content: flex-start; 18 | padding: 0.5em; 19 | width: 100%; 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 | -------------------------------------------------------------------------------- /app/components/TextBoxApiKey/TextBoxApiKey.tsx: -------------------------------------------------------------------------------- 1 | import { InputHTMLAttributes } from "react" 2 | import styles from "./styles.module.scss" 3 | 4 | interface Props { 5 | props: InputHTMLAttributes 6 | error: boolean 7 | } 8 | 9 | export function TextBoxApiKey({ props, error }: Props) { 10 | return ( 11 |
12 | 13 | 14 |
15 | ) 16 | } -------------------------------------------------------------------------------- /app/components/Loading/Loading.tsx: -------------------------------------------------------------------------------- 1 | import styles from "./styles.module.scss" 2 | 3 | interface Props { 4 | title: string 5 | } 6 | 7 | export function Loading({ title }: Props) { 8 | return ( 9 |
10 |
11 | 12 | 13 | 14 |
15 |

{title}

16 |
17 | ) 18 | } -------------------------------------------------------------------------------- /app/components/Button/ButtonLink.tsx: -------------------------------------------------------------------------------- 1 | import React from "react" 2 | import styles from "./styles.module.scss" 3 | import Link from "next/link" 4 | 5 | interface Props { 6 | href: string 7 | children?: React.ReactElement 8 | isSecondary?: boolean 9 | title: string 10 | className?: string 11 | } 12 | 13 | export function ButtonLink({ href, children, isSecondary, title, className }: Props) { 14 | 15 | return ( 16 | 17 | {children} 18 | 19 | ) 20 | } -------------------------------------------------------------------------------- /app/interfaces/languages.ts: -------------------------------------------------------------------------------- 1 | export interface IItemCategory { 2 | option: string, 3 | value: string, 4 | functionSyntax: string, 5 | color: string 6 | logo: JSX.Element | null 7 | language: string, 8 | version: string 9 | } 10 | 11 | export interface IOutputRunCode { 12 | language: string, 13 | version: string, 14 | run: IOutputRun 15 | } 16 | 17 | export interface IResponseOutputRunCode { 18 | error: boolean, 19 | response: IOutputRunCode | null 20 | } 21 | 22 | export interface IOutputRun { 23 | stdout: string, 24 | stderr: string, 25 | code: number, 26 | signal: unknown, 27 | output: string 28 | } -------------------------------------------------------------------------------- /app/components/Button/Button.tsx: -------------------------------------------------------------------------------- 1 | import { ButtonHTMLAttributes, LinkHTMLAttributes } from "react" 2 | import styles from "./styles.module.scss" 3 | 4 | 5 | export function Button(props: ButtonHTMLAttributes) { 6 | 7 | return ( 8 | 16 | ) 17 | } -------------------------------------------------------------------------------- /app/components/Header/Header.tsx: -------------------------------------------------------------------------------- 1 | import Link from "next/link" 2 | import { Button } from "../Button/Button" 3 | import { LogoCCQ } from "../Icons" 4 | import styles from "./styles.module.scss" 5 | 6 | export function Header() { 7 | return ( 8 |
9 | 10 | 11 |

Code Challenge & Quiz

12 | 13 |
14 | Invitado 15 | 16 |
17 |
18 | ) 19 | } -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "lib": [ 4 | "dom", 5 | "dom.iterable", 6 | "esnext" 7 | ], 8 | "allowJs": true, 9 | "skipLibCheck": true, 10 | "strict": true, 11 | "noEmit": true, 12 | "esModuleInterop": true, 13 | "module": "esnext", 14 | "moduleResolution": "bundler", 15 | "resolveJsonModule": true, 16 | "isolatedModules": true, 17 | "jsx": "preserve", 18 | "incremental": true, 19 | "plugins": [ 20 | { 21 | "name": "next" 22 | } 23 | ], 24 | "paths": { 25 | "@/*": [ 26 | "./*" 27 | ] 28 | } 29 | }, 30 | "include": [ 31 | "next-env.d.ts", 32 | "**/*.ts", 33 | "**/*.tsx", 34 | ".next/types/**/*.ts" 35 | ], 36 | "exclude": [ 37 | "node_modules" 38 | ] 39 | } -------------------------------------------------------------------------------- /app/components/ButtonClose/styles.module.scss: -------------------------------------------------------------------------------- 1 | .button { 2 | display: flex; 3 | align-items: center; 4 | justify-content: center; 5 | width: 2em; 6 | height: 2em; 7 | border-radius: 0.25em; 8 | color: var(--font-color); 9 | font-family: var(--font-family); 10 | border: 2px solid #FF0000; 11 | background-color: #FF0000; 12 | transition: all 0.3s ease-in-out; 13 | filter: brightness(75%); 14 | cursor: pointer; 15 | 16 | &:hover:not(:disabled) { 17 | filter: brightness(100%); 18 | box-shadow: 0 0 3px 1px #FF000080; 19 | } 20 | 21 | 22 | &:disabled { 23 | opacity: 0.7; 24 | cursor: not-allowed; 25 | } 26 | 27 | 28 | &_close { 29 | width: 1.75em; 30 | height: 1.75em; 31 | color: var(--font-color); 32 | } 33 | 34 | 35 | 36 | } -------------------------------------------------------------------------------- /app/components/Modal/styles.module.scss: -------------------------------------------------------------------------------- 1 | .dialog { 2 | position: absolute; 3 | top: 0; 4 | left: 0; 5 | width: 100%; 6 | min-width: 320px; 7 | height: max-content; 8 | display: flex; 9 | align-items: center; 10 | justify-content: center; 11 | flex-direction: column; 12 | background-color: transparent; 13 | background-color: #FFFFFF; 14 | z-index: 20; 15 | border: none; 16 | transform-origin: center center; 17 | 18 | 19 | &_click { 20 | animation: click 30ms linear alternate; 21 | 22 | @keyframes click { 23 | 0% { 24 | transform: rotateZ(-5deg); 25 | } 26 | 27 | 50% { 28 | transform: rotateZ(0deg) scale(.8); 29 | } 30 | 31 | 100% { 32 | transform: rotateZ(5deg); 33 | } 34 | } 35 | } 36 | 37 | } -------------------------------------------------------------------------------- /app/components/Footer/Footer.tsx: -------------------------------------------------------------------------------- 1 | import Link from "next/link" 2 | import { GitHubIcon, LinkedInIcon, LogoCCQ } from "../Icons" 3 | import styles from "./styles.module.scss" 4 | export function Footer() { 5 | return ( 6 |
7 | 8 |

Creado por: Alejandro Garcia Alonso

9 | 17 |
18 | ) 19 | } -------------------------------------------------------------------------------- /app/api/_services/successfulResponses.ts: -------------------------------------------------------------------------------- 1 | import { NextResponse } from "next/server" 2 | 3 | 4 | export const SuccessUpdate = (data: unknown) => { 5 | return NextResponse.json( 6 | { 7 | error: false, 8 | message: "Updated successfully", 9 | data: data, 10 | }, 11 | { status: 200 } 12 | ) 13 | } 14 | 15 | export const SuccessDelete = () => { 16 | return NextResponse.json( 17 | { 18 | error: false, 19 | message: "Deleted successfully", 20 | }, 21 | { status: 200 } 22 | ) 23 | } 24 | 25 | export const SuccessCreate = (data: unknown) => { 26 | return NextResponse.json( 27 | { 28 | error: false, 29 | message: "Created successfully", 30 | data: data, 31 | }, 32 | { status: 201 } 33 | ) 34 | } 35 | 36 | export const SuccessResponse = (data: unknown) => { 37 | return NextResponse.json( 38 | { 39 | error: false, 40 | response: data, 41 | }, 42 | { status: 200 } 43 | ) 44 | } 45 | -------------------------------------------------------------------------------- /app/api/chat/route.ts: -------------------------------------------------------------------------------- 1 | import { google } from '@ai-sdk/google' 2 | import { convertToCoreMessages, streamText } from 'ai' 3 | 4 | // Allow streaming responses up to 30 seconds 5 | export const maxDuration = 30 6 | 7 | export async function POST(req: Request) { 8 | const { messages } = await req.json() 9 | 10 | const result = await streamText({ 11 | model: google("models/gemini-1.5-flash-latest"), 12 | system: `You are a programming assistant and should only respond to questions and topics related to programming and computer science. If a user attempts to change the topic or requests information outside this scope, politely remind them that you can only assist with programming and computer science topics. Do not respond to or acknowledge requests to deviate from this subject. Always stay focused on programming and related technical matters.`, 13 | messages: convertToCoreMessages(messages), 14 | }) 15 | 16 | return result.toDataStreamResponse() 17 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "code_challenge_quiz", 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 | "@ai-sdk/google": "^0.0.30", 13 | "@ai-sdk/openai": "^0.0.42", 14 | "@monaco-editor/react": "^4.6.0", 15 | "@react-spring/web": "^9.7.4", 16 | "ai": "^3.3.0", 17 | "next": "14.2.5", 18 | "notistack": "^3.0.1", 19 | "re-resizable": "^6.9.17", 20 | "react": "^18", 21 | "react-code-blocks": "^0.1.6", 22 | "react-dom": "^18", 23 | "react-draggable": "^4.4.6", 24 | "sass": "^1.77.8", 25 | "zod": "^3.23.8", 26 | "zustand": "^4.5.4" 27 | }, 28 | "devDependencies": { 29 | "@types/node": "^20", 30 | "@types/react": "^18", 31 | "@types/react-dom": "^18", 32 | "eslint": "^8", 33 | "eslint-config-next": "14.2.5", 34 | "typescript": "^5" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /app/components/Footer/styles.module.scss: -------------------------------------------------------------------------------- 1 | .footer { 2 | position: sticky; 3 | bottom: 0; 4 | display: flex; 5 | align-items: center; 6 | justify-content: space-between; 7 | width: 100%; 8 | min-height: 4em; 9 | padding: 0 1em; 10 | border-top: 2px solid var(--grayblack-color); 11 | background-color: var(--black-color); 12 | z-index: 10; 13 | 14 | &_logo { 15 | width: 3em; 16 | height: 3em; 17 | color: var(--yellow-color); 18 | } 19 | 20 | &_name { 21 | font-size: 0.85em; 22 | color: var(--fontsecond-color); 23 | text-align: center; 24 | text-wrap: balance; 25 | } 26 | 27 | &_nav { 28 | display: flex; 29 | gap: 1em; 30 | } 31 | 32 | &_link { 33 | color: var(--font-color); 34 | 35 | &:hover { 36 | color: var(--purple-color); 37 | } 38 | } 39 | 40 | &_icon { 41 | width: 2em; 42 | height: 2em; 43 | } 44 | } -------------------------------------------------------------------------------- /app/components/TextBoxApiKey/styles.module.scss: -------------------------------------------------------------------------------- 1 | .key { 2 | display: flex; 3 | flex-direction: column; 4 | align-items: center; 5 | width: 100%; 6 | 7 | &_label { 8 | color: var(--fontsecond-color); 9 | font-size: 0.9em; 10 | } 11 | 12 | &_input { 13 | padding: 0.75em 1em; 14 | font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif, 'Arial Narrow', Arial, sans-serif; 15 | font-size: 1em; 16 | width: 90%; 17 | max-width: 32em; 18 | color: var(--font-color); 19 | border-radius: 0.5em; 20 | border: 1px solid var(--gray-color); 21 | background-color: var(--black-color); 22 | 23 | 24 | @media (width < 600px) { 25 | width: calc(100svw - 2em); 26 | } 27 | 28 | &:focus { 29 | outline: 1px solid var(--purple-color); 30 | } 31 | 32 | &Error { 33 | border: 1px dashed #FF2020; 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /app/(pages)/algorithms/page.tsx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | import { ButtonBack } from "@/app/components/ButtonBack/ButtonBack" 5 | import { AlgorthmsStart } from "./components/AlgorthmsStart/AlgorthmsStart" 6 | import styles from "./styles.module.scss" 7 | import { SnackProvider } from "@/app/components/SnackProvider/SnackProvider" 8 | import { TargetIcon } from "@/app/components/Icons" 9 | 10 | 11 | export default function Page() { 12 | return ( 13 | <> 14 |
15 |
16 | 17 | <> 18 | 19 | {"Elegir desafío"} 20 | 21 | 22 |
23 | 24 | 25 | 26 |
27 | 28 | ) 29 | } -------------------------------------------------------------------------------- /app/(pages)/quiz/page.tsx: -------------------------------------------------------------------------------- 1 | 2 | import styles from "./styles.module.scss" 3 | import { SnackProvider } from "@/app/components/SnackProvider/SnackProvider" 4 | import { Footer } from "@/app/components/Footer/Footer" 5 | import { QuizSetup } from "./components/QuizSetup/QuizSetup" 6 | import Link from "next/link" 7 | import { TargetIcon } from "@/app/components/Icons" 8 | import { ButtonBack } from "@/app/components/ButtonBack/ButtonBack" 9 | 10 | 11 | export default function Page() { 12 | return ( 13 |
14 |
15 | 16 | <> 17 | 18 | {"Elegir desafío"} 19 | 20 | 21 |
22 | 23 | 24 | 25 |
26 |
27 | ) 28 | } -------------------------------------------------------------------------------- /app/components/ButtonCopy/ButtonCopy.tsx: -------------------------------------------------------------------------------- 1 | "use client" 2 | import { ButtonHTMLAttributes, useState } from "react" 3 | import styles from "./styles.module.scss" 4 | import { CheckIcon, CloseIcon, CopyIcon } from "../Icons" 5 | 6 | interface Props { 7 | textToCopy: string 8 | } 9 | 10 | export function ButtonCopy({ textToCopy }: Props) { 11 | const [copy, setCopy] = useState(false) 12 | 13 | const HandleCopyClipBoard = () => { 14 | navigator.clipboard.writeText(textToCopy) 15 | setCopy(true) 16 | 17 | setTimeout(() => { 18 | setCopy(false) 19 | }, 1500) 20 | } 21 | 22 | return ( 23 | 29 | ) 30 | } -------------------------------------------------------------------------------- /app/components/Combobox/styles.module.scss: -------------------------------------------------------------------------------- 1 | .combobox { 2 | position: relative; 3 | display: flex; 4 | flex-direction: column; 5 | width: max-content; 6 | min-width: 10.5em; 7 | border: none; 8 | 9 | 10 | } 11 | 12 | .logo { 13 | position: absolute; 14 | top: 1.19em; 15 | display: flex; 16 | align-items: center; 17 | width: 100%; 18 | padding: 0 0 0 0.35em; 19 | height: 2.2em; 20 | opacity: 0.8; 21 | overflow: hidden; 22 | z-index: 10; 23 | pointer-events: none; 24 | 25 | &>svg { 26 | width: 1.45em; 27 | height: 1.45em; 28 | } 29 | } 30 | 31 | .label { 32 | font-size: 0.8em; 33 | color: #3298d0; 34 | } 35 | 36 | .select { 37 | text-align: center; 38 | padding: 0.25em 1em 0.25em 0.75em; 39 | font-size: 1em; 40 | font-family: var(--font-family); 41 | background-color: var(--black-color); 42 | color: var(--font-color); 43 | border-radius: 0.25em; 44 | 45 | 46 | &:focus { 47 | outline: 1px solid var(--purple-color); 48 | } 49 | 50 | } -------------------------------------------------------------------------------- /app/layout.tsx: -------------------------------------------------------------------------------- 1 | import type { Metadata } from "next" 2 | import { Jost } from "next/font/google" 3 | import "./globals.css" 4 | import { Header } from "./components/Header/Header" 5 | import { Footer } from "./components/Footer/Footer" 6 | import BouncingBall from "./components/Ballon/Ballon" 7 | 8 | const font = Jost({ subsets: ["latin"] }) 9 | 10 | export const metadata: Metadata = { 11 | title: "Code Challenge & Quiz", 12 | description: "Desafíos de programación y cuestionarios para poner a prueba tus habilidades de codificación.", icons: "/logo.svg", 13 | } 14 | 15 | export default function RootLayout({ 16 | children, 17 | }: Readonly<{ 18 | children: React.ReactNode; 19 | }>) { 20 | return ( 21 | 22 | 23 | 24 |
25 | 26 |
27 | {/*
*/} 28 | {children} 29 | {/*