-
Notifications
You must be signed in to change notification settings - Fork 0
Developer Guide
SecureBitChat edited this page Aug 18, 2025
·
1 revision
SecureBit.chat is built with modern web technologies and follows security-first principles.
- Frontend: Pure JavaScript + React (CDN)
- Cryptography: Web Crypto API
- Network: WebRTC P2P Data Channels
- Payments: Lightning Network via WebLN
- Styling: TailwindCSS + custom CSS
- Node.js 16+ (for development tools)
- Git
- Modern browser with WebRTC support
- Lightning wallet with WebLN
# Clone repository
git clone https://github.com/SecureBitChat/securebit-chat.git
cd securebit-chat
# Install development dependencies
npm install
# Start development server
npm run dev
# Build for production
npm run build
# Code formatting
npm run format
# Linting
npm run lint
# Security audit
npm audit
# Testing
npm test
// Example: Key generation
async function generateKeyPair() {
return await window.crypto.subtle.generateKey(
{
name: "ECDH",
namedCurve: "P-384"
},
true,
["deriveKey", "deriveBits"]
);
}
// Example: Message encryption
async function encryptMessage(message, key) {
const iv = window.crypto.getRandomValues(new Uint8Array(12));
const encoded = new TextEncoder().encode(message);
const encrypted = await window.crypto.subtle.encrypt(
{
name: "AES-GCM",
iv: iv
},
key,
encoded
);
return { encrypted, iv };
}
- Never store sensitive data
- Use secure random generation
- Implement proper key rotation
- Validate all inputs
- Clean up memory properly
# Run unit tests
npm run test:unit
# Run with coverage
npm run test:coverage
# Run integration tests
npm run test:integration
# Test Lightning integration
npm run test:lightning
# Run security tests
npm run test:security
# Cryptographic validation
npm run test:crypto
# Create optimized build
npm run build
# Build artifacts in dist/
- GitHub Pages: Automatic deployment
- Netlify: Drag and drop deployment
- Vercel: Git integration
- Custom server: Manual deployment
# Production environment
NODE_ENV=production
LIGHTNING_NODE_URL=your_node
STUN_SERVERS=stun:stun.l.google.com:19302