Skip to content

Commit

Permalink
fix: lift electron into root and resolve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
truemiller committed Feb 6, 2024
1 parent 991bfd9 commit 7803ae3
Show file tree
Hide file tree
Showing 46 changed files with 217 additions and 107 deletions.
25 changes: 25 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"extends": [
"eslint:recommended",
"next/core-web-vitals",
"plugin:jest/recommended",
"plugin:react-hooks/recommended",
"plugin:react/recommended",
"prettier"
],
"globals": {
"JSX": true,
"React": true
},
"plugins": [
"jest",
"prettier",
"react",
"react-hooks"
],
"rules": {
"react/jsx-props-no-spreading": "off",
"react/no-array-index-key": "off",
"react/react-in-jsx-scope": "off"
}
}
39 changes: 37 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,37 @@
data/
__pycache__/
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,19 @@
# olas-operate-app
Frontend Electron + NextJS application for the Olas Operate App.

## Technologies Used
- NextJS
- Electron
- AntD
- TypeScript


## Getting Started

First, run the development server:

```bash
yarn dev
```



File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { useAgents } from "@/hooks/useAgents";
import { Row, Col, Button } from "antd";

import Image from "next/image";
export const MarketplaceItem = () => {
const { startAgent: runAgent } = useAgents();
return (
<Row style={{ borderBottom: "1px solid black" }} gutter={16}>
<Row gutter={16}>
<Col span={8}>
<img
<Image
src=""
alt="Image"
style={{
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const TimelineItem = ({title, body}: {title: string, body: JSX.Element}) => {
export const TimelineItem = ({ title, body }: { title: string, body: JSX.Element }) => {
return (
<div>
<h1>{title}</h1>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useAgents } from "@/hooks/useAgents";
import { Tab, useTabs } from "@/hooks/useTabs";
import { Button, Flex } from "antd";
import { Button, Flex, Typography } from "antd";

export const YourAgents = () => {
const { agents } = useAgents();
Expand All @@ -16,8 +16,8 @@ export const HasAgents = ({ agents }: { agents: any[] }) => {
<>
{agents.map((agent) => (
<div key={agent.id}>
<h2>{agent.name}</h2>
<p>{agent.description}</p>
<Typography.Title>{agent.name}</Typography.Title>
<Typography.Paragraph>{agent.description}</Typography.Paragraph>
<Button onClick={() => stopAgent(agent.id)}>Stop this agent</Button>
</div>
))}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type AgentContextType = {

export const AgentsContext = createContext<AgentContextType>({
agents: [],
setAgents: () => {},
setAgents: () => { },
isLoading: false,
});

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes
2 changes: 1 addition & 1 deletion frontend/electron/loading.html → electron/loading.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<title>Operate App</title>
</head>
<body>
<img src="/robot-head.png" alt="">
Expand Down
8 changes: 4 additions & 4 deletions frontend/electron/main.js → electron/main.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const { app, BrowserWindow, Tray, Menu } = require("electron");
const path = require("path");

let tray;
let tray, win;

const createWindow = () => {
const win = new BrowserWindow({
win = new BrowserWindow({
width: 800,
height: 600,
});
Expand All @@ -14,7 +14,7 @@ const createWindow = () => {

win.loadURL("http://localhost:3000");
win.webContents.openDevTools();
win.webContents.on("did-fail-load", (e, code, desc) => {
win.webContents.on("did-fail-load", () => {
win.webContents.reloadIgnoringCache();
});

Expand Down Expand Up @@ -64,7 +64,7 @@ app.whenReady().then(() => {
},
},
]);
tray.setToolTip("This is my application.");
tray.setToolTip("Olas Operate");
tray.setContextMenu(contextMenu);
tray.on("click", () => {
win.show();
Expand Down
File renamed without changes.
10 changes: 0 additions & 10 deletions frontend/.eslintrc.json

This file was deleted.

37 changes: 0 additions & 37 deletions frontend/.gitignore

This file was deleted.

25 changes: 0 additions & 25 deletions frontend/README.md

This file was deleted.

10 changes: 0 additions & 10 deletions frontend/components/Layout/Layout.test.tsx

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 9 additions & 2 deletions frontend/package.json → package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,12 @@
"eslint": "^8",
"eslint-config-next": "14.1.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-jest": "^27.6.3",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"portfinder": "^1.0.32",
"prettier": "^3.2.5",
"ts-node": "^10.9.2",
"tslint-plugin-prettier": "^2.3.0",
Expand All @@ -35,8 +39,11 @@
"name": "olas-operate-app",
"private": true,
"scripts": {
"build": "next build && electron-builder",
"dev": "concurrently -n \"NEXT,ELECTRON\" -c \"yellow,blue\" --kill-others \"next dev\" \"electron .\"",
"build": "",
"dev": "concurrently -n \"NEXT,ELECTRON,FLASK\" -c \"yellow,blue,green\" --kill-others \"next dev\" \"electron .\" \"python backend/server.py\"",
"install": "yarn install:javascript && yarn install:python",
"install:javascript": "yarn install --ignore-scripts",
"install:python": "cd ./backend && poetry install",
"lint": "next lint",
"start": "next start",
"test": "jest"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
3 changes: 2 additions & 1 deletion frontend/tsconfig.json → tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@
"strict": true
},
"exclude": [
"backend",
"node_modules"
],
"include": [
"**/*.ts",
"**/*.tsx",
"next-env.d.ts"
]
}
}
Loading

0 comments on commit 7803ae3

Please sign in to comment.