Skip to content

Commit

Permalink
chore: cleanup addresses and add readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
phukon committed Mar 29, 2024
1 parent a930f4e commit ca6213c
Show file tree
Hide file tree
Showing 8 changed files with 806 additions and 1,098 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
HOST_NAME=
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
node_modules/
node_modules/

.env
65 changes: 65 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<img alt=" Interact with your Vercel deployment's build container through it's bash terminal." src="https://github.com/phukon/guava/assets/60285613/e352cda2-5df6-477f-a1b0-5a5a7b9f5eeb">

<h3 align="center">guava-term</h3>

<p align="center">
Interact with your Vercel deployment's build container through it's bash terminal
<br />
<a href="#http-implementation"><strong>HTTP</strong></a> ·
<a href="#websocket-implementation"><strong>WebSocket</strong></a> ·
</p>

<br/>

This project enables remote interaction with a Vercel Build container through it's bash terminal using child processes. I initially wrote this to explore the remote environment and use the `/temp` directory of a Vercel Build Docker container. {see more @ [Vercel Builds](https://vercel.com/docs/deployments/builds) }

For a Next.js implementation, check [guava-next](https://github.com/phukon/guava-next)

## HTTP implementation

dir: `plain-http` + root `index.js`
Everything is stateless on the `HTTP` implementation. The `child process` is killed after every command or should I say for every new command, a new `child process` is spun up.

## WebSocket implementation

dir: `websocket`
All commands are piped to the same `child process`.

## Getting Started

To set up and run the application, follow these steps:

### HTTP

1. `pnpm install`
2. Set `HOST_NAME` in `.env`
3. Then `node index.js` to spin up the server.
4. Finally `node plain-http/hclient.js` to start the client.

### Websocket

1. Run `node websocket/index.js` to spin up the server.
2. Point to your server address in `websocket/client.js`
3. Then `node websocket/client.js`to use the websocket client.

### Usage

#### Server Side

1. Run the server:

`node hclient.js`

The server will start listening on port 8080.

#### Client Side

1. Run the client:

`node client.js`

This will prompt you to enter a command.

2. Enter the desired command and press Enter.

The command will be sent to the server, executed in a bash terminal, and the output will be displayed in the client console.
Loading

0 comments on commit ca6213c

Please sign in to comment.