How kodevoid/formvault works
Project Type and Purpose
• FormVault is a full-stack, developer-first form-handling service.
• Frontend: React/Vite app providing form embedding, encryption, and SDK hooks.
• Backend: Rust (Actix-web) service offering zero-knowledge encrypted RESTful API, webhook support, and data storage.
File Structure
• Top-level directories:
• frontend/ — React + Vite + JavaScript SDK code
• backend/ — Rust service with Cargo setup, Diesel migrations, Docker support
• backend/data/formvault.db: Embedded SQLite database (for local/dev).
• backend/migrations/: SQL scripts (Init, developer_init).
• backend/src/handlers, routes, repositories, models: MVC-style separation.
• frontend/src/components: UI components (Home, Issues, Contributions, Navbar, etc.)
• Docker artifacts: backend/Dockerfile, compose.yaml; .env for secrets.
README for Additional Insights
• Core features: zero-knowledge encryption on the client, RESTful API, webhooks, custom fields.
• Planned SDKs: JavaScript (present), Python/Rust (future).
• Security focus: end-to-end encryption, privacy by design.
Main Components
a. Frontend Client
• React/Vite SPA (App.jsx, components/)
• JavaScript SDK: performs AES/RSA encryption before submission
• Public assets served via index.html
b. Backend API Service
• Actix-web server (main.rs, handlers, routes)
• Business logic: configuration.rs, webhook.rs
• Repositories layer: form repository, developer repository, encryption utilities
• Database layer: Diesel over SQLite (or Postgres in prod)
c. Database
• SQLite (data/formvault.db) for dev; abstract to Postgres/MySQL for prod
• Migration scripts in backend/migrations/
d. External Services
• Webhook targets: third-party endpoints notified on submission
• (Future) Monitoring/Logging/Audit service
e. Development/Deployment
• Docker & Docker Compose (backend/Dockerfile, compose.yaml)
• .env for secrets (encryption keys, DB URL)
Relationships and Data Flow
1. User fills form in Frontend →
2. SDK encrypts payload →
3. Encrypted POST /submissions → Backend API →
4. Backend validates, stores encrypted blob in DB →
5. Backend triggers webhook (outbound HTTP) → External system →
6. Admin/dev dashboards fetch decrypted data via API (with key) → Frontend UI
Architectural Patterns & Design Principles
• Layered Architecture: Presentation (frontend), API, Domain (handlers/models), Persistence (repositories/DB).
• Zero-Knowledge Encryption: client-side encryption, backend stores ciphertext only.
• Modular Rust code: src/handlers, routes, repositories, models.
• CI/CD via Docker: containerized development & deployment.
• RESTful API design: stateless endpoints, clear resource modeling.