Skip to content

Commit 24a9b5f

Browse files
committed
feat: Add new Frontend
1 parent 5c2d479 commit 24a9b5f

211 files changed

Lines changed: 25601 additions & 17575 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

frontend/.editorconfig

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[*.{js,jsx,ts,tsx}]
2+
indent_style = space
3+
indent_size = 4
4+
trim_trailing_whitespace = true
5+
insert_final_newline = true
6+
7+
[*.html]
8+
indent_style = space
9+
indent_size = 4
10+
trim_trailing_whitespace = true
11+
insert_final_newline = true
12+
13+
[*.json]
14+
indent_style = space
15+
indent_size = 4
16+
trim_trailing_whitespace = true
17+
insert_final_newline = true
18+
19+
[*.yml]
20+
indent_style = space
21+
indent_size = 2
22+
trim_trailing_whitespace = true
23+
insert_final_newline = true

frontend/.eslintrc.cjs

Lines changed: 0 additions & 18 deletions
This file was deleted.

frontend/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ lerna-debug.log*
1010
node_modules
1111
dist
1212
dist-ssr
13+
ssl
1314
*.local
1415

1516
# Editor directories and files

frontend/.prettierignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

frontend/.prettierrc

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,26 @@
11
{
2-
"importOrder": ["^@/(.*)$", "^[./]"],
3-
"importOrderSeparation": true,
4-
"importOrderSortSpecifiers": true,
5-
"plugins": ["@trivago/prettier-plugin-sort-imports"]
2+
"printWidth": 120,
3+
"tabWidth": 4,
4+
"useTabs": false,
5+
"semi": true,
6+
"singleQuote": true,
7+
"trailingComma": "all",
8+
"singleAttributePerLine": true,
9+
"endOfLine": "auto",
10+
"plugins": ["prettier-plugin-tailwindcss", "prettier-plugin-organize-imports"],
11+
"overrides": [
12+
{
13+
"files": ["*.yml"],
14+
"options": {
15+
"tabWidth": 2
16+
}
17+
},
18+
{
19+
"files": ["*.xml"],
20+
"options": {
21+
"parser": "xml",
22+
"plugins": ["@prettier/plugin-xml"]
23+
}
24+
}
25+
]
626
}

frontend/README.md

Lines changed: 116 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,124 @@
1-
# React + TypeScript + Vite
1+
# PegtAGI Frontend
22

3-
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
3+
A chat application built with React, TypeScript, and GraphQL that enables intelligent conversations with AI agents.
44

5-
Currently, two official plugins are available:
5+
## Features
66

7-
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
8-
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
7+
- 💬 Real-time chat interface with AI agents
8+
- 🤖 Multiple AI agent support and management
9+
- 📊 Real-time terminal output monitoring
10+
- 🎯 Task and subtask tracking system
11+
- 🔍 Integrated search capabilities
12+
- 📚 Vector store for knowledge base management
13+
- 📸 Screenshot capture and management
14+
- 🌓 Dark/Light theme support
15+
- 📱 Responsive design (mobile, tablet, desktop)
16+
- 🔐 Authentication system with multiple providers
17+
- 🔄 Real-time updates via GraphQL subscriptions
18+
- ⚡ High-performance React components
919

10-
## Expanding the ESLint configuration
20+
## Tech Stack
1121

12-
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
22+
- **Framework**: React 18 with TypeScript
23+
- **Build Tool**: Vite
24+
- **Styling**: Tailwind CSS
25+
- **UI Components**:
26+
- shadcn/ui
27+
- Radix UI primitives
28+
- Lucide icons
29+
- **State Management**:
30+
- React Context
31+
- Custom Hooks
32+
- **API Integration**:
33+
- GraphQL
34+
- Apollo Client
35+
- WebSocket subscriptions
36+
- **Type Safety**: TypeScript
37+
- **Authentication**: Multiple provider support
38+
- **Code Quality**:
39+
- ESLint
40+
- Prettier
41+
- TypeScript strict mode
1342

14-
- Configure the top-level `parserOptions` property like this:
43+
## Project Structure
1544

