Skip to content

Commit

Permalink
dashboard update
Browse files Browse the repository at this point in the history
  • Loading branch information
raidendotai committed Oct 2, 2024
1 parent b127f30 commit 615ee55
Show file tree
Hide file tree
Showing 139 changed files with 19,221 additions and 211 deletions.
42 changes: 29 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Still not merged with key target features of the project, notably :
- code optimization
- [...]

Be patient :)
be patient :)

---

Expand All @@ -45,14 +45,14 @@ Be patient :)
* Open your terminal and run

```sh
npx @openinterface/cofounder -p "YourAppProjectName" -d "describe your app here" -a "(optional) design instructions"
npx @openinterface/cofounder
```

Follow the instructions. The installer
- will ask you for your keys
- setup dirs & start installs
- will start the local `cofounder/api` builder and server
- will start generating your app 🎉
- will open the web dashboard where you can create new projects (at `http://localhost:667` ) 🎉

```
note :
Expand All @@ -63,9 +63,16 @@ and can be used without limits during the current early alpha period
the full index will be available for local download on v1 release
```

## Run
```sh
# alternatively, you can make a new project without going through the dashboard
# by runing :
npx @openinterface/cofounder -p "YourAppProjectName" -d "describe your app here" -a "(optional) design instructions"
```

Your backend & vite+react web app will incrementally generate inside `./apps/{YourApp}`

## Run Generated Apps

- Your backend & vite+react web app will incrementally generate inside `./apps/{YourApp}`
Open your terminal in `./apps/{YourApp}` and run

```sh
Expand All @@ -75,9 +82,14 @@ npm i && npm run dev
It will start both the backend and vite+react, concurrently, after installing their dependencies
Go to `http://localhost:5173/` to open the web app 🎉


- From within the generated apps , you can use ⌘+K / Ctrl+K to iterate on UI components

[more details later]

## Notes

### Local API
### Dashboard & Local API

If you resume later and would like to iterate on your generated apps,
the local `./cofounder/api` server needs to be running to receive queries
Expand All @@ -88,12 +100,15 @@ You can (re)start the `local cofounder API` running the following command from `
npm run start
```

You can also generate new apps from the same env by running, from `./cofounder/api`, one of these command
The dashboard will open in `http://localhost:667`

```sh
npm run start -- -p "ProjectName" -f "some app description" -a "minimalist and spacious , light theme"
npm run start -- -p "ProjectName" -f "./example_description.txt" -a "minimalist and spacious , light theme"
```

- note: You can also generate new apps from the same env, without the the dashboard, by running, from `./cofounder/api`, one of these commands

```sh
npm run start -- -p "ProjectName" -f "some app description" -a "minimalist and spacious , light theme"
npm run start -- -p "ProjectName" -f "./example_description.txt" -a "minimalist and spacious , light theme"
```

### Concurrency

Expand Down Expand Up @@ -128,7 +143,7 @@ nodes:

and change the `op:LLM::GEN` parameter `concurrency` to a higher value

