A high-security monorepo for web SDKs with React, TypeScript, and advanced security features. This monorepo supports multiple SDK packages (payment, bank, game, etc.) with shared components, utilities, and security features.
- High Security: Anti-debugging, F12 blocking, context menu disabling
- Multi-SDK Support: Easy creation and management of multiple SDK packages
- Modern Tech Stack: React, TypeScript, Vite, Turborepo, pnpm workspaces
- Comprehensive Testing: Unit tests with Vitest, E2E tests with Playwright
- Manual Testing: Storybook for component development and testing
- Automation: Husky, Changesets, ESLint, Prettier
- AWS Deployment: CodePipeline, CodeBuild, CodeCommit integration
izion-sdk/
├── .github/ # GitHub workflows and templates
├── packages/ # Shared packages
│ ├── shared/ # Common utilities, types, constants
│ ├── ui/ # Shared UI components
│ ├── api/ # API client with interceptors
│ └── security/ # Advanced security features
├── sdks/ # Individual SDK packages
│ ├── payment/ # Payment processing SDK
│ ├── bank/ # Banking services SDK
│ └── game/ # Gaming features SDK
├── apps/ # Example applications
├── tools/ # Build tools and utilities
├── scripts/ # Automation scripts
│ └── create-sdk.js # Template generator for new SDKs
├── package.json # Root package configuration
├── turbo.json # Turborepo configuration
├── tsconfig.json # TypeScript configuration
└── README.md # This file
Mục đích: Chứa các utilities, types, constants, và helper functions được chia sẻ giữa các SDK Nội dung:
- Type definitions (IzionConfig, ApiResponse, BaseSDKOptions)
- Utility functions (UUID generation, error formatting, validation)
- Storage management (LocalStorage wrapper với encryption)
- Security utilities (basic encryption/decryption)
- Constants và enums chung
Mục đích: Shared UI components được sử dụng trong tất cả các SDK Nội dung:
- Button, Input, Modal, Loader components
- Layout components (Header, Sidebar, Grid)
- Form components với validation
- Theme provider và styling utilities
- Storybook stories cho manual testing
Mục đích: API client với interceptors, authentication, và error handling Nội dung:
- Axios instance với pre-configured interceptors
- Request/response encryption/decryption
- Automatic retry logic với exponential backoff
- Token refresh mechanism
- Error handling và logging
Mục đích: Advanced security features để ngăn chặn developer tools và debugging Nội dung:
- Anti-debugger detection
- F12, right-click, keyboard shortcuts blocking
- Console obfuscation
- Developer tools detection
- Content protection mechanisms
Mục đích: SDK cho payment processing Features:
- Payment form components
- Credit card validation
- Payment gateway integration
- Transaction history
- Secure payment processing
Mục đích: SDK cho banking services Features:
- Account management
- Transaction processing
- Balance inquiries
- Banking security features
- Financial reporting
Mục đích: SDK cho gaming features Features:
- Game state management
- Player authentication
- Leaderboards
- In-game purchases
- Game analytics
- React 18: UI framework với modern features
- TypeScript: Type safety và developer experience
- Vite: Fast build tool và development server
- SCSS: CSS preprocessing với variables và mixins
- pnpm workspaces: Efficient package management
- Turborepo: Build system optimization và caching
- Changesets: Version management và release automation
- ESLint: Code linting với security rules
- Prettier: Code formatting
- Husky: Git hooks automation
- Vitest: Unit testing framework
- Playwright: End-to-end testing
- Storybook: Component development và manual testing
- TypeScript: Static type checking
- SCSS: Styling với preprocessing
- Axios: HTTP client với interceptors
- AWS CodePipeline: Continuous integration
- AWS CodeBuild: Build automation
- AWS CodeCommit: Source control
- Node.js >= 18.0.0
- pnpm >= 8.0.0
# Clone the repository
git clone <repository-url>
cd izion-sdk
# Install dependencies
pnpm install
# Build all packages
pnpm build# Start development mode for all packages
pnpm dev
# Build all packages
pnpm build
# Run tests
pnpm test
# Run E2E tests
pnpm test:e2e
# Lint code
pnpm lint
# Format code
pnpm formatpnpm dev- Start development mode cho tất cả packagespnpm build- Build tất cả packagespnpm test- Run unit tests cho tất cả packagespnpm test:e2e- Run E2E testspnpm lint- Lint code trong tất cả packagespnpm format- Format code với Prettierpnpm clean- Clean build artifactspnpm create-sdk <name>- Tạo SDK mới từ template
Trong mỗi package/SDK directory:
pnpm dev- Development mode cho package đópnpm build- Build package đópnpm test- Run tests cho package đópnpm storybook- Start Storybook (cho UI packages)
Sử dụng script template để tạo SDK mới:
# Create new SDK
pnpm create-sdk <sdk-name> [description]
# Examples
pnpm create-sdk payment "Payment processing SDK"
pnpm create-sdk ecommerce "E-commerce features SDK"
pnpm create-sdk analytics "Analytics and tracking SDK"Script sẽ tự động tạo:
- Package structure với src/, components/, context/, styles/
- package.json với dependencies và scripts
- TypeScript configuration
- Basic React components
- README với documentation
- Test setup
- F12 key blocking
- Right-click context menu disabled
- Ctrl+Shift+I, Ctrl+U, Ctrl+Shift+C blocking
- Developer tools detection với automatic redirect
- Request/response encryption
- Secure storage với encryption
- API key protection
- Session management với auto-refresh
- Text selection disabled
- Drag and drop disabled
- Console obfuscation
- Anti-debugging techniques
- Test individual components và functions
- Mock external dependencies
- Code coverage reporting
- Fast feedback loop
- Test complete user workflows
- Cross-browser testing
- Visual regression testing
- Performance monitoring
- Interactive component development
- Visual testing của UI components
- Documentation và examples
- Design system validation
- Mỗi SDK có riêng context, components, styles
- Shared utilities trong packages/shared
- Reusable UI components trong packages/ui
- API logic tập trung trong packages/api
- Luôn encrypt sensitive data
- Validate inputs ở cả client và server
- Sử dụng security headers
- Regular security audits
- Code splitting cho từng SDK
- Tree shaking để remove unused code
- Bundle size monitoring
- Caching strategies
- Connect repository với CodeCommit
- Configure build stages trong CodeBuild
- Set up deployment targets
- Configure environment variables
- Development: Local development với hot reload
- Staging: Testing environment với production-like setup
- Production: Optimized builds với security features enabled
Mỗi SDK có thể deploy trên domain riêng:
- payment.izion.com
- bank.izion.com
- game.izion.com
- Monorepo setup với Turborepo
- Basic packages (shared, ui, api, security)
- SDK template generator
- Security features implementation
- Advanced Storybook setup
- Comprehensive test coverage
- Performance optimization
- Documentation website
- AWS deployment pipeline
- Monitoring và logging
- Error tracking
- Performance analytics
- Fork the repository
- Create feature branch (
git checkout -b feature/new-feature) - Make changes và test thoroughly
- Commit với conventional commit format
- Push và create Pull Request
type(scope): description
feat(payment): add credit card validation
fix(security): resolve F12 blocking issue
docs(readme): update installation guide
MIT License - see LICENSE file for details.
- Issues: Create GitHub issue với detailed description
- Documentation: Check package README files
- Security: Report security issues privately
Built with ❤️ by Izion Team