16-
```js
17-
export default {
18-
// other rules...
19-
parserOptions: {
20-
ecmaVersion: "latest",
21-
sourceType: "module",
22-
project: ["./tsconfig.json", "./tsconfig.node.json"],
23-
tsconfigRootDir: __dirname,
24-
},
25-
};
26-
```
45+
src/
46+
├── components/ # Shared UI components
47+
│ ├── ui/ # Base UI components
48+
│ └── icons/ # SVG icons and logo
49+
├── features/ # Feature-based modules
50+
│ ├── chat/ # Chat related components
51+
│ ├── authentication/ # Auth related components
52+
├── hooks/ # Custom React hooks
53+
├── lib/ # Utilities and configurations
54+
├── graphql/ # GraphQL operations and types
55+
├── models/ # TypeScript interfaces
56+
└── pages/ # Application routes
2757

28-
- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
29-
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
30-
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
58+
## Key Components
59+
60+
### Chat Interface
61+
62+
- Split view with messages and tools panels
63+
- Resizable panels for desktop
64+
- Mobile-optimized view with tabs
65+
- Real-time message updates
66+
67+
### Task System
68+
69+
- Real-time task tracking
70+
- Subtask management
71+
- Progress monitoring
72+
- Status updates
73+
74+
### Terminal
75+
76+
- Command output display
77+
- Real-time updates
78+
- Scrollable history
79+
- Syntax highlighting
80+
81+
### Vector Store
82+
83+
- Knowledge base integration
84+
- Search capabilities
85+
- Data management
86+
87+
### Agent System
88+
89+
- Multi-agent support
90+
- Agent status monitoring
91+
- Agent communication logs
92+
93+
## Development
94+
95+
### Prerequisites
96+
97+
- Node.js 18+
98+
- npm 8+
99+
100+
### Installation
101+
102+
1. Clone the repository
103+
2. Install dependencies:
104+
npm install
105+
3. Start the development server:
106+
npm run dev
107+
108+
### Building for Production
109+
110+
npm run build
111+
112+
### Environment Variables
113+
114+
Create a .env file in the root directory:
115+
116+
VITE_API_URL=your_api_url
117+
118+
## Contributing
119+
120+
1. Fork the repository
121+
2. Create your feature branch (git checkout -b feature/amazing-feature)
122+
3. Commit your changes (git commit -m 'Add some amazing feature')
123+
4. Push to the branch (git push origin feature/amazing-feature)
124+
5. Open a Pull Request

frontend/codegen.yml

Lines changed: 0 additions & 15 deletions
This file was deleted.

frontend/commitlint.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default { extends: ['@commitlint/config-conventional'] };

frontend/components.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"$schema": "https://ui.shadcn.com/schema.json",
3+
"style": "new-york",
4+
"rsc": false,
5+
"tsx": true,
6+
"tailwind": {
7+
"config": "tailwind.config.ts",
8+
"css": "src/styles/index.css",
9+
"baseColor": "slate",
10+
"cssVariables": true,
11+
"prefix": ""
12+
},
13+
"aliases": {
14+
"components": "@/components",
15+
"utils": "@/lib/utils",
16+
"ui": "@/components/ui",
17+
"lib": "@/lib",
18+
"hooks": "@/hooks"
19+
}
20+
}

frontend/eslint.config.mjs

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// @ts-check
2+
import { defineConfig } from 'eslint-config-hyoban';
3+
4+
export default defineConfig(
5+
{
6+
formatting: {
7+
quotes: 'single',
8+
arrowParens: true,
9+
braceStyle: '1tbs',
10+
lineBreak: 'after',
11+
semi: true,
12+
indent: 4,
13+
},
14+
lessOpinionated: true,
15+
preferESM: false,
16+
ignores: ['public/mockServiceWorker.js', 'src/components/ui', 'pnpm-lock.yaml'],
17+
},
18+
{
19+
settings: {
20+
tailwindcss: {
21+
whitelist: ['center'],
22+
},
23+
},
24+
rules: {
25+
'@stylistic/indent': ['error', 4],
26+
'unicorn/template-indent': ['error', { indent: 4 }],
27+
'@stylistic/quote-props': ['error', 'as-needed'],
28+
'@stylistic/operator-linebreak': [
29+
'error',
30+
'after',
31+
{
32+
overrides: {
33+
'?': 'before',
34+
':': 'before',
35+
},
36+
},
37+
],
38+
},
39+
},
40+
);

0 commit comments

Comments
 (0)