How raimah89888/defendodoge works
Project type and purpose
• DefendoDoge is a full-stack Web3 security suite. It consists of:
• A frontend UI (React) for end users
• A backend “api-integration” layer that orchestrates multiple security-scanning services
• A set of smart-contract scripts for deployment and testing
• Example scripts and documentation
File structure
• Top-level directories:
• frontend/ – React single-page application
• api-integration/ – Node.js service modules (one per scan-tool)
• smart-contracts/ – Hardhat config and deploy scripts
• examples/ – CLI/demo scripts illustrating each service
• docs/ – Setup guides, API reference, contributing notes
• CI workflow: .github/workflows/main.yaml
• Config files: package.json in frontend & api-integration, hardhat.config.js
README for architecture hints
• Mentions six independent scan tools: Token Scanner, NFT Analyzer, DApp Checker, Airdrop Validator, Team & Community Checker, Web3 Phishing Detector
• Implies a modular design: each tool is a micro-library under api-integration/src/services
• Frontend calls backend services via HTTP or RPC; backend communicates with blockchain nodes and external APIs
Diagramming the system
a. Main components
1. End User (browser or CLI)
2. Frontend SPA (React)
3. API-Integration layer (Node.js micro-services)
4. Blockchain Network (Ethereum / EVM node providers)
5. External third-party APIs (e.g., Etherscan, OpenSea, community data sources)
6. Smart Contracts (deployed via Hardhat scripts)
7. Examples & CLI interfaces (optional auxiliary clients)
b. Relationships & interactions
• The End User interacts with the Frontend over HTTPS.
• Frontend issues REST/WebSocket calls to the API-Integration server.
• API-Integration dispatches requests to the appropriate service module (e.g., tokenScannerService).
• Each service module:
– Queries on-chain data from a blockchain node provider (Infura, Alchemy, etc.).
– Calls external REST APIs as needed (e.g., NFT marketplaces, social/community APIs).
– Applies business logic (fraud detection, risk scoring).
• For DApp Checker, the service may fetch and analyze smart-contract bytecode (optionally uses locally deployed contracts for testing).
• Smart-Contracts directory holds deployment scripts—these are run by developers via Hardhat; results may be used by both frontend (to display addresses) and backend (for simulation).
• Examples directory demonstrates direct usage of service modules through CLI or language bindings.
c. Architectural patterns & principles
• Modular / microservice-style within api-integration: one service per security function.
• Separation of concerns: UI (frontend), orchestration & business logic (backend), on-chain code (smart contracts).
• Stateless backend services (no persistent DB shown—results computed on the fly).
• CI/CD pipeline defined in GitHub Actions for testing and deployment.
d. Relevant technologies & libraries
• Frontend: React, Webpack or Create React App (index.js, App.js)
• Backend: Node.js, Express or custom HTTP server, web3.js/ethers.js
• Smart Contracts: Hardhat, ethers.js plugin, Solidity
• Examples: JavaScript, Python, Shell scripts
• CI: GitHub Actions