The default LLM concurrency is set to `1` so you can see what's happening in your console streams step by step - but you can increment it to `5`-`8`
The default LLM concurrency is set to `2` so you can see what's happening in your console streams step by step - but you can increment it depending on your api keys limits
---
Expand All @@ -155,4 +170,5 @@ archi/v1 is as follows :
* blocks.pm by Hexa Plugin (see `cofounder/api/system/presets`)
* google material
* figma core
* shadcn
* shadcn
- Dashboard node-based ui powered by [react flow](https://reactflow.dev/)
7 changes: 1 addition & 6 deletions cofounder/api/.env
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,4 @@ DESIGNER_DESIGN_SYSTEM = "presets/shadcn" #"presets/shadcn"
SWARM_ENABLE = TRUE

# OPTIONAL
COFOUNDER_NICKNAME = "Cofounder"

#STATE_CLOUD = TRUE # persist on cloud (firebase + cloudstorage)
#FIREBASE_SERVICE_KEY_PATH = ""
#GOOGLECLOUDSTORAGE_SERVICE_KEY_PATH = ""
#GOOGLECLOUDSTORAGE_BUCKET = ""
COFOUNDER_NICKNAME = "Cofounder"
1 change: 1 addition & 0 deletions cofounder/api/.prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
db/
dump/
dist/
node_modules/
58 changes: 33 additions & 25 deletions cofounder/api/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,32 +229,40 @@ async function build({ system }) {
data,
});
const sequenceLength = sequence.length;
if (context.sequence) {
console.dir({ "debug:build:context:sequence": context.sequence });
}
const resume_at = context?.sequence?.resume ? context.sequence.resume : 0;
let step_index = -1;
for (const s of sequence.entries()) {
const [index, step] = s;
events.log.sequence.emit(`sequence:step:start`, {
id: sequenceId,
index,
over: sequenceLength,
context,
data,
});
await Promise.all(
step.map(async (parallelfnId) => {
const response = await system.run({
id: parallelfnId,
context: { ...context, run: system.run },
data,
});
data = merge(data, response);
}),
);
events.log.sequence.emit(`sequence:step:end`, {
id: sequenceId,
index,
over: sequenceLength,
context,
data,
});
step_index++;
if (step_index >= resume_at) {
const [index, step] = s;
events.log.sequence.emit(`sequence:step:start`, {
id: sequenceId,
index,
over: sequenceLength,
context,
data,
});
await Promise.all(
step.map(async (parallelfnId) => {
const response = await system.run({
id: parallelfnId,
context: { ...context, run: system.run },
data,
});
data = merge(data, response);
}),
);
events.log.sequence.emit(`sequence:step:end`, {
id: sequenceId,
index,
over: sequenceLength,
context,
data,
});
}
}
events.log.sequence.emit(`sequence:end`, {
id: sequenceId,
Expand Down
Binary file added cofounder/api/dist/assets/cofounder-ts8-tu2p.webp
Binary file not shown.
1 change: 1 addition & 0 deletions cofounder/api/dist/assets/index-COffgP7k.css

Large diffs are not rendered by default.

370 changes: 370 additions & 0 deletions cofounder/api/dist/assets/index-Ci0XSEHc.js

Large diffs are not rendered by default.

Binary file added cofounder/api/dist/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions cofounder/api/dist/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link
href="https://fonts.googleapis.com/css2?family=Karla:wght@100;200;300;400;500;600;700;800;900&display=swap"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@100;200;300;400;500;600;700;800;900&display=swap"
rel="stylesheet"
/>
<title>Cofounder Dashboard</title>
<script type="module" crossorigin src="/assets/index-Ci0XSEHc.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-COffgP7k.css">
</head>
<body>
<div id="root"></div>
<script>
document.addEventListener("keydown", (event) => {
if (event.ctrlKey && event.key === "k") {
console.log("Ctrl+K pressed!");
event.preventDefault(); // Prevent doing a google search
}
});
</script>
</body>
</html>
15 changes: 11 additions & 4 deletions cofounder/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@
"@": "."
},
"scripts": {
"start": "node --loader esm-module-alias/loader --no-warnings server",
"start:npx": "npm i && node --loader esm-module-alias/loader --no-warnings server",
"dev:build": "node --loader esm-module-alias/loader --no-warnings build"
"start:npx": "npm i && nodemon --loader esm-module-alias/loader --no-warnings server.js",
"start": "nodemon --loader esm-module-alias/loader --no-warnings server.js"
},
"nodemonConfig": {
"ignore": [
"db/*"
]
},
"dependencies": {
"@anthropic-ai/sdk": "^0.27.3",
"@google-cloud/storage": "^7.12.1",
"@resvg/resvg-js": "^2.6.2",
"async-retry": "^1.3.3",
"cloudconvert": "^2.3.7",
"colormap": "^2.3.2",
"cors": "^2.8.5",
"deepmerge": "^4.3.1",
Expand All @@ -28,12 +31,16 @@
"lodash": "^4.17.21",
"lodash-es": "^4.17.21",
"module-alias": "^2.2.3",
"open": "^10.1.0",
"openai": "^4.55.4",
"p-all": "^5.0.0",
"p-queue": "^8.0.1",
"sharp": "^0.33.4",
"slugify": "^1.6.6",
"socket.io": "^4.8.0",
"vectra": "^0.9.0",
"vite": "^5.4.8",
"vite-express": "^0.19.0",
"xml2js": "^0.6.2",
"yaml": "^2.5.0",
"yaml-js": "^0.3.1",
Expand Down
Loading

0 comments on commit 615ee55

Please sign in to comment.