Cloud developer tooling

A.P.E: AWS Platform Explorer

One 16 MB Go binary that gives EC2 and S3 a Finder-style browser UI.

Creator and sole maintainer (full stack) · 1 outside contributor (keyboard-shortcut modal) · Mar–Apr 2026 (v0.1 → v0.5)

16 MB
Single binary, zero runtime dependencies
4
Cross-compiled release targets
32
Go tests run in CI on every push
A.P.E browsing EC2 and S3 in the browser
A.P.E launched from the terminal
A.P.E launched from the terminal

Context

Editing files on EC2 usually means juggling `scp`, `ssh` and `vim` across terminal tabs.

The problem

Existing GUI tools like Cyberduck and Transmit need separate installs or licences, or have no S3 integration. The goal was a zero-install GUI, one binary dropped into $PATH, that handles SSH auth, live SFTP, S3 browsing and a full React frontend without Node.js or a separate web server.

What I owned

I built it alone, covering the Go server, the SSH/SFTP and S3 layers, the React file explorer and the release pipeline.

Backend

Go 1.26golang.org/x/crypto/sshgithub.com/pkg/sftpaws-sdk-go-v2

Frontend

React 18TypeScriptTailwind CSSViteMonaco Editor

Release

GitHub Actions4-target cross-compile

Architecture

A Go HTTP server embeds the React build and proxies every file action over one SSH/SFTP session, with S3 through the AWS SDK.

Single 16MB Go Binary: Embedded React + SSH/SFTP + S3 + Monaco

swipe
Browser(localhost:9000)Go HTTP Server(embed.FS)REST API RouterSSH Auth ManagerSFTP ClientEC2 File SystemMonaco Editor (UI)AWS SDK v2S3 Buckets
  1. Critical path
  2. Browser (localhost:9000)
  3. →Go HTTP Server (embed.FS)
  4. →REST API Router
  5. →SFTP Client
  6. →EC2 File System

Highlighted: a drag-and-drop upload, from the browser to the EC2 filesystem.

Key decisions

Three choices made it a single, stateless binary: embed the UI, stream uploads directly and push progress over SSE.

Decision 1

Embed the React build in the Go binary

