How huc06/sharkbling works
Main components
• Frontend (Client): The client folder contains a React application (TypeScript) built with Vite. It houses the UI in the form of components (common, dashboard, modals, wallet, and UI primitives), pages, contexts, hooks, and library utilities used for blockchain interactions and API calls.
• Backend (Server): The server folder includes an Express-based backend (e.g., index.ts, routes.ts) which exposes API endpoints (e.g., for markets, predictions, social trends, and top predictors) and handles data storage and processing (via storage.ts).
• Smart Contracts (Move): Within the server/move folder, the project defines Move smart contracts (e.g., prediction_market.move) that are deployed to the Sui blockchain.
• Shared Code: The shared folder contains common schemas (schema.ts) that express data definitions used across both client and server to ensure consistency.
• External Integrations: The application also integrates with social media APIs (GitHub, LinkedIn, etc.) and uses blockchain Sui network. Wallet integrations (via SuiWallet in client) create an extra external link to users’ digital wallets.
Relationships and interactions
• Shared libraries and schema ensure that data formats are consistent between the client and server.
• The Frontend also directly interacts with external wallet APIs and possibly a Sui client library for blockchain transactions.
• Social media API integrations (with GitHub, LinkedIn, etc.) should be declared as external services that the Backend or even the Frontend can reach out to.
Architectural patterns and design principles
• Separation of concerns: There is a clear split between the frontend and backend with a well-defined API layer.
• Modular design: Organize UI components, contexts, and hooks within the frontend; API routes, storage, and configuration in the backend; and decentralized smart contracts in a dedicated folder.
• Decentralization: Smart contracts written in Move and deployed to Sui introduce an additional layer where trustless transactions are confirmed on the blockchain.
Additional details to capture
• File structure pointers to indicate that the client code uses modular UI components (UI primitives, modals, dashboards, etc.) and that the server deals with API and blockchain transaction logic.
• Mention that shared schemas ensure data consistency.
• Importance of wallet connectivity (with components like ConnectWalletButton and SuiWalletInfo) as a crucial integration point for user authentication and transactions.
• Divides the system into “Frontend (React/Vite)” and “Backend (Express, Smart Contracts)” components, with a clear “Shared Code” module.
• Captures the modular nature of the frontend (organizing components, contexts, hooks) and the backend (API endpoints, smart contract interactions on Sui).