starsnatched commited on
Commit
b8a8ccd
·
1 Parent(s): e0fd509

Remove frontend application files and configurations

Browse files
frontend/.env.example DELETED
@@ -1 +0,0 @@
1
- NEXT_PUBLIC_API_URL=http://localhost:8000
 
 
frontend/.gitignore DELETED
@@ -1,41 +0,0 @@
1
- # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2
-
3
- # dependencies
4
- /node_modules
5
- /.pnp
6
- .pnp.*
7
- .yarn/*
8
- !.yarn/patches
9
- !.yarn/plugins
10
- !.yarn/releases
11
- !.yarn/versions
12
-
13
- # testing
14
- /coverage
15
-
16
- # next.js
17
- /.next/
18
- /out/
19
-
20
- # production
21
- /build
22
-
23
- # misc
24
- .DS_Store
25
- *.pem
26
-
27
- # debug
28
- npm-debug.log*
29
- yarn-debug.log*
30
- yarn-error.log*
31
- .pnpm-debug.log*
32
-
33
- # env files (can opt-in for committing if needed)
34
- .env*
35
-
36
- # vercel
37
- .vercel
38
-
39
- # typescript
40
- *.tsbuildinfo
41
- next-env.d.ts
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/README.md DELETED
@@ -1,36 +0,0 @@
1
- This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).
2
-
3
- ## Getting Started
4
-
5
- First, run the development server:
6
-
7
- ```bash
8
- npm run dev
9
- # or
10
- yarn dev
11
- # or
12
- pnpm dev
13
- # or
14
- bun dev
15
- ```
16
-
17
- Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
18
-
19
- You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
20
-
21
- This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
22
-
23
- ## Learn More
24
-
25
- To learn more about Next.js, take a look at the following resources:
26
-
27
- - [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
28
- - [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
29
-
30
- You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
31
-
32
- ## Deploy on Vercel
33
-
34
- The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
35
-
36
- Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/eslint.config.mjs DELETED
@@ -1,16 +0,0 @@
1
- import { dirname } from "path";
2
- import { fileURLToPath } from "url";
3
- import { FlatCompat } from "@eslint/eslintrc";
4
-
5
- const __filename = fileURLToPath(import.meta.url);
6
- const __dirname = dirname(__filename);
7
-
8
- const compat = new FlatCompat({
9
- baseDirectory: __dirname,
10
- });
11
-
12
- const eslintConfig = [
13
- ...compat.extends("next/core-web-vitals", "next/typescript"),
14
- ];
15
-
16
- export default eslintConfig;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/next.config.ts DELETED
@@ -1,7 +0,0 @@
1
- import type { NextConfig } from "next";
2
-
3
- const nextConfig: NextConfig = {
4
- /* config options here */
5
- };
6
-
7
- export default nextConfig;
 
 
 
 
 
 
 
 
frontend/package-lock.json DELETED
The diff for this file is too large to render. See raw diff
 
