Advanced
Architecture
Understanding Forge's technical architecture and design decisions
System Overview
Forge is built as a modern web application using Next.js 15 with the App Router. The architecture follows a clean separation of concerns with distinct layers for presentation, business logic, and data access.
Architecture Layers
Presentation Layer
React components, UI state, and user interactions
API Layer
Next.js API routes, request handling, validation
Business Logic Layer
Solana Agent Kit integration, plugin orchestration
Blockchain Layer
Solana Web3.js, wallet adapters, RPC communication
Technology Stack
Frontend
- • Next.js 15: React framework with App Router
- • React 19: UI library with latest features
- • TypeScript: Type-safe development
- • Tailwind CSS: Utility-first styling
- • Lucide React: Icon library
Backend
- • Next.js API Routes: Serverless functions
- • OpenAI API: GPT-4 for agent intelligence
- • Solana Web3.js: Blockchain interaction
- • Axios: HTTP client
Blockchain
- • Solana Agent Kit: Core agent framework
- • Wallet Adapter: Multi-wallet support
- • SPL Token: Token program library
- • Metaplex: NFT standards
Development
- • Node.js 22+: Runtime environment
- • npm/yarn: Package management
- • ESLint: Code linting
- • PostCSS: CSS processing
Component Architecture
Client Components
Interactive components that require client-side JavaScript:
- • Dashboard navigation and layout
- • Agent chat interface
- • Wallet connection components
- • Interactive forms and inputs
- • Real-time data displays
Server Components
Components rendered on the server for better performance:
- • Static page content
- • Documentation pages
- • Initial data fetching
- • SEO-optimized content
Shared Components
Reusable components used across the application:
- • Logo and branding
- • Card components
- • Icon wrappers
- • Text effects
- • Layout components
Data Flow
Agent Chat Flow
Wallet Transaction Flow
Plugin System
Modular Design
Forge uses a plugin-based architecture for blockchain operations:
- • Token Plugin: SPL token operations
- • NFT Plugin: Metaplex NFT functionality
- • DeFi Plugin: Protocol integrations
- • Misc Plugin: Utility functions
Plugin Benefits
- ✓ Modular and maintainable codebase
- ✓ Easy to extend with custom functionality
- ✓ Clear separation of concerns
- ✓ Independent testing and deployment
- ✓ Reduced bundle size (tree-shaking)
Security Architecture
Private Key Management
Private keys never leave the wallet extension. All transactions are signed client-side using the Wallet Adapter protocol.
API Security
API routes use environment variables for sensitive data. Rate limiting prevents abuse. Request validation ensures data integrity.
RPC Communication
All blockchain communication uses HTTPS. Custom RPC endpoints can be configured for enhanced security and performance.
Performance Optimizations
Code Splitting
Next.js automatically splits code by routes, loading only necessary JavaScript.
Server Components
Static content rendered on server reduces client-side JavaScript.
Image Optimization
Next.js Image component provides automatic optimization and lazy loading.
Request Batching
Multiple blockchain requests batched to reduce RPC calls.
Deployment Architecture
Forge can be deployed to various platforms:
- • Vercel: Zero-config deployment with edge functions
- • Docker: Containerized deployment for custom infrastructure
- • Self-hosted: Node.js server with PM2 or similar
- • Static Export: Pre-rendered static site for CDN hosting
On this page
