How pendhrdream/wallet works
Project type and purpose
• This is a full-stack web application (“Verifiable Credential Wallet”) composed of a React/TailwindCSS frontend and an Express/TypeScript backend.
• It allows users to issue, list, share, verify, and delete verifiable credentials stored in JSON files.
File structure
• Top-level services:
• frontend/ – React UI built with Vite, TailwindCSS, served in dev by Vite or in production by Nginx.
• backend/ – Express API written in TypeScript, with modules for crypto, JSON Canonicalization Scheme (JCS), routes, and storage.
• data/ – Persistent JSON storage (credentials.json, keys.json).
• docker-compose.yml – Defines multi-container setup.
• Build and deployment: Dockerfiles in both frontend/ and backend/, plus Kubernetes-style orchestration via docker-compose.
• Configuration: .env.example files, tsconfig.json in both codebases, nginx.conf for frontend reverse proxy.
README for additional insights
• Confirms ports: frontend on 5173 (dev) or 80 (prod), backend on 3000.
• Lists API endpoints (POST /api/credentials, GET /api/verify, etc.).
• Emphasizes containerized vs. local dev workflows.
a. Main components:
• Client Browser (UI)
• Frontend Service
– Vite Dev Server (dev) / Nginx + static assets (prod)
– React components, API client
• Backend Service
– Express + TypeScript server
– Route handlers (Issue, Verify, List, Delete)
– Crypto & JCS modules
– Storage module (reads/writes JSON files)
• Data Store
– JSON files in data/ (credentials.json, keys.json)
• Orchestration
– Docker Compose, volumes, environment variables
b. Component interactions:
1. User → Browser UI
2. Browser → Frontend (HTTP on 5173 or 80)
3. Frontend → Backend (HTTP on 3000, proxy via vite.config.ts or nginx.conf)
4. Backend → Data Store (local file I/O)
5. (Optional) Backend health checks
c. Architectural patterns and principles:
• Separation of concerns: clear frontend/backend split
• Single-page application (SPA) communicating via RESTful JSON API
• Modular backend design (routes, crypto, storage modules)
• Containerization for environment parity
d. Key technologies and frameworks:
• Frontend: React, Vite, TypeScript, TailwindCSS, Nginx
• Backend: Node.js, Express, TypeScript, JCS, custom crypto logic
• Persistence: File-based JSON storage
• DevOps: Docker, Docker Compose
Essential architectural elements
• Clearly separate presentation (React), business logic (Express routes + crypto), and persistence (JSON files).
• How Docker Compose ties together the two containers and mounts the data volume.
• Nginx reverse proxy layer when illustrating production deployment.