Frontend: crowdsource-b266e.web.app
Blockchain Backend: testingfront-kqrgndany-satviks-projects-2883dc5b.vercel.app
We are currently troubleshooting an issue where the blockchain-based backend (running on one machine) cannot communicate with the frontend hosted on another.
Both the backend and frontend work independently without issues. Documentation will be updated once this integration problem is resolved.
This project demonstrates a private blockchain-inspired ledger that tracks fake currency balances and logs user transactions with file attachments.
- Backend (Node.js): Implements blockchain logic, transaction handling, and file hashing.
- Frontend (React): Provides the user interface for submission, media capture, and transaction visualization.
- Features
- Project Overview
- Setup Instructions
- Prerequisites
- Backend Setup
- Frontend Setup
- Running the Project
- Core Logic
- Unit Testing
- Accessibility Considerations
- Additional Features
- Deployment
- License
- Simulates blockchain behavior with blocks and transactions.
- Tracks fake currency balances for users with BITS email addresses.
- Computes SHA-256 hashes for uploaded files (photos, videos).
- Supports photo and video capture (including mobile back camera).
- Enforces Firebase Authentication for authorized BITS users.
- Modern React UI with ghost text, responsive design, and themed layout.
- Node.js (v14 or higher) & npm
- Firebase Project with Firestore, Storage, and Authentication
- Google Cloud SDK or Vercel/Render account
- (Optional) Docker for containerized deployments
-
Clone the Repository
git clone <repo-url> cd <repo-folder>
-
Navigate to Backend Folder
cd server -
Install Dependencies
npm install
-
Configure Firebase Admin
- Obtain a service account JSON file from Firebase Console.
- Update
/server/admin.jswith the credentials and storage bucket.
-
(Optional) Docker Setup
docker build -t my-node-server . docker run -p 3001:3001 my-node-server
-
Navigate to Frontend Folder
cd src -
Install Dependencies
npm install
-
Configure Firebase Client
Update/src/firebase-config.jswith your Firebase project settings. -
File Hash Utility
Verify/src/utils/fileHash.jsincludes SHA-256 logic using the Web Crypto API.
Backend:
cd server
node server.jsFrontend:
npm startFrontend will start at http://localhost:3000
Frontend:
npm run buildDeploy build to Firebase, Vercel, or your hosting service.
Backend Deployment:
Use Google Cloud Run, Vercel, Render, or Firebase Cloud Functions.
- Implements Block and Blockchain classes.
- Each block includes: index, timestamp, transactions, previous hash, and SHA-256 hash.
- User balances are updated per transaction, maintaining immutability.
- Client computes file hashes before submission.
- Uses Web Crypto API in
/src/utils/fileHash.js.
Use Jest or Mocha to test blockchain logic:
Block.calculateHash()Blockchain.isChainValid()
Use React Testing Library + Jest:
- Validate UI elements and hash computation flow.
(Unit tests not fully implemented yet — suggested structure in /tests folder.)
- Semantic HTML: Proper use of
<form>,<label>, and<textarea>elements. - Placeholder & Alt Text: Ensures assistive readability.
- Responsive Design: Mobile-friendly and high contrast UI.
- Optimized mobile camera via
{ facingMode: { ideal: "environment" } }. - Custom CSS theme for consistent and modern design.
- Backend secured with Firebase Admin SDK and token verification.
docker build -t gcr.io/YOUR_PROJECT_ID/my-node-server .
docker push gcr.io/YOUR_PROJECT_ID/my-node-server
gcloud run deploy my-node-server --image gcr.io/YOUR_PROJECT_ID/my-node-server --platform managed --region us-central1 --allow-unauthenticated- Adjust endpoint structure.
- Deploy using CLI tools.
Include your license here (e.g., MIT License).
© TrueStore Project Team | Blockchain Ledger & File Hashing Demo