-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[Work-in-progress] Code Provider API with E2B #2711
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
http-teapot
wants to merge
7
commits into
onlook-dev:main
Choose a base branch
from
http-teapot:code-provider-api
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+13,420
−489
Draft
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
a7e1d22
moving coderouter to onlook and minimal cleanup
e016242
Merge branch 'main' into code-provider-api
6b6b3fa
committing file watcher code
6139f12
implementing terminal
31467ff
addressing ai comments, bit of polish, refactoring watch to use sse, …
565422c
codesandbox watch
6a37bea
Merge branch 'main' into code-provider-api
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Prefix the API paths | ||
URL_PATH_PREFIX="/coderouter" | ||
|
||
# Do not share this secret key - used to generate JWT token used in the client | ||
JWT_SECRET_KEY="Replace this with your own secret" | ||
|
||
# Insert your custom API key here and store in your other backend as well. | ||
# It'll be used for server-to-server authentication. | ||
CODEROUTER_API_KEY="" | ||
|
||
E2B_API_KEY="<Get your API key at https://e2b.dev>" | ||
CSB_API_KEY="<Your api key from https://codesandbox.io/t/api>" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
.env |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
FROM alpine:3.21.3 | ||
|
||
WORKDIR /app | ||
|
||
COPY . . | ||
|
||
# ENV CARGO_HOME=/project/etc/cargo | ||
# ENV RUSTUP_HOME=/project/etc/rustup | ||
ENV BUN_INSTALL=/usr/local/bin/bun | ||
|
||
RUN apk add curl bash build-base | ||
RUN curl -fsSL https://bun.sh/install | bash -s "bun-v1.2.5" | ||
|
||
CMD ["/usr/local/bin/bun/bin/bun", "dev"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
YOOOOOBLAHHHHHH | ||
|
||
# Bun + TypeScript API Starter (Hono + Drizzle) | ||
|
||
A batteries-included starter for building an API with **Bun**, **TypeScript**, **Hono**, and **Drizzle ORM**. | ||
It includes: multi-database support (Postgres/MySQL/SQLite) with migrations, unit + functional tests, | ||
OpenAPI generation, Swagger UI, TypeDoc, and a top-tier GitHub toolchain (Actions, Codecov, Renovate, Biome, Dependabot, GitHub Pages). | ||
|
||
## Quickstart | ||
|
||
```bash | ||
bun install | ||
cp .env.example .env | ||
# choose a DB (sqlite by default) | ||
bun db:generate # generate SQL from schema | ||
bun db:migrate # run migrations | ||
bun dev # start the API on http://localhost:3000 | ||
``` | ||
|
||
OpenAPI: http://localhost:3000/openapi.json | ||
Docs (Swagger UI): http://localhost:3000/docs | ||
|
||
### Scripts | ||
|
||
- `bun dev` — run in watch mode | ||
- `bun start` — production start | ||
- `bun test` — run all tests with coverage | ||
- `bun lint` — Biome lint/format check | ||
- `bun fmt` — format files with Biome | ||
- `bun db:generate` — generate migrations via drizzle-kit | ||
- `bun db:migrate` — apply migrations | ||
- `bun openapi` — regenerate OpenAPI JSON | ||
- `bun docs` — build TypeDoc to `site/typedoc` | ||
|
||
### Multi-DB | ||
|
||
Set `DRIZZLE_DB` to `postgres` | `mysql` | `sqlite` and provide `DATABASE_URL` accordingly. | ||
SQLite works out-of-the-box (`DATABASE_URL=file:./dev.sqlite`). | ||
|
||
### GitHub Pages (Docs) | ||
|
||
The `pages.yml` workflow builds and deploys: | ||
|
||
- `/openapi.json` -> `/site/api/openapi.json` | ||
- Swagger UI -> `/site/api/` | ||
- TypeDoc -> `/site/typedoc/` | ||
A small `site/index.html` links to both. | ||
|
||
Enable Pages in **Settings → Pages** (source: GitHub Actions). | ||
|
||
## License | ||
|
||
MIT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"$schema": "https://biomejs.dev/schemas/2.1.4/schema.json", | ||
"formatter": { "enabled": true, "formatWithErrors": true }, | ||
"linter": { "enabled": true } | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Fix nested list indentation and a split bullet to satisfy markdownlint (MD007) and readability
The nested checklist items are indented with 4 spaces; your repo’s lint expects 2. Also, the “Detect and use Components” bullet is split across two lines, breaking the markdown structure.
Apply the following diffs:
Also applies to: 77-85, 87-90, 93-97
🧰 Tools
🪛 LanguageTool
[grammar] ~72-~72: There might be a mistake here.
Context: ...conds - [x] Start from text or image - [ ] Use prebuilt templates - [ ] Imp...
(QB_NEW_EN)
[grammar] ~73-~73: There might be a mistake here.
Context: ...r image - [ ] Use prebuilt templates - [ ] Import from Figma - [ ] Start fr...
(QB_NEW_EN)
[grammar] ~74-~74: There might be a mistake here.
Context: ...lt templates - [ ] Import from Figma - [ ] Start from GitHub repo - [x] Visuall...
(QB_NEW_EN)
[grammar] ~75-~75: There might be a mistake here.
Context: ...m Figma - [ ] Start from GitHub repo - [x] Visually edit your app - [x] Use...
(QB_NEW_EN)
🪛 markdownlint-cli2 (0.17.2)
72-72: Unordered list indentation
Expected: 2; Actual: 4
(MD007, ul-indent)
73-73: Unordered list indentation
Expected: 2; Actual: 4
(MD007, ul-indent)
74-74: Unordered list indentation
Expected: 2; Actual: 4
(MD007, ul-indent)
75-75: Unordered list indentation
Expected: 2; Actual: 4
(MD007, ul-indent)
🤖 Prompt for AI Agents