frontend/package.json DELETED
@@ -1,27 +0,0 @@
1
- {
2
- "name": "frontend",
3
- "version": "0.1.0",
4
- "private": true,
5
- "scripts": {
6
- "dev": "next dev --turbopack",
7
- "build": "next build",
8
- "start": "next start",
9
- "lint": "next lint"
10
- },
11
- "dependencies": {
12
- "react": "^19.0.0",
13
- "react-dom": "^19.0.0",
14
- "next": "15.3.3"
15
- },
16
- "devDependencies": {
17
- "typescript": "^5",
18
- "@types/node": "^20",
19
- "@types/react": "^19",
20
- "@types/react-dom": "^19",
21
- "@tailwindcss/postcss": "^4",
22
- "tailwindcss": "^4",
23
- "eslint": "^9",
24
- "eslint-config-next": "15.3.3",
25
- "@eslint/eslintrc": "^3"
26
- }
27
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/postcss.config.mjs DELETED
@@ -1,5 +0,0 @@
1
- const config = {
2
- plugins: ["@tailwindcss/postcss"],
3
- };
4
-
5
- export default config;
 
 
 
 
 
 
frontend/public/background.svg DELETED
frontend/public/file.svg DELETED
frontend/public/globe.svg DELETED
frontend/public/next.svg DELETED
frontend/public/vercel.svg DELETED
frontend/public/window.svg DELETED
frontend/src/app/favicon.ico DELETED
Binary file (25.9 kB)
 
frontend/src/app/globals.css DELETED
@@ -1,63 +0,0 @@
1
- @import "tailwindcss";
2
-
3
- :root {
4
- --background: #ffffff;
5
- --foreground: #171717;
6
- }
7
-
8
- @theme inline {
9
- --color-background: var(--background);
10
- --color-foreground: var(--foreground);
11
- --font-sans: ui-sans-serif, system-ui, sans-serif;
12
- --font-mono: ui-monospace, monospace;
13
- }
14
-
15
-
16
- .glass-panel {
17
- background: rgba(255, 255, 255, 0.6);
18
- border: 1px solid rgba(255, 255, 255, 0.8);
19
- backdrop-filter: blur(12px);
20
- box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
21
- position: relative;
22
- overflow: hidden;
23
- }
24
-
25
- .glass-panel::before,
26
- .glass-panel::after {
27
- content: "";
28
- position: absolute;
29
- pointer-events: none;
30
- }
31
-
32
- .glass-panel::before {
33
- top: -20%;
34
- left: -20%;
35
- width: 50%;
36
- height: 50%;
37
- background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.9), transparent);
38
- transform: rotate(45deg);
39
- }
40
-
41
- .glass-panel::after {
42
- bottom: -20%;
43
- right: -20%;
44
- width: 60%;
45
- height: 60%;
46
- background: linear-gradient(135deg, rgba(255, 255, 255, 0.4), transparent);
47
- }
48
-
49
- body {
50
- background: var(--background) url('/background.svg') no-repeat center center fixed;
51
- background-size: cover;
52
- color: var(--foreground);
53
- font-family: var(--font-sans, Arial, Helvetica, sans-serif);
54
- }
55
-
56
- @keyframes fadeIn {
57
- from { opacity: 0; transform: translateY(5px); }
58
- to { opacity: 1; transform: translateY(0); }
59
- }
60
-
61
- .animate-fadeIn {
62
- animation: fadeIn 0.3s ease-in-out;
63
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/src/app/layout.tsx DELETED
@@ -1,22 +0,0 @@
1
- import type { Metadata } from "next";
2
- import { Inter } from "next/font/google";
3
- import "./globals.css";
4
-
5
- const inter = Inter({ subsets: ["latin"], variable: "--font-sans", display: "swap" });
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
- <html lang="en" className={inter.variable}>
19
- <body className="antialiased">{children}</body>
20
- </html>
21
- );
22
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/src/app/page.tsx DELETED
@@ -1,5 +0,0 @@
1
- import ChatApp from "../components/ChatApp";
2
-
3
- export default function Home() {
4
- return <ChatApp />;
5
- }
 
 
 
 
 
 
frontend/src/components/ChatApp.tsx DELETED
@@ -1,61 +0,0 @@
1
- 'use client';
2
-
3
- import { useState, useRef, useEffect } from 'react';
4
- import { streamChat, ChatRequest } from '../utils/api';
5
- import MessageList from './MessageList';
6
- import MessageInput from './MessageInput';
7
- import { Message } from './MessageItem';
8
-
9
- export default function ChatApp() {
10
- const [messages, setMessages] = useState<Message[]>([]);
11
- const [input, setInput] = useState('');
12
- const [loading, setLoading] = useState(false);
13
- const listRef = useRef<HTMLDivElement>(null);
14
-
15
- const scrollToEnd = () => {
16
- listRef.current?.scrollTo({ top: listRef.current.scrollHeight, behavior: 'smooth' });
17
- };
18
-
19
- useEffect(() => {
20
- scrollToEnd();
21
- }, [messages]);
22
-
23
- const sendMessage = async () => {
24
- if (!input.trim() || loading) return;
25
- const prompt = input;
26
- setInput('');
27
- setMessages((prev) => [...prev, { role: 'user', content: prompt }, { role: 'assistant', content: '' }]);
28
- setLoading(true);
29
- try {
30
- const req: ChatRequest = { user: 'demo', session: 'default', prompt };
31
- for await (const chunk of streamChat(req)) {
32
- setMessages((prev) => {
33
- const msgs = [...prev];
34
- msgs[msgs.length - 1] = {
35
- role: 'assistant',
36
- content: msgs[msgs.length - 1].content + chunk,
37
- };
38
- return msgs;
39
- });
40
- }
41
- } catch (err) {
42
- console.error(err);
43
- setMessages((prev) => {
44
- const msgs = [...prev];
45
- msgs[msgs.length - 1] = { role: 'assistant', content: 'Error retrieving response' };
46
- return msgs;
47
- });
48
- } finally {
49
- setLoading(false);
50
- }
51
- };
52
-
53
- return (
54
- <div className="flex flex-col min-h-screen bg-gradient-to-br from-white to-gray-100 text-gray-900 p-4">
55
- <div className="w-full max-w-3xl flex flex-col flex-1 mx-auto glass-panel rounded-lg overflow-hidden">
56
- <MessageList ref={listRef} messages={messages} />
57
- <MessageInput value={input} onChange={setInput} onSend={sendMessage} disabled={loading} />
58
- </div>
59
- </div>
60
- );
61
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/src/components/MessageInput.tsx DELETED
@@ -1,31 +0,0 @@
1
- import React from 'react';
2
- import GlassButton from './ui/GlassButton';
3
-
4
- interface MessageInputProps {
5
- value: string;
6
- onChange: (value: string) => void;
7
- onSend: () => void;
8
- disabled?: boolean;
9
- }
10
-
11
- export default function MessageInput({ value, onChange, onSend, disabled }: MessageInputProps) {
12
- const handleSubmit = (e: React.FormEvent) => {
13
- e.preventDefault();
14
- onSend();
15
- };
16
-
17
- return (
18
- <form onSubmit={handleSubmit} className="flex gap-2 p-2 border-t border-gray-200">
19
- <input
20
- type="text"
21
- className="flex-1 bg-white/60 backdrop-blur-sm border border-gray-300 text-gray-900 px-3 py-2 rounded-md focus:outline-none"
22
- value={value}
23
- onChange={(e) => onChange(e.target.value)}
24
- placeholder="Type your message..."
25
- />
26
- <GlassButton type="submit" disabled={disabled}>
27
- Send
28
- </GlassButton>
29
- </form>
30
- );
31
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/src/components/MessageItem.tsx DELETED
@@ -1,21 +0,0 @@
1
- import React from 'react';
2
-
3
- export interface Message {
4
- role: 'user' | 'assistant';
5
- content: string;
6
- }
7
-
8
- interface MessageItemProps {
9
- message: Message;
10
- }
11
-
12
- export default function MessageItem({ message }: MessageItemProps) {
13
- const alignment = message.role === 'user' ? 'items-end' : 'items-start';
14
- return (
15
- <div className={`flex flex-col ${alignment} animate-fadeIn`}>
16
- <div className="w-full max-w-xl p-3 my-2 glass-panel rounded-lg shadow-md">
17
- <p className="whitespace-pre-wrap break-words">{message.content}</p>
18
- </div>
19
- </div>
20
- );
21
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/src/components/MessageList.tsx DELETED
@@ -1,20 +0,0 @@
1
- import React, { forwardRef } from 'react';
2
- import MessageItem, { Message } from './MessageItem';
3
-
4
- interface MessageListProps {
5
- messages: Message[];
6
- }
7
-
8
- const MessageList = forwardRef<HTMLDivElement, MessageListProps>(({ messages }, ref) => {
9
- return (
10
- <div className="flex-1 overflow-y-auto p-4 space-y-4" ref={ref}>
11
- {messages.map((msg, idx) => (
12
- <MessageItem key={idx} message={msg} />
13
- ))}
14
- </div>
15
- );
16
- });
17
-
18
- MessageList.displayName = 'MessageList';
19
-
20
- export default MessageList;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/src/components/ui/GlassButton.tsx DELETED
@@ -1,16 +0,0 @@
1
- import React from 'react';
2
-
3
- interface GlassButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
4
- children: React.ReactNode;
5
- }
6
-
7
- export default function GlassButton({ children, className = '', ...props }: GlassButtonProps) {
8
- return (
9
- <button
10
- className={`bg-white/60 backdrop-blur-sm border border-gray-300 text-gray-900 px-4 py-2 rounded-md shadow-lg transition-all hover:bg-white active:scale-95 disabled:opacity-50 disabled:cursor-not-allowed ${className}`}
11
- {...props}
12
- >
13
- {children}
14
- </button>
15
- );
16
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/src/utils/api.ts DELETED
@@ -1,31 +0,0 @@
1
- export interface ChatRequest {
2
- user: string;
3
- session: string;
4
- prompt: string;
5
- }
6
-
7
- export async function* streamChat(
8
- req: ChatRequest
9
- ): AsyncGenerator<string> {
10
- const url = `${process.env.NEXT_PUBLIC_API_URL}/chat/stream`;
11
- const res = await fetch(url, {
12
- method: 'POST',
13
- headers: {
14
- 'Content-Type': 'application/json',
15
- },
16
- body: JSON.stringify(req),
17
- });
18
-
19
- if (!res.ok || !res.body) {
20
- throw new Error('API request failed');
21
- }
22
-
23
- const reader = res.body.getReader();
24
- const decoder = new TextDecoder();
25
-
26
- while (true) {
27
- const { value, done } = await reader.read();
28
- if (done) break;
29
- yield decoder.decode(value);
30
- }
31
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/tsconfig.json DELETED
@@ -1,27 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2017",
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
- "@/*": ["./src/*"]
23
- }
24
- },
25
- "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
26
- "exclude": ["node_modules"]
27
- }