- Zero-knowledge architecture: all encryption/decryption client-side via Web Crypto API - AES-GCM 256 for messages, files, and key wrapping; PBKDF2 for password-based key derivation - Node.js/TypeScript backend: JWT auth with refresh rotation, argon2id passwords, TOTP 2FA - PostgreSQL schema: encrypted blobs only, server never stores plaintext - Real-time messaging via WebSocket relay (server routes ciphertext, cannot read it) - Encrypted file upload/download with per-file keys wrapped by user master key - React PWA frontend: Vite + Tailwind + service worker for offline support - Docker Compose: postgres + backend + frontend + nginx with TLS Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
44 lines
1.2 KiB
TypeScript
44 lines
1.2 KiB
TypeScript
import { defineConfig } from 'vite';
|
|
import react from '@vitejs/plugin-react';
|
|
import { VitePWA } from 'vite-plugin-pwa';
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
react(),
|
|
VitePWA({
|
|
registerType: 'autoUpdate',
|
|
includeAssets: ['favicon.ico', 'icon-192.png', 'icon-512.png'],
|
|
manifest: {
|
|
name: 'CloudLink',
|
|
short_name: 'CloudLink',
|
|
description: 'Encrypted messaging and cloud drive',
|
|
theme_color: '#0f172a',
|
|
background_color: '#0f172a',
|
|
display: 'standalone',
|
|
orientation: 'portrait',
|
|
start_url: '/',
|
|
icons: [
|
|
{ src: 'icon-192.png', sizes: '192x192', type: 'image/png' },
|
|
{ src: 'icon-512.png', sizes: '512x512', type: 'image/png', purpose: 'any maskable' },
|
|
],
|
|
},
|
|
workbox: {
|
|
globPatterns: ['**/*.{js,css,html,ico,png,svg,woff2}'],
|
|
runtimeCaching: [
|
|
{
|
|
urlPattern: /^\/api\//,
|
|
handler: 'NetworkFirst',
|
|
options: { cacheName: 'api-cache', networkTimeoutSeconds: 10 },
|
|
},
|
|
],
|
|
},
|
|
}),
|
|
],
|
|
server: {
|
|
proxy: {
|
|
'/api': 'http://localhost:3001',
|
|
'/ws': { target: 'ws://localhost:3001', ws: true },
|
|
},
|
|
},
|
|
});
|