$ show tapexyz/tape
Tape is a decentralized video-sharing platform built on Lens Protocol. The monorepo contains multiple frontends: a legacy Next.js app (apps/web), a newer Vite + TanStack Router rewrite (apps/web-vite), an Expo/React Native mobile app, an embeddable video player, and an Open Graph image generator. The backend consists of a Hono API (apps/api) for oEmbed, DID resolution, metadata, and event ingestion, plus a cron service (apps/cron) for cleanup, analytics flushing, and S3 backups. Smart contracts for permissionless signup live in apps/contracts. The platform supports video upload, short-form bytes, comments, mirrors, collects, tips, follows, notifications, search, and profile management, all interacting with Lens Protocol's GraphQL APIs and on-chain contracts. Data flows through several layers: media is uploaded to IPFS/S3/Arweave, metadata is stored on Arweave or IPFS, and social actions are executed via Lens Protocol typed-data signing and broadcasting. The platform also runs an in-house analytics pipeline: browser events are queued through a service worker to Redis, flushed to ClickHouse by cron jobs, and backed up to S3. Postgres (via Prisma) stores platform-level data such as allowed tokens, profile toggles, curated profiles, and platform stats. Redis is used for caching and queueing throughout. Although primarily an application, the repository has a meaningful data/analytics component (ClickHouse schema, event/trail tracking, Redis-backed queues, S3 backup jobs) that could be reused independently. The codebase is actively maintained but carries migration debt: two web frontends, two UI kits (packages/ui and packages/winder), two Lens GraphQL clients (v1 and v2), and commented-out cron services indicate an in-progress transition. No meaningful test suite is present; CI focuses on Biome checks and builds.
The LLM identified 4 files worth highlighting for reuse:
Implements a reusable Apollo InMemoryCache field policy for cursor-based pagination. The merge/read functions handle concatenating pages, deduplicating by cache key, and preserving pageInfo. It is generic across any paginated GraphQL list and can be extracted into any Apollo Client project with minimal modification.
Encapsulates uploading files or metadata to Arweave via Irys, including client creation, funding, and upload logic. It is a self-contained utility that can be reused in any project needing permanent decentralized storage, without coupling to Tape-specific business logic.
A self-contained React hook that normalizes drag-and-drop events, tracks drag state, and exposes callbacks for drop zones. It is isolated from the rest of the monorepo and can be dropped into any frontend project to add file-drop or reorder interactions.
Parses HTML and extracts Open Graph and Twitter card metadata using Cheerio. This isolated helper powers the oEmbed route and is reusable for any link-preview or metadata-scraping service, independent of the rest of the API.