Tech Stack
Blockchain & Smart Contracts
Core Technologies
| Layer | Technology | Version | Purpose |
|---|---|---|---|
| Blockchain | Sui Network | Mainnet | Main Infrastructure |
| Language | Move | Latest | Smart Contracts |
| Variation Engine | On-chain Move | v1.0 | Quiz Security |
| Storage | IPFS + Arweave | - | Content Storage |
| Oracle | Pyth Network | v1.0 | Price Data |
Why Sui Was Chosen
- High Throughput: Processes thousands of transactions per second
- Low Latency: Near real-time finality
- Parallel Processing: Independent transaction parallel execution
- Gas Efficiency: Predictable and low gas fees
- Move Language: Safe and expressive smart contracts
Frontend
Web Application Stack
| Component | Technology | Version | Role |
|---|---|---|---|
| Framework | Next.js | 14 | React Meta-framework |
| Language | TypeScript | 5.0 | Type Safety |
| UI Library | Tailwind CSS | 3.4 | Styling |
| Components | shadcn/ui | Latest | UI Components |
| State Management | Zustand | 4.4 | Client State |
| Sui Integration | @mysten/sui.js | Latest | Blockchain Integration |
| Wallet Integration | @mysten/dapp-kit | Latest | Wallet Management |
Main Libraries
{
"dependencies": {
"@mysten/sui.js": "^0.48.0",
"@mysten/dapp-kit": "^0.12.0",
"next": "^14.0.0",
"react": "^18.2.0",
"typescript": "^5.0.0",
"tailwindcss": "^3.4.0",
"zustand": "^4.4.0",
"@tanstack/react-query": "^5.0.0",
"wagmi": "^2.0.0",
"viem": "^2.0.0"
}
}
Backend (Minimized)
API and Service Layer
| Service | Technology | Purpose | Scalability |
|---|---|---|---|
| API Server | Node.js + Express | Metadata Serving | Horizontal |
| Database | PostgreSQL | Off-chain Cache | Read Replica |
| File Storage | IPFS Pinning | Content Availability | Multi-node |
| Authentication | JWT + Wallet Signature | User Authentication | Stateless |
| Queue System | Redis + Bull | Asynchronous Jobs | Cluster |
Microservice Architecture
┌─────────────────────────────────────┐
│ API Gateway (Kong) │
└─────────────────────────────────────┘
│
┌─────────────┼─────────────┐
▼ ▼ ▼
┌─────────┐ ┌─────────┐ ┌─────────┐
│ Auth │ │Metadata │ │Analytics│
│ Service │ │ Service │ │ Service │
└─────────┘ └─────────┘ └─────────┘
AI & Security Layer
Variation Engine Integration
Core Features
- Quiz Encryption: Zero-knowledge encryption
- Question Transformation: Real-time variation generation
- Answer Validation: Semantic accuracy judgment
- Security Management: Key management and access control
API Endpoints
interface VariationEngine {
// Quiz encryption
encryptQuiz(content: string): Promise<EncryptedQuiz>;
// Variation generation
generateVariant(quizId: string, seed: string): Promise<TransformedQuiz>;
// Answer validation
validateAnswer(answer: string, quizId: string): Promise<boolean>;
}
Infrastructure & DevOps
Deployment Environment
| Environment | Service | Purpose |
|---|---|---|
| Production | Vercel | Frontend Hosting |
| API | Railway | Backend Services |
| Database | Supabase | PostgreSQL |
| Storage | IPFS + Pinata | Distributed Storage |
| CDN | Cloudflare | Global Distribution |
CI/CD 파이프라인
name: Deploy Pipeline
on:
push:
branches: [main]
jobs:
test:
- Run unit tests
- Run integration tests
- Type checking
build:
- Build frontend
- Build smart contracts
- Generate artifacts
deploy:
- Deploy contracts to Sui
- Deploy frontend to Vercel
- Update API services
Monitoring & Analytics
Monitoring Stack
| Tool | Purpose | Metrics |
|---|---|---|
| Sentry | Error Tracking | Error Rate, Stack Traces |
| Posthog | User Analytics | User Behavior, Conversion Rate |
| Grafana | System Metrics | Performance, Availability |
| Datadog | APM | Response Time, Throughput |
Key Metrics
-
Business Metrics
- DAU/MAU
- Exam Completion Rate
- Matching Success Rate
- Revenue
-
Technical Metrics
- API Response Time
- Transaction Success Rate
- Gas Usage
- Error Rate
Security Considerations
Security Layers
-
Smart Contract Security
- Formal verification
- Audit by CertiK
- Bug bounty program
-
Application Security
- OWASP Top 10 compliance
- Rate limiting
- DDoS protection
- CSP headers
-
Data Security
- Encryption at rest & in transit
- PII minimization
- GDPR compliance
Performance Optimization
Frontend Optimization
- Code Splitting: Reduce bundle size with dynamic imports
- Image Optimization: Utilize Next.js Image component
- Caching Strategy: Data caching with SWR/React Query
- SSR/SSG: SEO and initial loading optimization
Blockchain Optimization
- Batch Processing: Multiple operations in single transaction
- Gas Optimization: Efficient data structure usage
- Indexing: Event-based off-chain indexing
- Caching: Cache frequently queried data
Development Tools
Essential Tools
# Sui CLI
cargo install --locked --git https://github.com/MystenLabs/sui.git sui
# Move Analyzer
cargo install --git https://github.com/move-language/move move-analyzer
# Development dependencies
npm install -D @types/node typescript eslint prettier
VS Code Extensions
- Move Analyzer
- Sui Move Syntax
- TypeScript + ESLint
- Tailwind CSS IntelliSense
Future Technology Roadmap
Short-term (3 months)
- WebSocket real-time updates
- Progressive Web App
- Multi-language support
Mid-term (6 months)
- Mobile App (React Native)
- GraphQL API
- AI recommendation system
Long-term (12 months)
- Cross-chain support
- Decentralized storage
- Zero-knowledge proofs