Backend services for the ProofStell decentralized document verification platform.
The backend acts as a bridge between the frontend and the Stellar blockchain.
It handles:
- Document hashing
- Smart contract interaction
- Metadata storage
- Verification logic
- Generate SHA256 hashes from uploaded documents
- Ensure consistent hashing for verification
- Communicate with Soroban smart contracts
- Register and verify document hashes
- Store document metadata in PostgreSQL
- Track issuers, timestamps, and ownership
-
Accept document uploads
-
Return verification results:
- Verified
- Not Found
- Revoked
Frontend (Next.js)
β
Backend API (NestJS)
β
Soroban Smart Contract
β
Stellar Network
- NestJS
- PostgreSQL
- Prisma ORM
- Stellar SDK
- Multer (file handling)
- Crypto (SHA256 hashing)
src/
βββ documents/
βββ issuers/
βββ verification/
βββ soroban/
βββ prisma/
βββ utils/POST /documents/issuePOST /verifyPOST /documents/revokenpm installnpm run start:devDATABASE_URL=
SOROBAN_RPC_URL=
STELLAR_NETWORK=
CONTRACT_ADDRESS=- Hash-based verification
- Input validation
- Issuer authorization
- Secure blockchain interaction
- Provide reliable verification services
- Ensure accurate blockchain interaction
- Maintain secure document processing
The translation module provides first-class locale support with consistent fallback behaviour.
- Default locale: Configured by marking exactly one language record with
isDefault = truein thelanguagestable. Translation lookups (TranslationService.getTranslation) and the interceptor fallback are fully data-driven.LanguageMiddlewareandLanguageGuardstill default to'en'when no locale signal is present in the request β those are best-effort input fallbacks, not translation fallbacks. - Validation: Endpoints that explicitly opt in via
LanguageValidationPipeorLanguageGuardreject unknown or inactive locale codes with HTTP 400. - Lenient endpoints:
TranslationInterceptorandLanguageMiddlewaresilently fall back to the configured default when an unrecognised locale is requested, so customer-facing flows never show raw keys. - Coverage check: Call
GET /translations/:languageCode/missing-translationsto identify keys present in the default but missing in a target locale. Use this in CI to catch translation gaps before release. - Adding a new locale:
- Insert a
languagesrow withcode,name,nativeName,isActive=true. - Optionally set
isDefault=true(this unsets any previous default). - Add translations via
POST /translationsorPOST /translations/bulk.
- Insert a
The default-locale lookup is cached in memory and invalidates automatically when any language row is created, updated, or deleted.
ProofStell Backend β Powering decentralized verification.