This assessment is designed to evaluate your skills as a Senior Web3 MERN Stack Developer. The project is a healthcare data management platform that integrates blockchain technology for consent tracking and data integrity.
.
├── backend/ # Complete Node.js/Express API (DO NOT MODIFY)
│ ├── controllers/ # 5 controllers for different resources
│ │ ├── patientsController.js
│ │ ├── recordsController.js
│ │ ├── consentsController.js
│ │ ├── transactionsController.js
│ │ └── healthController.js
│ ├── routes/ # Route definitions
│ │ └── index.js
│ ├── utils/ # Utility functions
│ │ └── dataLoader.js
│ ├── data/ # JSON mockup database
│ ├── server.js # Express server entry point
│ └── package.json
├── frontend/ # React application (YOUR WORK AREA)
│ ├── src/
│ │ ├── components/ # React components to implement
│ │ ├── hooks/ # Custom React hooks
│ │ └── services/ # API service layer
│ └── package.json
└── README.md # This file
- Node.js (v16 or higher)
- npm or yarn
- MetaMask browser extension installed
- Basic understanding of React, Web3, and REST APIs
From the root directory, run:
npm run install-allOr install separately:
# Install root dependencies
npm install
# Install backend dependencies
cd backend
npm install
# Install frontend dependencies
cd ../frontend
npm installcd backend
npm startThe backend will run on http://localhost:5000
In a new terminal:
cd frontend
npm startThe frontend will run on http://localhost:3000
Complete the frontend implementation by filling in the TODO sections in the following components:
Tasks:
- Implement
fetchPatientsfunction to load patients from the API - Add search functionality with proper input handling
- Display patients in a card-based layout
- Implement pagination controls
- Make patient cards clickable to view details
API Endpoint: GET /api/patients?page=1&limit=10&search=
Tasks:
- Fetch and display patient information (name, email, DOB, gender, phone, address, wallet)
- Fetch and display patient's medical records
- Format dates properly
- Show record types with appropriate styling
- Display blockchain hash for each record
API Endpoints:
GET /api/patients/:idGET /api/patients/:id/records
Tasks:
- Fetch and display consents (with filtering by status)
- Implement consent creation with MetaMask signature
- Sign a message using the
signMessagefunction fromuseWeb3hook - Send signed consent to the backend API
- Update consent status (pending → active)
- Display consent details including blockchain transaction hash
API Endpoints:
GET /api/consents?status=activePOST /api/consentsPATCH /api/consents/:id
Web3 Integration:
- Use
signMessagefromuseWeb3hook to sign consent messages - Format:
"I consent to: {purpose} for patient: {patientId}"
Tasks:
- Fetch and display blockchain transactions
- Filter transactions by connected wallet address
- Format addresses (truncate with ellipsis)
- Format dates and timestamps
- Display transaction type, amount, status, and blockchain hash
- Show transaction details in a clean card layout
API Endpoint: GET /api/transactions?walletAddress=&limit=20
Tasks:
- Fetch platform statistics
- Display stats in an attractive grid layout
- Show: Total Patients, Total Records, Total Consents, Active Consents, Pending Consents, Total Transactions
- Use appropriate styling and visual hierarchy
API Endpoint: GET /api/stats
http://localhost:5000/api
GET /health- Check API status
GET /patients?page=1&limit=10&search=- Get paginated patientsGET /patients/:id- Get patient by IDGET /patients/:id/records- Get patient records
GET /consents?patientId=&status=- Get consents (with optional filters)GET /consents/:id- Get consent by IDPOST /consents- Create new consent{ "patientId": "patient-001", "purpose": "Research Study Participation", "walletAddress": "0x...", "signature": "0x..." }PATCH /consents/:id- Update consent status{ "status": "active", "blockchainTxHash": "0x..." }
GET /transactions?walletAddress=&limit=20- Get transactions
GET /stats- Get platform statistics
POST /verify-signature- Verify wallet signature{ "message": "I consent to...", "signature": "0x...", "address": "0x..." }
The useWeb3 hook is already implemented and provides:
account- Connected wallet addressisConnected- Connection statusconnectWallet()- Connect MetaMaskdisconnectWallet()- Disconnect walletsignMessage(message)- Sign a message with MetaMask
import { useWeb3 } from '../hooks/useWeb3';
const { account, signMessage, isConnected } = useWeb3();
// Sign a message
const message = "I consent to: Research Study for patient: patient-001";
const signature = await signMessage(message);Your implementation will be evaluated on:
-
Functionality (40%)
- All components work correctly
- API integration is proper
- Web3 integration works with MetaMask
-
Code Quality (30%)
- Clean, readable code
- Proper error handling
- Loading states
- No console errors
-
UI/UX (20%)
- Responsive design
- Good visual hierarchy
- User-friendly interactions
- Proper loading and error states
-
Best Practices (10%)
- React hooks usage
- Component structure
- Code organization
- Comments where needed
- DO NOT modify the backend code - It's complete and working
- DO NOT modify
WalletConnection.js- It's already implemented - Focus on completing the TODO sections in the components
- Use the existing CSS files - they're already styled
- Test with MetaMask connected and disconnected
- Handle edge cases (no data, errors, loading states)
This assessment should take approximately 4-6 hours to complete thoroughly.
- Complete all TODO sections
- Ensure the application runs without errors
- Test all functionality
- Provide a brief summary of your implementation approach
If you have any questions about the assessment, please reach out to the hiring team.
Good luck! 🚀