Skip to main content

Technical Stack

Overview

Karpous is built on a modern, scalable technology stack designed for security, performance, and developer experience.


Backend Stack

Core Framework

TechnologyVersionPurpose
Encore.dev1.48+Backend framework
TypeScript5.2+Programming language
Node.js18+Runtime environment

Database & Storage

TechnologyVersionPurpose
PostgreSQL15+Primary database
Supabase-Managed PostgreSQL hosting
Drizzle ORM0.44+Database ORM
Redis7+Caching layer

Authentication

TechnologyVersionPurpose
jsonwebtoken9.xJWT token handling
bcryptjs3.xPassword hashing
firebase-admin12.xGoogle OAuth
tweetnacl1.xSolana signature verification

Communication

TechnologyVersionPurpose
nodemailer7.xEmail delivery
axios1.xHTTP client
ioredis5.xRedis client

Validation & Utils

TechnologyVersionPurpose
zod4.xSchema validation
i18next25.xInternationalization
nanoid5.xUnique ID generation
uuid11.xUUID generation

Blockchain Stack

Smart Contracts

TechnologyVersionPurpose
Solidity0.8.26Contract language
FoundryLatestDevelopment framework
ForgeLatestTesting & deployment

Contract Libraries

LibraryVersionPurpose
Solmate6.xGas-optimized primitives
OpenZeppelin5.xSecurity standards

Blockchain Integration

TechnologyVersionPurpose
ethers.js6.xEthereum library
@solana/web3.js1.87+Solana library
viemLatestTypeScript Ethereum client

Networks

NetworkChain IDPurpose
Base Mainnet8453Production
Base Sepolia84532Testnet

Frontend Stack

Web Application

TechnologyVersionPurpose
Next.js14+React framework
React18+UI library
TypeScript5.xType safety
TailwindCSS3.xStyling

Mobile Application

TechnologyVersionPurpose
React Native0.73+Cross-platform mobile
Expo50+Development platform
TypeScript5.xType safety

State Management

TechnologyPurpose
TanStack QueryServer state
ZustandClient state

Web3 Integration

TechnologyPurpose
wagmiReact hooks for Ethereum
RainbowKitWallet connection
@solana/wallet-adapterSolana wallets

Infrastructure Stack

Cloud Services

ServicePurpose
AWS / GCPCloud hosting
CloudflareCDN & DDoS protection
SupabaseDatabase hosting

Security

ServicePurpose
Cloudflare WAFWeb application firewall
AWS KMSKey management
HashiCorp VaultSecrets management

Monitoring

ToolPurpose
Encore DashboardAPI observability
SentryError tracking
GrafanaMetrics visualization

CI/CD

ToolPurpose
GitHub ActionsCI/CD pipelines
Encore CloudBackend deployment
VercelFrontend deployment

Development Tools

IDEs & Editors

ToolPurpose
VS CodePrimary IDE
CursorAI-assisted development

Code Quality

ToolPurpose
ESLintJavaScript linting
PrettierCode formatting
SolhintSolidity linting

Testing

ToolPurpose
VitestUnit testing (Backend)
FoundrySmart contract testing
JestFrontend testing
PlaywrightE2E testing

Version Control

ToolPurpose
GitVersion control
GitHubRepository hosting
Conventional CommitsCommit standards

Package Managers

EnvironmentTool
BackendYarn 1.x
Frontendpnpm
ContractsForge (Foundry)

API Standards

REST API

  • OpenAPI 3.0 specification
  • JSON response format
  • JWT authentication
  • Rate limiting per endpoint

WebSocket

  • Real-time notifications
  • Live price updates
  • Transaction status updates

Security Standards

Encryption

TypeStandard
At RestAES-256-GCM
In TransitTLS 1.3
Passwordsbcrypt (cost 12)
JWT SigningRS256

Authentication

MethodImplementation
OTPEmail/SMS verification
Web3Wallet signature (ed25519)
OAuthGoogle via Firebase
MFATOTP support

Architecture Decisions

Why Encore.dev?

ConsiderationBenefit
TypeScript-firstFull type safety
Built-in infraLess configuration
Auto-scalingHandles traffic spikes
ObservabilityBuilt-in monitoring

Why Base (L2)?

ConsiderationBenefit
Low feesCost-effective transactions
EVM compatibleSolidity contracts
Fast finalityQuick confirmations
Coinbase backingEnterprise reliability

Why Drizzle ORM?

ConsiderationBenefit
TypeScript-firstType-safe queries
LightweightNo runtime overhead
SQL-likeFamiliar syntax
MigrationsSchema management

Why BoringVault Pattern?

ConsiderationBenefit
Minimal codeFewer attack vectors
No fund storageMaximum security
ImmutableCannot be modified
AuditableEasy to verify

Version Requirements

Minimum Versions

{
"node": ">=18.0.0",
"typescript": ">=5.2.0",
"solidity": "0.8.26",
"postgres": ">=15.0"
}
{
"node": "20.x LTS",
"typescript": "5.3.x",
"encore": "1.48.x",
"foundry": "latest"
}

Dependency Overview

Backend Dependencies

Core:
├── encore.dev # Framework
├── typescript # Language
├── drizzle-orm # Database
└── postgres # DB driver

Auth:
├── jsonwebtoken # JWT
├── bcryptjs # Hashing
├── firebase-admin # OAuth
└── tweetnacl # Crypto

Communication:
├── nodemailer # Email
├── axios # HTTP
└── ioredis # Cache

Blockchain:
├── ethers # Ethereum
├── @solana/web3.js # Solana
└── bs58 # Encoding

Smart Contract Dependencies

solmate/
├── auth/Auth.sol # Authorization
├── tokens/ERC20.sol # Token standard
└── utils/SafeTransferLib.sol

@openzeppelin/
├── access/AccessControl.sol
├── utils/ReentrancyGuard.sol
└── utils/structs/EnumerableSet.sol

Performance Benchmarks

API Response Times

Endpoint TypeTargetMax
Read (cached)50ms100ms
Read (DB)100ms200ms
Write150ms300ms
Blockchain500ms2000ms

Database Performance

Query TypeTarget
Simple SELECTunder 10ms
Complex JOINunder 50ms
Batch INSERTunder 100ms
Full-text searchunder 100ms

Smart Contract Gas

OperationGas Estimate
Deposit~150,000
Withdrawal Request~120,000
Yield Claim~100,000
Admin Config~50,000