61 lines
2.6 KiB
Markdown
61 lines
2.6 KiB
Markdown
# Internal Drop MVP Implementation Plan
|
|
|
|
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
|
|
|
|
**Goal:** Build the PRD's recommended MVP: a Go single-binary LAN file and text transfer app with temporary local storage.
|
|
|
|
**Architecture:** The service is a Go standard-library monolith. HTTP serves the static frontend and REST endpoints; a small internal WebSocket implementation handles presence, text offers, file offers, and transfer status messages; files are cached under a configured temporary directory and removed by TTL cleanup.
|
|
|
|
**Tech Stack:** Go standard library only, embedded static HTML/CSS/JS, local filesystem storage, Docker Compose and systemd deployment docs.
|
|
|
|
---
|
|
|
|
### Task 1: Core Domain and Storage
|
|
|
|
**Files:**
|
|
- Create: `go.mod`
|
|
- Create: `internal/drop/types.go`
|
|
- Create: `internal/drop/config.go`
|
|
- Create: `internal/drop/store.go`
|
|
- Create: `internal/drop/store_test.go`
|
|
|
|
- [x] Write failing tests for session creation, code conflict recovery, transfer expiry, and file storage cleanup.
|
|
- [x] Implement thread-safe in-memory users/transfers plus local filesystem storage.
|
|
- [x] Run `go test ./internal/drop` and confirm pass.
|
|
|
|
### Task 2: HTTP API and WebSocket Hub
|
|
|
|
**Files:**
|
|
- Create: `internal/drop/websocket.go`
|
|
- Create: `internal/drop/hub.go`
|
|
- Create: `internal/drop/server.go`
|
|
- Create: `internal/drop/server_test.go`
|
|
|
|
- [x] Write tests for API handlers and WebSocket frame encode/decode helpers.
|
|
- [x] Implement REST endpoints, static file serving, WebSocket handshake, hub registration, presence broadcasting, text forwarding, transfer accept/reject/complete events.
|
|
- [x] Run `go test ./internal/drop` and confirm pass.
|
|
|
|
### Task 3: Frontend Experience
|
|
|
|
**Files:**
|
|
- Create: `web/index.html`
|
|
- Create: `web/styles.css`
|
|
- Create: `web/app.js`
|
|
|
|
- [x] Build a first-screen app UI with user code, nickname, peer list, text/file sender, incoming requests, and status log.
|
|
- [x] Use REST for session/upload/download and WebSocket for live events.
|
|
- [x] Open the app locally and verify browser render plus file-offer notification flow.
|
|
|
|
### Task 4: Entrypoint and Deployment
|
|
|
|
**Files:**
|
|
- Create: `main.go`
|
|
- Create: `Dockerfile`
|
|
- Create: `docker-compose.yml`
|
|
- Create: `internal-drop.service.example`
|
|
- Create: `README.md`
|
|
|
|
- [x] Wire config, server startup, static embed, and graceful shutdown.
|
|
- [x] Document Docker Compose and systemd deployment.
|
|
- [x] Run build and tests once Go is available: `go test ./...` and `go build .`.
|