Skip to content

Commit

Permalink
hello world
Browse files Browse the repository at this point in the history
  • Loading branch information
raidendotai committed Sep 19, 2024
0 parents commit a906249
Show file tree
Hide file tree
Showing 293 changed files with 20,319 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) [year] [fullname]

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
149 changes: 149 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
[img]

# cofounder : early alpha release

* project - [cofounder.openinterface.ai](https://cofounder.openinterface.ai)
* 👋 [@n_raidenai](https://x.com/n_raidenai)

**cofounder**
- full stack generative web apps ; backend + db + stateful web apps
- gen ui rooted in app architecture, with ai-guided mockup designer & modular design systems

[demo]

---

## Important

**Early alpha release ; earlier than expected by 5/6 weeks**

Still not merged with key target features of the project, notably :
- project iteration modules for all dimensions of generated projects
- admin interface for event streams and (deeper) project iterations
- integrate the full genUI plugin :
* generative design systems
* deploy finetuned models & serve from api.cofounder
- local, browser-based dev env for the entire project scope
- add { react-native , flutter , other web frameworks }
- validations & swarm code review and autofix
- code optimization
- [...]

Be patient :)

---

# Usage

## Install & Init

* Open your terminal and run

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

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 🎉

```
note :
you will be asked for a cofounder.openinterface.ai key
it is recommended to use one as it enables the designer/layoutv1 and swarm/external-apis features
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

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

```sh
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 🎉

## Notes

### 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

You can (re)start the `local cofounder API` running the following command from `./cofounder/api`

```sh
npm run start
```

You can also generate new apps from the same env by running, from `./cofounder/api`, one of these command

```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

**[the architecture will be further detailed and documented later]**

Every "node" in the `cofounder` architecture has a defined configuration under `./cofounder/api/system/structure/nodes/{category}/{name}.yaml` to handle things like concurrency, retries and limits per time interval

For example, if you want multiple LLM generations to run in parallel (when possible - sequences and parallels are defined in DAGS under `./cofounder/api/system/structure/sequences/{definition}.yaml` ),
go to

```yaml
#./cofounder/api/system/structure/nodes/op/llm.yaml
nodes:
op:LLM::GEN:
desc: "..."
in: [model, messages, preparser, parser, query, stream]
out: [generated, usage]
queue:
concurrency: 1 # <------------------------------- here
op:LLM::VECTORIZE:
desc: "{texts} -> {vectors}"
in: [texts]
out: [vectors, usage]
mapreduce: true
op:LLM::VECTORIZE:CHUNK:
desc: "{texts} -> {vectors}"
in: [texts]
out: [vectors, usage]
queue:
concurrency: 50
```
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`

---

# Docs, Design Systems, ...

**[WIP]**

---

# Architecture

[img]

---

# Some Credits

- Cover art edited from image found in [patriciaklein.de](https://patriciaklein.de)
- Demo design systems built using Figma renders / UI kits from:
* blocks.pm by Hexa Plugin (see `cofounder/api/system/presets`)
* google material
* figma core
* shadcn
49 changes: 49 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
A non-ordered roadmap & todo dump
will update with proper map later, ignore for now

---

## nearest
merge with browser-based local dev env using webcontainers ; console.cofounder.openinterface.ai

## validation, errorfix
post-generation validation swarm modules
swarm autofix modules, merge
babel parse

## build, deploy
vite plugin to generate web app without the cofounder modules
generate packed projects ready for deployment
automate deployments, integrate different services

## design, layouts
plug in advanced designer + models
document how to custom design systems
add & index docs for shiny design systems
fonts / css modules
release extensive cofounder index on api access for layout designer to use
separate {desktop,mobile} in designer
RAG on icons via {text/clip} (like in openv0), maybe as a vite plugin

## functional
deploy latest index checkpoint in api.cofounder

## mgmt
more iteration modules, sequences to handle full lifecycle of generated projects
document everything

## platforms
react-native / flutter
more frontend frameworks

## project
technical articles
model train & serve from api
admin panel à la coolify

## also
SEO stuff
analytics into the dev feedback
animation (ie. framer-motion)
functional, api, python support api-side
benchmarks
8 changes: 8 additions & 0 deletions apps/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## How to start apps

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

```sh
npm i && npm run dev
```
34 changes: 34 additions & 0 deletions cofounder/api/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
PORT = 667

OPENAI_API_KEY = "REPLACE_WITH_OPENAI_KEY"
ANTHROPIC_API_KEY = "REPLACE_WITH_ANTHROPIC_KEY"
COFOUNDER_API_KEY = "REPLACE_WITH_COFOUNDER.OPENINTERFACE.AI_KEY"

# llm, can be 'ANTHROPIC' (for claude sonnet 3.5) or 'OPENAI' (uses diff. models for diff. passes)
# make sure there are matching api keys
LLM_PROVIDER = "ANTHROPIC" #"OPENAI"

# should be kept to "text-embedding-3-small" to work with RAG using api.cofounder.openinterface.ai
EMBEDDING_MODEL = "text-embedding-3-small"

# RAG from index (from api.cofounder.openinterface.ai )
# enables features from { designer, swarm{externalapis} , ... }
# recommended to keep ; after alpha , in v1 release , big index will be release & downloadable to local
RAG_REMOTE_ENABLE = TRUE

STATE_LOCAL = TRUE # persist locally
AUTOEXPORT_ENABLE = TRUE # writes generated app files on each increment ; keep , necessary now
AUTOINSTALL_ENABLE = TRUE # runs "npm i" on exported projects whenever dependencies from generated code change
EXPORT_APPS_ROOT = "../../apps"

# these triggers the design system guided designer, generates a mockup layout image before implementing code
DESIGNER_ENABLE = TRUE
DESIGNER_DESIGN_SYSTEM = "presets/shadcn" #"presets/shadcn"

# enables : code review after code generated , augment features like searching for external apis to implement in server , ...
SWARM_ENABLE = TRUE

#STATE_CLOUD = TRUE # persist on cloud (firebase + cloudstorage)
#FIREBASE_SERVICE_KEY_PATH = "./firebase-service-key-p0dev.json"
#GOOGLECLOUDSTORAGE_SERVICE_KEY_PATH = "openv0-aa83086a03e1.json"
#GOOGLECLOUDSTORAGE_BUCKET = "uiray"
3 changes: 3 additions & 0 deletions cofounder/api/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/
db/
dump/
3 changes: 3 additions & 0 deletions cofounder/api/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
db/
dump/
node_modules/
4 changes: 4 additions & 0 deletions cofounder/api/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"tabWidth": 1,
"useTabs": true
}
Empty file added cofounder/api/README.md
Empty file.
Loading

0 comments on commit a906249

Please sign in to comment.