Problem
Users should get the full UI without installing Node.js or running a separate web server.
Options
  • Ship a separate web server or Node runtime
  • Embed dist/* with //go:embed and serve it from http.FS
Decision
The React build is embedded at compile time and served by the same Go process as the API.
Result
One 16 MB binary with zero runtime dependencies, distributed via brew install or a GitHub Release.
Trade-off
Any UI change needs a rebuild and re-release of the binary.

Decision 2

Stream uploads straight to SFTP

Problem
Uploads can be large, and staging a full copy before sending it to EC2 wastes memory and disk.
Options
  • Write a local temp file, then scp it
  • io.Copy(remoteFile, file) straight into the SFTP handle
Decision
Upload bytes are streamed directly to the EC2 filesystem, with MkdirAll creating missing parents.
Result
Bytes go from the multipart reader straight into the remote file, with no extra local copy on the SFTP side.
Trade-off
Go's ParseMultipartForm(32 MB) still holds the first 32 MB in memory and spills larger files to temp files before the stream starts.

Decision 3

Server-Sent Events for upload progress

Problem
The browser needs live byte counts while an upload is streaming.
Options
  • Polling
  • WebSocket
  • Server-Sent Events
Decision
A custom io.Writer wrapper counts bytes and pushes them over SSE to an EventSource.
Result
Live progress with no polling, and no WebSocket complexity for a one-way data flow.
Trade-off
SSE is one-directional, so cancelling an upload needs a separate request.

Reliability

Every failure reaches the UI as a readable message, and SFTP drops reconnect on their own.

  • CI runs on every push through GitHub Actions: frontend lint, typecheck and build, then go vet and 32 Go tests on Go 1.22 and 1.23.
  • GoReleaser cross-compiles 4 targets (macOS and Linux on amd64 and arm64). Integration checks against a live EC2 t2.micro and real S3 buckets are run by hand, across PEM and new-format OpenSSH keys.
  • All API handlers return { error: string } JSON on failure, and the React UI shows these as toasts.
  • SFTP sessions reconnect automatically on disconnect, with exponential backoff and at most 3 retries.
  • S3 errors are unwrapped with errors.As(err, &apiErr) so the user sees the AWS error code.
Edge cases covered (5)
  • SSH auth: missing key file (clear error), passphrase-protected key (prompt), permission denied (403 JSON)
  • SFTP: upload to read-only path (permission error surfaced), mkdir race condition (MkdirAll idempotent)
  • S3: no credentials configured (SDK error surfaced as 401), empty bucket (empty list, no crash)
  • Upload: non-UTF-8 filename (percent-encoded safely)
  • Monaco: binary file opened for edit (hex fallback mode), very large file (lazy load chunks)

Limits and scale

A.P.E is built as a single-user local tool, and these are the places that assumption shows.

TodayThe local HTTP API has no authentication and relies on binding to 127.0.0.1:9000, and the terminal WebSocket skips origin checks, so a malicious page could try to reach it cross-site.

At scale—

TodayThere is no upload size limit, and anything over 32 MB is buffered to a local temp file before streaming.

At scale—

TodayThe 32 Go tests cover handlers, config and the SFTP client, but there are no frontend tests and no automated integration tests against real SSH or S3.

At scale—

Engineering deep divePipelines, code flow and implementation notes

0. Binary Bootstrap — main.go

markdown
$ ape [--host ec2-user@54.x.x.x] [--key ~/.ssh/id_rsa]
  │
  ├─ Parse CLI flags (host, key, port, bind-addr)
  ├─ sshClient.Dial("tcp", host+":22") → ssh.NewSession()
  │    └─ sftp.NewClient(sshConn) → SFTP session
  ├─ s3Client = aws.NewConfig() → s3.NewFromConfig()
  │
  ├─ Embed React build via //go:embed dist/*
  │    └─ http.FileServer(http.FS(embedFS)) → /
  │
  ├─ Register API routes:
  │    ├─ GET  /api/files?path=   → sftp.ReadDir()
  │    ├─ GET  /api/file?path=    → sftp.Open() → stream
  │    ├─ POST /api/upload        → multipart → sftp.Create()
  │    ├─ POST /api/mkdir         → sftp.MkdirAll()
  │    ├─ DEL  /api/delete        → sftp.Remove()
  │    ├─ GET  /api/s3/buckets    → s3.ListBuckets()
  │    └─ GET  /api/s3/objects    → s3.ListObjectsV2()
  │
  └─ http.ListenAndServe(bindAddr, mux)
       └─ Web UI ready at http://localhost:9000

1. Upload Pipeline — multipart → SFTP stream

markdown
POST /api/upload  [multipart/form-data: file, path]
  │
  ├─ r.ParseMultipartForm(32 MB)
  ├─ file, header = r.FormFile("file")
  ├─ remotePath = r.FormValue("path") + "/" + header.Filename
  │
  ├─ sftpClient.Create(remotePath)   ← opens remote file for writing
  │    └─ If parent dir missing → sftpClient.MkdirAll(dir)
  │
  ├─ io.Copy(remoteFile, file)       ← streams bytes, no local temp
  │    └─ Progress tracked via custom io.Writer wrapper
  │         └─ SSE stream → client EventSource (drag & drop bar)
  │
  └─ res.JSON({ success: true, path: remotePath, size: header.Size })

2. React File Explorer — Finder-style UX

markdown
FileExplorer (React 18 + TypeScript)
  │
  ├─ State: { path, entries, view: "grid"|"list", selected: Set<string> }
  │
  ├─ Grid View: thumbnail cards with file-type icons (Monaco-derived)
  ├─ List View: sortable table (name / size / modified)
  │
  ├─ Right-click context menu:
  │    ├─ Open in Monaco Editor  → GET /api/file → editor modal
  │    ├─ Download               → anchor[download] blob URL
  │    ├─ Rename                 → POST /api/rename
  │    └─ Delete                 → DEL /api/delete (confirm dialog)
  │
  ├─ Drag & Drop zone:
  │    └─ onDrop → FormData → POST /api/upload → SSE progress bar
  │
  ├─ Keyboard shortcuts:
  │    ├─ Cmd+N   → new folder dialog
  │    ├─ Delete  → delete selected
  │    └─ Cmd+C   → copy path to clipboard
  │
  └─ Breadcrumb nav: click any segment → navigate to that path

More design notes

AWS SDK v2 (no CLI dependency): S3 operations use the Go SDK directly rather than shelling out to aws s3 ls. Credentials come from ~/.aws/credentials or env vars, the same auth model users already have.
Monaco in the browser: editing happens client-side. The Go server only serves file bytes, and Monaco handles syntax highlighting, search and editing locally, which keeps the server stateless.

← All projects