How shashanknayak2005/blockchain-main works
This product lets users authenticate, upload and manage PDF files, and download them only after the encrypted IPFS payload passes a blockchain-backed integrity check. The upload path encrypts and hashes the document, stores it on IPFS, anchors integrity metadata on Ethereum, and persists file metadata in MySQL; download verifies before key unwrap and decryption. The graph also covers file listing, details, deletion, on-demand verification, and tamper-demo operations. Backend service internals are shown at the documented boundary; omitted service excerpts limit finer call-level detail.
Main entry points: file.service.js File orchestrator · file.routes.js File routes · App.jsx Web routes · UploadPage.jsx File pages
Components 23
Web client
- Web routes
frontend/src/App.jsx - Session context
frontend/src/context/AuthContext.jsx - File pages
frontend/src/pages/UploadPage.jsx - Download verifier
frontend/src/components/DownloadVerificationModal.jsx - File API client
frontend/src/services/file.service.js - Auth API client
frontend/src/services/auth.service.js - HTTP client
frontend/src/services/api.js
API and identity
- Express API
backend/src/app.js - Auth routes
backend/src/routes/auth.routes.js - File routes
backend/src/routes/file.routes.js - Auth controller
backend/src/controllers/auth.controller.js - File controller
backend/src/controllers/file.controller.js - JWT authorization
backend/src/middleware/auth.middleware.js - PDF upload validation
backend/src/middleware/upload.middleware.js
File workflows
- File orchestrator
backend/src/services/file.service.js
Integrity services
- Envelope encryption
backend/src/services/encryption/encryption.service.js - SHA-256 hashing
backend/src/services/hashing/hash.service.js - Blockchain registry
backend/src/services/blockchain/blockchain.service.js
Persistence
- IPFS storage
backend/src/services/ipfs/ipfs.service.js - MySQL metadata
backend/src/config/database.js
Other components
- User
- Ethereum
- Pinata IPFS
Connections 26
- User → Web routes: uses
frontend/src/App.jsx - Web routes → Session context: provides session
frontend/src/App.jsx - Web routes → File pages: routes to
frontend/src/App.jsx - Session context → Auth API client: calls
frontend/src/context/AuthContext.jsx - File pages → File API client: requests files
frontend/src/pages/UploadPage.jsx - File pages → Download verifier: renders
- Download verifier → File API client: verifies and downloads
frontend/src/components/DownloadVerificationModal.jsx - File API client → HTTP client: sends requests
frontend/src/services/file.service.js - Auth API client → HTTP client: sends requests
frontend/src/services/auth.service.js - HTTP client → Express API: calls REST API
- Express API → Auth routes: mounts
backend/src/app.js - Express API → File routes: mounts
backend/src/app.js - Auth routes → Auth controller: dispatches
backend/src/routes/auth.routes.js - Auth routes → JWT authorization: authenticates
backend/src/routes/auth.routes.js - File routes → JWT authorization: authorizes
backend/src/routes/file.routes.js - File routes → PDF upload validation: validates upload
backend/src/routes/file.routes.js - File routes → File controller: dispatches
backend/src/routes/file.routes.js - File controller → File orchestrator: delegates file actions
backend/src/controllers/file.controller.js - Auth controller → MySQL metadata: reads and writes users
backend/src/controllers/auth.controller.js - File orchestrator → MySQL metadata: reads and writes metadata
backend/src/services/file.service.js - File orchestrator → Envelope encryption: encrypts and decrypts
backend/src/services/file.service.js - File orchestrator → SHA-256 hashing: hashes payload
backend/src/services/file.service.js - File orchestrator → IPFS storage: stores and fetches payload
backend/src/services/file.service.js - File orchestrator → Blockchain registry: registers and verifies
backend/src/services/file.service.js - Blockchain registry → Ethereum: queries registry
backend/src/services/blockchain/blockchain.service.js - IPFS storage → Pinata IPFS: pins content