├── packages └── webapp │ ├── .eslintrc.json │ ├── src │ ├── app │ │ ├── favicon.ico │ │ ├── layout.tsx │ │ ├── globals.css │ │ └── page.tsx │ ├── lib │ │ └── chatbot │ │ │ ├── ChatMessage.ts │ │ │ └── MessageHandler.tsx │ ├── pages │ │ ├── _app.tsx │ │ ├── rubric-generator │ │ │ ├── layout.tsx │ │ │ └── home │ │ │ │ └── index.tsx │ │ ├── api │ │ │ └── openai.ts │ │ └── assignment-generator │ │ │ └── home │ │ │ └── index.tsx │ ├── components │ │ └── chatbot │ │ │ ├── ChatMessage.tsx │ │ │ └── ChatInput.tsx │ └── styles │ │ ├── home.css │ │ └── globals.css │ ├── postcss.config.mjs │ ├── next.config.mjs │ ├── .gitignore │ ├── tailwind.config.ts │ ├── public │ ├── vercel.svg │ └── next.svg │ ├── tsconfig.json │ ├── package.json │ └── README.md ├── Documents ├── AutoGraderIdeation.pdf ├── Ethical_Implications.md ├── Integration_of_rag.md └── Initial_Ideation_Expansion.md ├── pull_request_template.md ├── Notes ├── Project_Overview_Discussion.md └── RubricGenerator.md ├── Readme.md └── CONTRIBUTING.md /packages/webapp/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "next/core-web-vitals" 3 | } 4 | -------------------------------------------------------------------------------- /Documents/AutoGraderIdeation.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/autograder-org/autoGrader-frontend/HEAD/Documents/AutoGraderIdeation.pdf -------------------------------------------------------------------------------- /packages/webapp/src/app/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/autograder-org/autoGrader-frontend/HEAD/packages/webapp/src/app/favicon.ico -------------------------------------------------------------------------------- /packages/webapp/postcss.config.mjs: -------------------------------------------------------------------------------- 1 | /** @type {import('postcss-load-config').Config} */ 2 | const config = { 3 | plugins: { 4 | tailwindcss: {}, 5 | }, 6 | }; 7 | 8 | export default config; 9 | -------------------------------------------------------------------------------- /packages/webapp/src/lib/chatbot/ChatMessage.ts: -------------------------------------------------------------------------------- 1 | export type ChatMessage = { 2 | role: 'system' | 'user' | 'assistant' | 'function'; 3 | content: string; 4 | name?: string; // Only for function messages 5 | }; 6 | -------------------------------------------------------------------------------- /packages/webapp/src/pages/_app.tsx: -------------------------------------------------------------------------------- 1 | // packages/webapp/src/pages/_app.tsx 2 | import '../styles/globals.css'; // Path to your global CSS file 3 | import type { AppProps } from 'next/app'; 4 | 5 | // The custom App component receives the Component and pageProps 6 | function MyApp({ Component, pageProps }: AppProps) { 7 | return ; 8 | } 9 | 10 | export default MyApp; 11 | -------------------------------------------------------------------------------- /packages/webapp/next.config.mjs: -------------------------------------------------------------------------------- 1 | /** @type {import('next').NextConfig} */ 2 | 3 | import path from 'path'; 4 | 5 | /** 6 | * @type {import('next').NextConfig} 7 | **/ 8 | const nextConfig = { 9 | webpack: (config, { isServer }) => { 10 | config.resolve.alias['@'] = path.join(process.cwd(), 'src'); 11 | return config; 12 | }, 13 | // experimental: { 14 | // appDir: true, 15 | // }, 16 | }; 17 | 18 | export default nextConfig; 19 | -------------------------------------------------------------------------------- /packages/webapp/src/pages/rubric-generator/layout.tsx: -------------------------------------------------------------------------------- 1 | import { Inter } from "next/font/google"; 2 | import "../../styles/globals.css"; 3 | 4 | const inter = Inter({ subsets: ["latin"] }); 5 | 6 | export default function RootLayout({ 7 | children, 8 | }: Readonly<{ 9 | children: React.ReactNode; 10 | }>) { 11 | return ( 12 | 13 | {children} 14 | 15 | ); 16 | } 17 | -------------------------------------------------------------------------------- /pull_request_template.md: -------------------------------------------------------------------------------- 1 | # Title 2 | 3 | 4 | ## Description 5 | 6 | 7 | ## Code files changed 8 | 9 | 10 | ## Screenshots 11 | 12 | 13 | ## Tests 14 | 15 | -------------------------------------------------------------------------------- /packages/webapp/src/pages/api/openai.ts: -------------------------------------------------------------------------------- 1 | import { NextResponse } from 'next/server'; 2 | 3 | export const runtime = 'edge'; 4 | 5 | export default async function handler(request: Request) { 6 | const apiKey = process.env.OPENAI_API_KEY; 7 | 8 | if (!apiKey) { 9 | console.error('Missing OpenAI API Key'); 10 | return new NextResponse('Internal Server Error', { status: 500 }); 11 | } else { 12 | return NextResponse.json({ apiKey }); 13 | } 14 | } -------------------------------------------------------------------------------- /packages/webapp/.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 | -------------------------------------------------------------------------------- /packages/webapp/src/app/layout.tsx: -------------------------------------------------------------------------------- 1 | import type { Metadata } from "next"; 2 | import { Inter } from "next/font/google"; 3 | import "./globals.css"; 4 | 5 | const inter = Inter({ subsets: ["latin"] }); 6 | 7 | export const metadata: Metadata = { 8 | title: "Create Next App", 9 | description: "Generated by create next app", 10 | }; 11 | 12 | export default function RootLayout({ 13 | children, 14 | }: Readonly<{ 15 | children: React.ReactNode; 16 | }>) { 17 | return ( 18 | 19 | {children} 20 | 21 | ); 22 | } 23 | -------------------------------------------------------------------------------- /packages/webapp/tailwind.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from "tailwindcss"; 2 | 3 | const config: Config = { 4 | content: [ 5 | "./src/pages/**/*.{js,ts,jsx,tsx,mdx}", 6 | "./src/components/**/*.{js,ts,jsx,tsx,mdx}", 7 | "./src/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 | -------------------------------------------------------------------------------- /packages/webapp/public/vercel.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/webapp/src/components/chatbot/ChatMessage.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; 3 | import { faUser, faRobot } from '@fortawesome/free-solid-svg-icons'; 4 | import { ChatMessage as ChatMessageType } from '@/lib/chatbot/ChatMessage'; 5 | 6 | interface ChatMessageProps { 7 | message: ChatMessageType; 8 | } 9 | 10 | const ChatMessage: React.FC = ({ message }) => { 11 | const icon = message.role === 'user' ? faUser : faRobot; 12 | return ( 13 |
14 |
15 | {message.content} 16 |
17 | ); 18 | }; 19 | 20 | export default ChatMessage; 21 | -------------------------------------------------------------------------------- /packages/webapp/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": "node", 15 | "resolveJsonModule": true, 16 | "isolatedModules": true, 17 | "jsx": "preserve", 18 | "incremental": true, 19 | "plugins": [ 20 | { 21 | "name": "next" 22 | } 23 | ], 24 | "paths": { 25 | "@/*": [ 26 | "./src/*" 27 | ] 28 | }, 29 | "forceConsistentCasingInFileNames": true 30 | }, 31 | "include": [ 32 | "next-env.d.ts", 33 | "**/*.ts", 34 | "**/*.tsx", 35 | ".next/types/**/*.ts" 36 | ], 37 | "exclude": [ 38 | "node_modules" 39 | ] 40 | } 41 | -------------------------------------------------------------------------------- /packages/webapp/src/components/chatbot/ChatInput.tsx: -------------------------------------------------------------------------------- 1 | import React, { useState } from 'react'; 2 | 3 | interface ChatInputProps { 4 | onSendMessage: (message: string) => void; 5 | isLoading: boolean; // to display loading state 6 | } 7 | 8 | const ChatInput: React.FC = ({ onSendMessage, isLoading }) => { 9 | const [input, setInput] = useState(''); 10 | 11 | const handleSubmit = (e: React.FormEvent) => { 12 | e.preventDefault(); 13 | if (input.trim()) { 14 | onSendMessage(input); 15 | setInput(''); 16 | } 17 | }; 18 | 19 | return ( 20 |
21 |