A lightweight, Notepad++-inspired web editor backed by Gitea and/or GitHub repositories. The UI runs as a static SPA (Vite); OAuth and file APIs are used from the browser. Gitea works with no extra server. GitHub sign-in requires a small token proxy (your backend or serverless) because GitHub’s token endpoint is not callable from arbitrary browser origins (CORS). https://hiheo.github.io
Features
- Gitea OAuth2 (PKCE) – sign in with your Gitea instance
- GitHub OAuth2 (PKCE) – sign in when
VITE_GITHUB_CLIENT_IDandVITE_GITHUB_TOKEN_PROXY_URLare configured - Demo mode – Try demo on the login screen opens an in-memory workspace (no OAuth, changes not persisted)
- File browsing – lazy-loaded tree; explorer highlights and expands to the active tab when you switch tabs
- Monaco Editor – syntax highlighting for many languages
- Multi-tab editing with dirty state indicators
- Search & replace (current file and across open files)
- Keyboard shortcuts:
Ctrl+Ssave,Ctrl+Ffind,Ctrl+Hreplace,Ctrl+Btoggle sidebar - Responsive for large files
Open the app (default https://hiheo.github.io). You can:
- Click Try demo to use the editor without signing in.
- Click Sign in with Gitea if Gitea client ID is set.
- Click Sign in with GitHub only if both GitHub client ID and token proxy URL are set.
Architecture
Browser (SPA)
├─ Login: Gitea / GitHub / Try demo → src/main.ts
├─ Auth (multi-provider) → src/auth.ts, src/giteaAuth.ts, src/githubAuth.ts, src/provider.ts
├─ Gitea Contents API → src/gitea.ts
├─ GitHub REST API → src/github.ts
├─ Demo workspace (in-memory) → src/demoBackend.ts
├─ File tree (lazy load, tab sync) → src/filetree.ts
├─ Monaco Editor → src/editor.ts
├─ Tabs, search → src/tabs.ts, src/search.ts
└─ Config → src/config.ts
Supported file types
.txt, .json, .js, .ts, .py, .html, .css, .md, .yaml, .yml, .xml, and many more via Monaco.
Security notes
- OAuth tokens for Gitea/GitHub are stored in
localStorageunder provider-specific keys so sessions survive refresh; treat the device/browser as trusted. - This app does not add authorization beyond what Gitea/GitHub enforce for the signed-in user.
Tech stack
- Editor: Monaco Editor
- Language: TypeScript
- Build: Vite
- Auth: OAuth2 Authorization Code + PKCE
- Storage: Gitea Contents API / GitHub Contents API