Appearance
Overview
The Pocketbook certificate management system provides a comprehensive platform for creating, managing, and verifying digital certificates backed by blockchain technology. This guide covers all aspects of certificate management including creation, deployment, gifting, warranty integration, and revocation.
Key Features
- Blockchain-backed ownership: Certificates are minted as NFTs on Polygon blockchain
- QR code verification: Public proof of ownership accessible to anyone
- Warranty integration: Product warranties with auto-calculation and status tracking
- Certificate gifting: Secure transfer system with encrypted notifications
- Burn functionality: Authorized revocation and permanent destruction
- Hybrid architecture: Fast database queries with blockchain verification
- Public transparency: Verification pages accessible without authentication
System Architecture
Production Architecture
The certificate system operates across multiple layers:
Frontend Layer
- Location:
www.pocketbook.studio(Vercel-hosted static site) - Components: React-based certificate viewer, creation forms, public verification pages
- Routing: Client-side routing with certificate-specific routes
API Server Layer
- Location:
api.pocketbook.studio(separate server deployment) - Endpoints: RESTful API for certificate operations
- Authentication: JWT tokens and API key support
Blockchain Layer
- Network: Polygon (for production)
- Smart Contract: NFT contract with burn, transfer, and admin functions
- Verification: Immutable ownership records
Database Layer
- Storage: MongoDB for certificate metadata and rich information
- Purpose: Fast queries, analytics, and enhanced user experience
- Integrity: Includes transactionHash, blockNumber, and tokenId for verification
Data Flow
User Action → Frontend → API Server → Database + Blockchain → Response
↓
Certificate Record Created
↓
QR Code Generated → Public VerificationHybrid Approach Benefits
Performance: Database queries (sub-100ms) vs blockchain queries (3-5 seconds) Scalability: Handle 100K+ certificates efficiently Rich Metadata: Store detailed information not possible on-chain Reliability: Defense in depth - if blockchain RPC fails, certificates still load Analytics: Track certificate views, geographic distribution, and usage patterns
Certificate Creation and Deployment
Creating Standard Certificates
Via SingleMint Component:
- Navigate to enterprise dashboard
- Click "Create Certificate"
- Fill in certificate details:
- Name and description
- Category selection
- Upload images
- Select template (optional) for custom fields
- Click "Mint" to create on blockchain
Via SingleMintVoucher Component:
- Navigate to enterprise dashboard
- Click "Create Voucher"
- Configure voucher parameters
- Set redemption conditions
- Create voucher for future minting
Deployment to Production
When deploying certificate features to production:
Step 1: Deploy API Server Updates
bash
# On the API server (api.pocketbook.studio)
git pull origin main
npm run build:server
npm run restart:prodStep 2: Deploy Frontend Updates
bash
# Frontend deployment triggers automatically via Vercel
git push origin mainStep 3: Verify Deployment
Test critical endpoints:
bash
# API Health Check
curl https://api.pocketbook.studio/api/certificate/health
# Certificate Public API
curl https://api.pocketbook.studio/api/certificate/public/0
# Frontend Route
https://www.pocketbook.studio/certificate/0Database Integration
Certificate data is automatically stored in MongoDB when minting occurs:
Certificate Model Structure:
typescript
{
id: string;
tokenId: number;
name: string;
imageUrl: string;
metadata: {
name: string;
artist: string;
category: string;
description: string;
tokenId?: string;
warranty?: WarrantyMetadata;
// ... other fields
};
provenance: Array<ProvenanceEntry>;
transactionHash: string;
blockNumber: number;
createdAt: Date;
updatedAt: Date;
}QR Code Verification
Overview
Certificates include QR codes that allow anyone to verify ownership and view certificate details without authentication.
How It Works
QR Code Generation:
- Automatically generated when certificate is created
- Links to:
www.pocketbook.studio/certificate/{id} - Accessible via "Show QR Code" button in Certificate Viewer
Public Verification Flow:
- User scans QR code with any smartphone camera
- Browser opens public certificate page
- API fetches certificate data:
api.pocketbook.studio/api/certificate/public/{id} - Public viewer displays:
- Certificate image and metadata
- Ownership information (if available)
- Provenance history
- Warranty information (if applicable)
- Blockchain verification link
Security Features
- No Authentication Required: Public access for viewing only
- No Sensitive Data: Only certificate metadata exposed
- CORS Headers: Proper cross-origin access configuration
- Rate Limiting: Applied via existing middleware
- Export Restrictions: PDF export only available to certificate owners
Implementation Files
API Routes:
src/server/routes/certificateRoutes.ts- Certificate API endpoints
Frontend Components:
src/pages/PublicCertificate.tsx- Public certificate viewer pagesrc/components/CertificateViewer.tsx- QR code modal
Router Configuration:
src/App.tsx- Public certificate route registrationsrc/server.ts- API route registration
Warranty Integration
Overview
Comprehensive product warranty support integrated into the certificate system with auto-calculation, validation, and visual status tracking.
Creating Warranty Certificates
Step 1: Create Warranty Template
- Open Template Manager (click "Manage" button in SingleMint or SingleMintVoucher)
- At the top, locate "Product Warranty Template" card
- Click "Create Warranty Template" button
- Template is instantly created with 9 pre-configured fields
Step 2: Fill in Warranty Details
Select "Product Warranty Certificate" from template dropdown
Complete required fields:
- Warranty Period (dropdown): 1 year, 2 years, 3 years, 5 years, 10 years, Lifetime
- Warranty Type (dropdown): Manufacturer, Extended, Limited, Full Coverage, Parts Only, Labor Only
- Warranty Start Date (date picker): When coverage begins
- Warranty End Date (auto-calculated): Automatically computed from period + start date
- Coverage Details (textarea): What is covered
- Exclusions (optional): What is NOT covered
- Claim Process (textarea): How to file a claim
- Contact Information (text): Email or phone for warranty service
- Terms & Conditions URL (optional): Link to full terms
Upload product images
Mint certificate
Auto-calculation Features
End Date Calculation:
- Watches warranty period and start date fields
- Automatically calculates end date (e.g., "2 years" = start + 2 years)
- Supports "Lifetime" warranties (set to 100 years)
- Allows manual override if needed
Implementation:
typescript
// File: src/utils/warrantyCalculations.ts
// Calculate end date from period
calculateWarrantyEndDate(startDate: string, period: string): string
// Check warranty status
isWarrantyExpired(endDate: string): boolean
getWarrantyStatus(startDate: string, endDate: string): 'active' | 'expired' | 'future'
// Display helpers
formatWarrantyPeriod(period: string): string
getDaysRemaining(endDate: string): numberWarranty Display
Certificate Viewer:
- Collapsible "Product Warranty" section in Details tab
- Status chip with color coding:
- Green: Active warranty
- Red: Expired or less than 1 hour remaining
- Blue: Future/Not yet active
- Expandable view shows all warranty details
Public Verification:
- Warranty information visible on public certificate pages
- Same collapsible interface for transparency
- No authentication required to view
Validation and Warnings
Before minting, the system checks for expired warranties:
- If warranty end date has passed, displays confirmation dialog
- Warns user but allows proceeding (non-blocking)
- Helps prevent accidental creation of expired warranty certificates
Warranty Metadata Structure
typescript
warranty?: {
period: string; // e.g., "2 years", "5 years", "Lifetime"
type: string; // e.g., "Manufacturer", "Extended"
startDate: string; // ISO date string
endDate: string; // ISO date string (calculated or manual)
coverage: string; // Coverage details
exclusions: string; // What's not covered
claimProcess: string; // How to file a claim
contactInfo: string; // Warranty service contact
termsUrl?: string; // Link to full warranty terms
}Key Files
Components:
src/components/WarrantyInfoSection.tsx- Display componentsrc/components/DynamicCustomFields.tsx- Auto-calculation logicsrc/components/CertificateViewer.tsx- Viewer integrationsrc/pages/VerifyCertificate.tsx- Public view integration
Utilities:
src/utils/warrantyCalculations.ts- Calculation functions
Template:
src/server/scripts/seedWarrantyTemplate.ts- Template seed script
API:
src/server/routes/enterpriseTemplateRoutes.ts- Initialization endpoint
Certificate Gifting
Overview
Certificate gifting allows users to securely transfer certificates to recipients via email or SMS notifications with encrypted contact information and blockchain-verified transfers.
Prerequisites
Server Configuration:
SERVER_WALLET_ENCRYPTION_KEY- For encrypting smart account credentials- Smart account credential stored for sender
- SMTP/Twilio credentials configured for notifications
RESEND_API_KEY- For email delivery fallback
Database Setup:
bash
npm run db:sync-gift-indexesCreating a Gift
From Dashboard:
- Navigate to certificate you want to gift
- Click "Gift" button
- Fill in recipient information:
- Recipient email address (required)
- Recipient phone number (optional, for SMS notifications)
- Personal message (optional)
- Choose delivery method (email/SMS)
- Confirm gift creation
API Response:
- Returns 201 status with
transferId - Creates record in
pendingcertificatetransferscollection - Initial status:
pending
Notification Delivery
Email Delivery:
- Primary: SMTP server (if configured)
- Fallback: Resend API (if SMTP fails)
- Contains unique claim link:
/claim/:token - Encrypted contact data stored in database
SMS Delivery:
- Twilio integration (if phone number provided)
- Logs delivery status
- Same claim link as email
Resend Functionality:
- Gift creator can resend notifications
- Contact data remains encrypted
- Security logs capture resend events
Claiming a Gift
Recipient Flow:
- Open claim link from notification:
/claim/:token - Authenticate with wallet (or create account)
- Click "Claim Gift" button
- System executes blockchain transfer
API Process:
POST /api/certificates/gift/claim/:token
Response:
{
transactionHash: "0x...",
userOperationHash: "0x...",
status: "claimed"
}Database Updates:
pendingcertificatetransfers.status→claimed- Certificate provenance updated with transfer event
- Ownership transferred to recipient address
Security Features
Rate Limiting:
giftTokenAttemptRateLimit: Prevents brute force on single token (HTTP 429)giftClaimRateLimit: Limits claims per IP address- Protection against abuse and malicious actors
Data Protection:
- Recipient contact information encrypted in database
- Phone numbers hashed for privacy
- No PII persisted in plaintext
- Security audit logs for all operations
Token Security:
- Unique, cryptographically secure claim tokens
- Single-use tokens (marked as claimed)
- Expiration mechanism for unclaimed gifts
Gift Lifecycle Management
Expiration:
bash
# Automated cleanup process
processExpiredGifts()- Removes expired transfer records
- Notifies sender of expiration
- Certificate remains with original owner
Revocation:
- Gift creator can revoke before claim
- Status transitions to
revoked - Claim link becomes invalid
- Certificate stays with sender
Testing Checklist
Happy Path:
- [ ] Create gift from dashboard (expect 201 with transferId)
- [ ] Verify pendingcertificatetransfers record created
- [ ] Confirm email/SMS delivery
- [ ] Open claim link and authenticate
- [ ] Execute claim (verify transactionHash returned)
- [ ] Inspect blockchain transaction
- [ ] Verify status updated to
claimed
Failure Scenarios:
- [ ] Invalid token triggers rate limit (HTTP 429)
- [ ] Multiple tokens from same IP hits rate limit
- [ ] Missing sender credential returns 502
- [ ] SMTP outage triggers Resend fallback
- [ ] Resend audit logs security event
Regression Checks:
- [ ] Gift revocation flows function correctly
- [ ] Expiration flows work as expected
- [ ] processExpiredGifts() removes expired transfers
- [ ] No PII persisted in plaintext
Burn Functionality
Overview
The burn functionality allows authorized users to permanently destroy (burn) NFTs from the blockchain. This is an irreversible operation with proper authorization checks and safety measures.
Authorization
Smart Contract Authorization Logic:
solidity
function burn(uint256 tokenId) external {
require(_isAuthorized(_msgSender(), tokenId), "Not authorised");
_burn(tokenId, true);
}Authorized users include:
- Token owner
- Approved address for the specific token
- Operator approved for all tokens of the owner
- Contract admins
- Contract owner
Frontend Implementation
Components:
BurnService (src/services/burnService.ts)
- Handles smart contract interactions
- Authorization checking
- Transaction execution and error handling
useBurnNFT Hook (src/hooks/useBurnNFT.ts)
- React hook for burn functionality
- Loading states and error handling
- Integrates with Dynamic wallet context
BurnButton Component (src/components/ui/BurnButton.tsx)
- User-friendly burn button with confirmation dialog
- Supports variants: danger, warning, default
- Loading states and error feedback
Integration with Certificate Viewer
The burn button appears when:
- User is authenticated (has connected wallet)
- Certificate has valid
tokenIdin metadata - User is not in public/unauthorized view
tsx
{/* Burn Button - Only for authenticated users */}
{primaryWallet && certificate.metadata?.tokenId && (
<BurnButton
tokenId={certificate.metadata.tokenId}
tokenName={certificate.name}
onBurnSuccess={(transactionHash) => {
console.log('NFT burned successfully:', transactionHash);
onClose();
}}
variant="danger"
size="sm"
/>
)}User Experience Flow
Step-by-Step Burn Process:
- Authentication Check: User must have connected wallet
- Authorization Check: System verifies user can burn the token
- Confirmation Dialog:
- Warning message about permanent destruction
- User must confirm action
- Option to cancel
- Transaction Execution:
- Smart contract burn function called
- Loading state displayed
- Transaction submitted to blockchain
- Success Feedback:
- Confirmation message shown
- Certificate viewer closes
- UI updated to reflect burned state
Safety Features
Confirmation Dialog:
- Prevents accidental burns
- Clear warning about irreversibility
- Requires explicit user confirmation
Authorization Checks:
- Multiple layers of validation
- Smart contract-level verification
- Frontend authorization preview
Error Handling:
- Graceful handling of failed transactions
- Clear error messages
- User-friendly feedback
Loading States:
- Visual feedback during processing
- Prevents duplicate submissions
- Transaction status updates
Usage Examples
Basic Implementation:
tsx
<BurnButton
tokenId="123"
tokenName="My NFT"
onBurnSuccess={(txHash) => console.log('Burned:', txHash)}
/>Custom Styling:
tsx
<BurnButton
tokenId="123"
tokenName="My NFT"
variant="warning"
size="lg"
className="custom-burn-button"
/>With Custom Success Handler:
tsx
<BurnButton
tokenId="123"
tokenName="My NFT"
onBurnSuccess={(txHash) => {
setNftBurned(true);
showToast('success', 'NFT burned successfully!');
navigate('/dashboard');
}}
/>Configuration
Environment Variables:
NFT_CONTRACT_ADDRESS: Smart contract address- Network configuration for transactions
Dependencies:
ethers: Smart contract interactions@dynamic-labs/sdk-react-core: Wallet integration- React hooks for state management
User Flows and UI Access
Enterprise User Flow
Creating Certificates:
- Login → Enterprise dashboard
- Navigate → Create Certificate or Create Voucher
- Choose Template (optional):
- Open Template Manager
- Select existing template or create new
- For warranties, use "Product Warranty Certificate"
- Fill Details:
- Certificate name and description
- Upload images
- Complete custom fields (if template selected)
- Mint → Create on blockchain
- View → Certificate appears in dashboard
Managing Certificates:
- View Certificate → Click to open Certificate Viewer
- Available Actions:
- Show QR Code → Display verification QR
- Gift Certificate → Transfer to recipient
- Burn Certificate → Permanently destroy (if authorized)
- Export PDF → Download certificate
- View Details:
- Details Tab → Metadata, warranty, provenance
- History Tab → Blockchain transactions
- Transfer Tab → Ownership history
Customer/Recipient Flow
Receiving Certificates:
- Notification → Email or SMS with claim link
- Open Link →
/claim/:token - Authenticate → Connect wallet or create account
- Claim → Execute blockchain transfer
- Confirmation → Certificate appears in wallet
Verifying Certificates:
- Scan QR Code → Opens public verification page
- View Information:
- Certificate image and details
- Ownership information
- Warranty status (if applicable)
- Blockchain verification link
- No Authentication Required → Public access
Administrator Flow
System Management:
- Monitor → Dashboard analytics
- Review → Pending transfers and gifts
- Support → Assist with failed transactions
- Burn → Revoke fraudulent certificates (if authorized)
Testing Procedures
Certificate Creation Testing
Local Testing:
- [ ] Create certificate with mock data
- [ ] Verify database record created
- [ ] Check blockchain transaction
- [ ] Confirm metadata stored correctly
- [ ] Test with various templates
Production Testing:
- [ ] Deploy to staging environment
- [ ] Test with real blockchain network
- [ ] Verify API endpoints respond
- [ ] Check database persistence
- [ ] Monitor transaction costs
QR Code Verification Testing
Functionality Tests:
- [ ] Generate QR code for certificate
- [ ] Scan QR code with mobile device
- [ ] Verify public page loads correctly
- [ ] Check API response format
- [ ] Test error handling for invalid IDs
Cross-browser Testing:
- [ ] Test on Chrome, Firefox, Safari
- [ ] Mobile browser compatibility
- [ ] QR code scanning apps
- [ ] Deep link handling
Warranty Testing
Auto-calculation:
- [ ] Select warranty period and start date
- [ ] Verify end date auto-populates
- [ ] Test "Lifetime" warranty calculation
- [ ] Confirm manual override works
- [ ] Test various period options
Status Display:
- [ ] Create active warranty certificate
- [ ] Create expired warranty certificate
- [ ] Create future warranty certificate
- [ ] Verify status chip colors
- [ ] Test collapsible section
Validation:
- [ ] Attempt to mint expired warranty
- [ ] Confirm warning dialog appears
- [ ] Verify can proceed with expired warranty
- [ ] Check validation for required fields
Gifting Testing
Happy Path (E2E):
- [ ] Create gift from dashboard (verify 201 response with transferId)
- [ ] Check pendingcertificatetransfers record (status=pending)
- [ ] Confirm email delivery (SMTP logs)
- [ ] Confirm SMS delivery (Twilio logs)
- [ ] Open claim link and authenticate
- [ ] Execute claim (POST /api/certificates/gift/claim/:token)
- [ ] Verify JSON response includes transactionHash
- [ ] Check Polygon explorer for transaction
- [ ] Confirm status updated to "claimed"
- [ ] Verify provenance updated
Failure Scenarios:
- [ ] Invalid token triggers rate limit (HTTP 429)
- [ ] Brute force/IP abuse hits giftClaimRateLimit
- [ ] Missing credential returns 502 with helpful message
- [ ] SMTP outage triggers Resend fallback
- [ ] Resend audit logs security event
Edge Cases:
- [ ] Gift revocation before claim
- [ ] Gift expiration handling
- [ ] Duplicate claim attempts
- [ ] Network failure during transfer
Burn Testing
Authorization Tests:
- [ ] Token owner can burn their token
- [ ] Admin can burn any token
- [ ] Contract owner can burn any token
- [ ] Approved addresses can burn tokens
- [ ] Unauthorized users cannot burn
Event Tests:
- [ ] Transfer events emitted correctly
- [ ] Events contain correct parameters
- [ ] Event logs accessible
State Tests:
- [ ] Token balances updated correctly
- [ ] Approvals cleared when burned
- [ ] Token no longer queryable after burn
Integration Tests:
- [ ] Multiple burns work correctly
- [ ] UI updates after burn
- [ ] Error handling for failed burns
API Reference
Certificate Public API
Get Certificate by ID
GET /api/certificate/public/:id
Response:
{
"id": "0",
"name": "Certificate Name",
"imageUrl": "https://...",
"metadata": {
"name": "Certificate Name",
"artist": "Artist Name",
"category": "Category",
"description": "Description...",
"warranty": { ... }
},
"provenance": [...]
}Health Check
GET /api/certificate/health
Response:
{
"status": "ok",
"timestamp": "2024-01-01T00:00:00Z"
}Gift API
Create Gift
POST /api/certificates/gift/create
Body:
{
"certificateId": "123",
"recipientEmail": "recipient@example.com",
"recipientPhone": "+1234567890",
"message": "Personal message"
}
Response:
{
"transferId": "transfer_123",
"status": "pending",
"claimToken": "abc123..."
}Claim Gift
POST /api/certificates/gift/claim/:token
Response:
{
"transactionHash": "0x...",
"userOperationHash": "0x...",
"status": "claimed"
}Resend Notification
POST /api/certificates/gift/resend/:transferId
Response:
{
"status": "sent",
"method": "email"
}Warranty Template API
Initialize Warranty Template
POST /api/enterprise/templates/init-warranty
Response:
{
"id": "template_123",
"name": "Product Warranty Certificate",
"fields": [...]
}Get Template
GET /api/enterprise/templates/:id
Response:
{
"id": "template_123",
"name": "Product Warranty Certificate",
"fields": [...],
"createdAt": "2024-01-01T00:00:00Z"
}Best Practices
Certificate Creation
Naming Conventions:
- Use descriptive, unique names
- Include version or edition numbers
- Follow consistent formatting
Metadata:
- Provide complete, accurate information
- Include high-quality images (recommended: 1000x1000px minimum)
- Use appropriate categories
- Add relevant tags for searchability
Templates:
- Create reusable templates for common certificate types
- Document template purpose and fields
- Test templates before production use
- Version control template changes
Warranty Certificates
For Manufacturers:
- Clearly define coverage details
- Specify exclusions explicitly
- Provide clear claim process
- Include accessible contact information
- Link to full terms and conditions
- Set realistic warranty periods
- Test with sample products first
For Enterprise Users:
- Use warranty template for consistency
- Verify auto-calculated dates
- Review warranty before minting
- Keep warranty records in database
- Monitor warranty expiration dates
For Customers:
- Save claim link and QR code
- Note warranty start and end dates
- Understand coverage and exclusions
- Keep proof of purchase
- File claims within warranty period
Certificate Gifting
Security:
- Verify recipient information before sending
- Use secure communication channels
- Monitor pending transfers
- Set appropriate expiration dates
- Review gift activity regularly
User Experience:
- Provide clear claiming instructions
- Send timely notifications
- Follow up on unclaimed gifts
- Handle errors gracefully
Burn Operations
Safety:
- Always use confirmation dialogs
- Clearly warn about irreversibility
- Log all burn operations
- Implement proper authorization
- Monitor for suspicious activity
Governance:
- Document burn policies
- Require multiple approvals for high-value items
- Keep audit trail
- Review burn activity regularly
Performance Optimization
Database:
- Index frequently queried fields
- Implement caching for public certificates
- Use pagination for large result sets
- Regular database maintenance
Blockchain:
- Batch operations when possible
- Monitor gas costs
- Implement retry logic for failed transactions
- Use appropriate gas limits
Frontend:
- Lazy load images
- Implement infinite scroll
- Cache API responses
- Optimize bundle size
Security
Authentication:
- Use JWT tokens with appropriate expiration
- Implement refresh token rotation
- Validate all inputs server-side
- Use HTTPS everywhere
Authorization:
- Verify ownership before sensitive operations
- Implement role-based access control
- Log authorization failures
- Use blockchain verification for ownership
Data Protection:
- Encrypt sensitive data at rest
- Hash personal information
- Implement rate limiting
- Monitor for abuse patterns
Troubleshooting
Certificate Creation Issues
"Transaction failed" error:
- Check wallet has sufficient balance for gas
- Verify network connection
- Ensure contract address is correct
- Check if wallet is connected
"Database error" message:
- Verify MongoDB connection
- Check database credentials
- Ensure database indexes exist
- Review server logs
Images not uploading:
- Check file size (limit: usually 10MB)
- Verify file format (PNG, JPG, GIF)
- Test network connection
- Check storage service status
QR Code Issues
QR code not generating:
- Verify certificate has valid ID
- Check certificate exists in database
- Review API endpoint accessibility
- Clear browser cache
Public page not loading:
- Verify URL format:
/certificate/{id} - Check API server status
- Test API endpoint directly
- Review CORS configuration
"Certificate not found" error:
- Verify certificate ID is correct
- Check database record exists
- Ensure proper API routing
- Review server logs
Warranty Issues
End date not auto-calculating:
- Ensure both period and start date selected
- Check JavaScript console for errors
- Verify warrantyCalculations.ts is loaded
- Try manually entering end date
Warranty section not visible:
- Confirm certificate has warranty data
- Check if warranty template was used
- Verify WarrantyInfoSection component loaded
- Review certificate metadata structure
Status showing incorrectly:
- Verify dates are in correct format (ISO 8601)
- Check system time/timezone
- Review warrantyCalculations logic
- Clear browser cache
Gifting Issues
"Not authorised" error during burn:
- Verify user owns the token
- Check wallet connection
- Ensure user has proper permissions
- Review smart contract authorization
Gift notification not delivered:
- Check email address is correct
- Verify SMTP/Resend configuration
- Review email service logs
- Check spam folder
- Test with resend function
Claim link invalid:
- Verify token hasn't expired
- Check if gift was revoked
- Ensure token format is correct
- Review rate limiting (HTTP 429)
Blockchain transfer failed:
- Check sender credential exists
- Verify sufficient gas in sender wallet
- Review smart contract state
- Check network congestion
Burn Issues
"Not authorised" error:
- Verify user owns token
- Check wallet connection
- Ensure user has proper permissions
- Review smart contract authorization
Transaction fails:
- Check gas fees and wallet balance
- Verify network connection
- Ensure contract is accessible
- Review transaction logs
UI issues:
- Verify tokenId exists in metadata
- Check wallet connection status
- Ensure proper component imports
- Clear browser cache
General Debugging
Enable Debug Logging:
javascript
// In browser console
localStorage.setItem('debug', 'pocketbook:*');Check API Health:
bash
curl https://api.pocketbook.studio/api/certificate/healthVerify Database Connection:
bash
npm run db:checkReview Server Logs:
bash
# On production server
tail -f /var/log/pocketbook/api.logRelated Documentation
Core Documentation
- Quick Start Guide - Getting started with Pocketbook
- API Documentation - Complete API reference
- Authentication Guide - Authentication and authorization
Feature-Specific Guides
- Warranty Templates Guide - Detailed warranty template usage
- Certificate Gifting Guide - Complete gifting documentation
- Webhook Integration - Event webhooks and integrations
- Shopify Integration - E-commerce platform integration
System Documentation
- Billing System - Pricing and billing
- Deployment Guide (internal documentation) - Production deployment procedures
- Security Guide (internal documentation) - Security best practices
Enterprise Features
- Custom Templates - Creating custom certificate templates
- Batch Operations - Bulk certificate operations
- Analytics Dashboard - Usage analytics and reporting
Technical References
- Smart Contract ABI - Contract interaction reference
- Database Schema - MongoDB collection structures
- Event System - Webhook event types and payloads
External Resources
- Polygon Network - Blockchain network documentation
- Dynamic Labs - Wallet integration documentation
- Vercel Deployment - Frontend hosting documentation
Support and Community
Getting Help
Technical Support:
- Email: support@pocketbook.studio
- Documentation: https://docs.pocketbook.studio
- Status Page: https://status.pocketbook.studio
Community:
- Discord: Join our community
- Twitter: @PocketbookStudio
- GitHub: Report issues
Contributing
We welcome contributions! Please see our contributing guidelines for:
- Bug reports
- Feature requests
- Code contributions
- Documentation improvements
Appendix
Glossary
NFT (Non-Fungible Token): Unique digital asset on blockchain representing certificate ownership
Provenance: Historical record of certificate ownership and transfers
Smart Contract: Self-executing code on blockchain that governs certificate operations
QR Code: Scannable code linking to public certificate verification page
Warranty Period: Duration of warranty coverage (e.g., "2 years", "Lifetime")
Claim Token: Unique, secure token used for claiming gifted certificates
Burn: Permanent destruction of NFT certificate from blockchain
CORS: Cross-Origin Resource Sharing - security feature for API access
JWT: JSON Web Token - authentication token format
Rate Limiting: Protection mechanism to prevent API abuse
Version History
v1.0.0 - Initial certificate system release
- Basic certificate creation and viewing
- Blockchain integration
- Database storage
v1.1.0 - QR code verification
- Public certificate pages
- QR code generation
- No-auth verification
v1.2.0 - Warranty integration
- Warranty templates
- Auto-calculation
- Status tracking
v1.3.0 - Certificate gifting
- Transfer system
- Email/SMS notifications
- Claim process
v1.4.0 - Burn functionality
- Authorized revocation
- Safety features
- UI integration
File Structure Reference
src/
├── components/
│ ├── CertificateViewer.tsx # Main viewer component
│ ├── SingleMint.tsx # Certificate creation
│ ├── SingleMintVoucher.tsx # Voucher creation
│ ├── DynamicCustomFields.tsx # Custom field handling
│ ├── WarrantyInfoSection.tsx # Warranty display
│ ├── TemplateManagerDrawer.tsx # Template management
│ └── ui/
│ └── BurnButton.tsx # Burn button component
├── pages/
│ ├── PublicCertificate.tsx # Public verification
│ └── VerifyCertificate.tsx # Certificate verification
├── server/
│ ├── routes/
│ │ ├── certificateRoutes.ts # Certificate API
│ │ └── enterpriseTemplateRoutes.ts # Template API
│ ├── models/
│ │ └── Certificate.ts # Database model
│ └── scripts/
│ └── seedWarrantyTemplate.ts # Warranty template seed
├── services/
│ └── burnService.ts # Burn service
├── hooks/
│ └── useBurnNFT.ts # Burn hook
└── utils/
└── warrantyCalculations.ts # Warranty utilitiesLast updated: 2024For the latest documentation, visit: https://docs.pocketbook.studio
