The Problem

Users need to move large files between personal devices without relying on third‑party cloud services. Conventional file‑sharing services introduce storage costs, privacy concerns, and size caps, forcing users to split or compress data before transfer.

What This Does

AlterSend implements a peer‑to‑peer (P2P) file‑transfer layer wrapped in native desktop (Electron) and mobile (React Native) front‑ends. The desktop entry point is apps/desktop/src/electron/main.ts, which boots the Electron main process, creates the window, and loads the React renderer (apps/desktop/src/renderer/App.tsx). The UI components (e.g., SendPage/SelectFilesView.tsx, ReceivePage/ReceiveFileList.tsx) invoke the bridge API (apps/desktop/src/renderer/api/bridgeApi.ts). That API forwards requests over IPC to the main process (apps/desktop/src/electron/ipc.ts), where the core transfer logic lives in runtime.ts, fileScan.ts, and sendToShortcut.ts. Persistent user data (paired devices, download location, account info) is stored via the JSON store helpers in apps/desktop/src/electron/store/.

On mobile, the native side lives in apps/mobile/modules/transfer-service (Android build.gradle and package.json) and apps/mobile/modules/media-store. The React‑Native UI (apps/mobile/app/(tabs)/send/index.tsx, receive/index.tsx) calls the same logical API exposed by the native module, which ultimately uses the same transport codebase found under packages/ (not listed in detail but referenced by the desktop and mobile modules).

How It Is Wired

  1. Startupnpm install (root) installs all workspaces. Running npm run desktop:start (script defined in apps/desktop/package.json) executes electron . which loads src/electron/main.ts.
  2. Main Processmain.ts creates the BrowserWindow, registers IPC channels via ipc.ts, and calls runtime.start() to spin up the P2P service.
  3. IPC Bridge – UI actions call bridgeApi.sendFiles(files)ipcRenderer.invoke('transfer:start', …). The main process handler in ipc.ts forwards to runtime.startTransfer(files).
  4. Transfer Engineruntime.ts uses fileScan.ts to enumerate file metadata, then starts a local HTTP/WebRTC listener (implementation inside runtime and the native transfer-service module). It generates a short URL stored in store/accountStore.ts.
  5. Link Distribution – The generated URL is returned via IPC, displayed in the renderer (SendPage/ShareView.tsx). The receiver opens the link in a browser or the mobile app, which contacts the sender’s listener through the signalling path (external STUN/TURN server not in repo).
  6. ReceptionReceivePage/ReceiveFileList.tsx subscribes to the transfer session via bridgeApi.acceptTransfer(id), which routes to ipc.tsruntime.acceptTransfer. Files are streamed directly to the download location defined in store/downloadLocation.ts.
  7. State Persistence – All pairing and config data flow through the JSON store helpers (createJsonStore.ts, writeFileViaTemp.ts).

The most “blast‑radius” module is runtime.ts; it orchestrates network sockets, file I/O, and IPC, so any change to its public API will ripple through both desktop and mobile modules. The IPC layer (ipc.ts) is a thin, well‑bounded façade, making it the preferred extension point for new features.

How To Use It

# Clone the repo
git clone https://github.com/moses-y/alterset.git
cd altersend

# Install all workspace dependencies
npm ci

# Desktop (macOS/Windows/Linux)
npm run desktop:start   # launches Electron with hot reload

# Mobile (iOS/Android) – Expo managed workflow
cd apps/mobile
npm run ios   # or `npm run android` for Android

Environment variables are read from the example files apps/desktop/.env.example and apps/mobile/.env.example; copy them to .env before running if you need to override defaults (e.g., custom signalling server URL).

Real‑World Use

A developer can embed AlterSend into an internal toolchain: a CI job builds a large artifact, then the engineer launches the desktop app, selects the artifact, and shares the generated link with a remote teammate. The teammate opens the link on their mobile device, and the file streams directly over the internet without ever hitting a corporate proxy or cloud bucket.

Code Health & Issues

  • Low – No critical structural warnings – tests (*.test.ts), CI workflows (.github/workflows/*.yml), and license (LICENSE) are present.
  • Medium – Monorepo complexitypackages/ holds 534 files but no explicit documentation of internal module boundaries; a newcomer must explore to locate the core transfer library.
  • Low – Limited automated release validation – CI runs lint and tests but does not verify that the generated installers (apps/desktop/build/*) are signed on every platform.

The Bottom Line

AlterSend provides a functional, cross‑platform P2P file‑transfer stack with a clear Electron main‑process → renderer → IPC wiring. The codebase is reasonably healthy, though the core transfer engine is concentrated in a few files, so changes there require care. It is suitable for teams that need an open‑source, no‑cloud alternative for moving large assets between devices.