How apurv212/secure-ai-vault works
Project Type and Purpose
• Type: Full-stack web application
• Purpose: Securely store and manage card details with AI-powered extraction, automatic categorization, and Firebase-backed persistence.
File Structure
Top-level:
– client/ → React + TypeScript + Vite frontend
– server/ → Node.js + Express backend
Frontend:
– src/components → UI components (features, layout, pages, ui)
– src/contexts, src/store → state and context management
– src/services/api.ts → REST client for server
– firebase/config.ts → Firebase Auth, Firestore, Storage setup
Backend:
– index.js → Express app entrypoint
– routes/*.js → API endpoints (auth, cards, extract)
– utils/*.js → helper modules (bank normalization, encryption, rate limiting, secure logging, image encryption)
Shared:
– package.json scripts for install-all, dev tasks
– .env files for credentials
README for Additional Insights
• External AI services: gemini, deepseek, marker
• Firebase services: Auth, Firestore, Storage
• API URL: /api on port 5000
• Frontend served on port 3000
Main Components and Their Interactions
a. Frontend (React + Vite)
– UI Layer: Pages (Login, Dashboard), Feature components (CardUpload, CardItem), Layout components (Header, Sidebar)
– State Layer: Context (AuthContext), Redux-style store slices (theme, cards)
– Service Layer: api.ts calls backend REST endpoints
– Firebase SDK: Auth, Firestore reads/writes, Storage for uploaded images
b. Backend (Express)
– API Layer: auth.js (signup/login), cards.js (CRUD), extract.js (AI extraction orchestration)
– Business Logic: imageEncryption, encryption (securely store card data), bankNormalizer
– External AI Services: gemini, deepseek, marker invoked within extract route
– Rate Limiter & Secure Logger middleware
c. Data Stores
– Firebase Firestore: card metadata, user profiles
– Firebase Storage: raw images for OCR/extraction
d. External Services
– gemini, deepseek, marker AI APIs for OCR and data extraction
Architectural Patterns and Design Principles
• Layered Architecture: UI → State → Services → API → Business Logic → Data
• Separation of Concerns: frontend vs. backend responsibilities
• Single REST monolith on backend with modular routes
• Cloud-native services (Firebase managed by client)
• Secure handling: encryption utils, no CVV storage