$ show snapshot-labs/snapshot-v1
Snapshot is a decentralized, off-chain, gasless governance platform for DAOs and communities. This repository is the legacy (v1) frontend client, a Vue 3 single-page application (SPA) built with TypeScript, Vite, and Tailwind CSS. It provides a full-featured interface for creating and managing governance spaces, submitting proposals, voting (single-choice, approval, quadratic, ranked-choice, weighted), delegating voting power, and configuring treasury execution via plugins like oSnap and safeSnap. The application interacts with Ethereum and other EVM-compatible chains through Web3 wallets (MetaMask, WalletConnect), fetches on-chain data via subgraphs and RPC calls, and stores proposal content and vote receipts on IPFS. Key entry points include the space creation wizard (SetupView), proposal creation (SpaceCreate), proposal listing and voting (SpaceProposals, SpaceProposal), space settings (SpaceSettings), delegation management (SpaceDelegates), and a boost incentive system (SpaceBoost). The architecture follows a composable-first pattern with extensive use of Vue 3 Composition API, a plugin system for extensible governance features, and a custom UI component library (Tune). External dependencies include @snapshot-labs/snapshot.js for voting logic, @snapshot-labs/lock for wallet connection, Apollo Client for GraphQL queries, and various blockchain APIs (Alchemy, Covalent, Tenderly). The codebase is well-structured but shows signs of technical drift: duplicate code between safeSnap and oSnap plugins, hardcoded API keys, deprecated Vite plugin APIs, and incomplete localization files.
The LLM identified 4 files worth highlighting for reuse:
Provides a clean adapter interface for reading and writing delegation state across different delegation implementations (Compound, split delegation). It abstracts away the underlying contract interactions and subgraph queries behind a unified API, making it easy to add new delegation types without modifying consuming components. This pattern is reusable for any multi-protocol blockchain integration.
A schema-driven form component that renders fields (string, number, boolean, array) based on a JSON schema definition. It handles validation, nested objects, and dynamic field addition. This pattern is highly reusable for any application needing configurable forms, and it is self-contained with minimal internal dependencies.
A comprehensive data fetching module for the oSnap optimistic governance plugin. It encapsulates logic for querying Gnosis Safe transaction APIs, Optimistic Governor subgraphs, on-chain state via multicall, and token list fetching. Despite being plugin-specific, the patterns for fallback chains, memoized fetches and proxy detection are reusable for any blockchain data aggregation.
A composable that provides reactive form validation logic using a validation schemas fetched from a remote API. It handles dynamic validation rules, error aggregation, and can be extracted for any form-heavy application. The pattern of fetching validation schemas and applying them reactively is a reusable pattern for server-driven validation.