How josiah-o/thrift-crowd-staking works
Main Components
• Frontend – Located in the "frontend" directory. This is built with React and Redux. It handles user interactions such as creating/joining Crowd Stake Groups and managing wallets.
• Backend – Found in the "backend" directory. Written in Haskell using Servant, it orchestrates the core logic, API endpoints, database interactions, and communication with Cardano nodes.
• Smart Contracts – In the "smart-contracts" directory. These contain Haskell/Plutus code for blockchain interactions and deployment procedures.
• Database – Although there isn’t a dedicated “database” directory, SQL files (schema and migrations) in the backend indicate integration with a PostgreSQL database.
• Blockchain Components – Cardano nodes and wallet integrations are essential external systems, specified in the README, for processing and verifying transactions on both Testnet and Mainnet.
• Infrastructure & Deployment – Dockerfiles in both the backend and frontend folders, docker-compose configuration, and environment configuration indicate that containerization and orchestration are part of the deployment architecture.
• Documentation & Guides – The "docs" directory contains technical and UX guides which can be referenced for additional architectural details not immediately evident in the code.
Mapping Out Relationships and Interactions
• The backend interacts with:
• The PostgreSQL database for storing group details and user information (schema.sql and migrations).
• The Cardano blockchain—configurable for Testnet or Mainnet—to process transactions and dispatch smart contract calls.
• The backend also interacts with the smart contracts by triggering deployments or transaction calls to the Cardano network.
• Docker deployments and orchestration (via docker-compose.yml) suggest that each of these major sections are containerized for modular deployment.
Architectural Patterns & Design Principles
• Separation of Concerns: Notice how the project’s various functions (UI, API, blockchain smart contracts, and database interactions) are separated into distinct directories.
• Full-Stack Architecture: For a dApp, it is important to highlight interaction between the frontend, backend, blockchain integrations, and external databases.