How treasureproject/tdk-js works
Main Components
a. Core Components:
• API Service (apps/api)
• Core SDK Package (packages/core)
• Authentication Package (packages/auth)
• React Components Package (packages/react)
• Launcher Package (packages/launcher)
b. Integration Layer:
• Example Applications
• Third-party Services (Discord, Google, Apple, etc.)
• Blockchain Integration
┌─ Client Layer ─────────────────────────────────┐
• React Components (@treasure-dev/tdk-react) │
• Example Apps (Connect, Magicswap, Electron) │
• ┘
• ↕
┌─ Core Layer ──────────────────────────────────┐
• TDK Core (@treasure-dev/tdk-core) │
• Authentication (@treasure-dev/auth) │
• Launcher (@treasure-dev/launcher) │
• ┘
• ↕
┌─ API Layer ───────────────────────────────────┐
• TDK API Service │
• Prisma Database Layer │
• ┘
• ↕
┌─ External Services ────────────────────────────┐
• Authentication Providers │
• Blockchain Networks │
• Smart Contracts │
• ┘
Component Details
For each major component, include:
• Main responsibilities
• Key dependencies
• Integration points
Integration Flows
Workflows with numbered steps:
Technical Details
• Database schema references
• API endpoints
• Authentication methods
• Smart contract interactions
• State management flow
• The modular nature of the SDK
• Clear separation of concerns
• Integration possibilities
• Security boundaries
• Scalability points
Remember to:
• Keep components grouped logically
• Clear relationships between packages
• Authentication flow
• Demonstrate blockchain integration points
• Example application integration paths
This system design should provide a clear understanding of how the TDK components work together while maintaining the flexibility needed for different implementation scenarios.