A modern, responsive hospital dashboard that displays patient information from a CSV dataset with ABHA ID authentication and token storage functionality.
- Patient Grid Display: Shows patient details in an attractive card-based layout
- ABHA ID Authentication: Secure authentication using ABHA ID verification
- Token Storage: Stores generated tokens in localStorage for external access
- Responsive Design: Works on desktop, tablet, and mobile devices
- Modern UI: Clean, professional interface with smooth animations
- Extension Ready: Provides API for browser extensions to access stored tokens
Hospital Dashboard/
├── index.html # Main dashboard page
├── styles.css # CSS styling and responsive design
├── script.js # JavaScript functionality and API
├── abha_id_dataset.csv # Patient data (CSV format)
├── test.html # Test page for functionality verification
└── README.md # This documentation
- Open the Dashboard: Open
index.htmlin a web browser - View Patients: Browse through the patient cards displayed in the grid
- Authenticate Patient: Click on any patient card to open the authentication modal
- Enter ABHA ID: Enter the correct ABHA ID for the selected patient
- Access Token: Once authenticated, the token is stored in localStorage
The dashboard displays the following patient information (excluding generated_token and abha_id from the main view):
- Patient Name
- Date of Birth
- Gender
- Mobile Number
- ABHA ID (shown in card details)
- Click on any patient card
- A modal will open showing the patient's details
- Enter the correct ABHA ID in the input field
- Click "Authenticate" to verify
- Upon successful authentication, the token is stored in localStorage
Tokens are stored in localStorage with the following keys:
patient_token_{ABHA_ID}: Contains the generated tokenpatient_data_{ABHA_ID}: Contains complete patient data with authentication timestamp
The dashboard provides a global HospitalDashboard object with the following methods:
// Get stored token for a specific patient
HospitalDashboard.getStoredToken(abhaId)
// Get stored patient data
HospitalDashboard.getStoredPatientData(abhaId)
// Check if patient is authenticated
HospitalDashboard.isPatientAuthenticated(abhaId)
// Get all stored tokens
HospitalDashboard.getAllStoredTokens()
// Get all stored patient data
HospitalDashboard.getAllStoredPatientData()Use test.html to verify:
- localStorage functionality
- Dashboard API availability
- Token storage and retrieval
- Data persistence
- Chrome 60+
- Firefox 55+
- Safari 12+
- Edge 79+
- Tokens are stored in localStorage (client-side)
- No server-side validation is implemented
- For production use, implement proper server-side authentication
- Consider using sessionStorage for more secure token storage
Modify styles.css to customize:
- Color scheme
- Layout spacing
- Card designs
- Modal appearance
Modify script.js to add:
- Additional validation
- New authentication methods
- Enhanced security features
- Custom API endpoints
- Modern web browser with JavaScript enabled
- Local web server (for CSV file loading) or serve files via HTTP/HTTPS
- No additional dependencies required
- Download all files to a directory
- Serve the files using a local web server (e.g., Python's http.server, Node.js http-server, or any web server)
- Open
index.htmlin your browser
// Check if a patient is authenticated
if (HospitalDashboard.isPatientAuthenticated('ABHA1234567890')) {
const token = HospitalDashboard.getStoredToken('ABHA1234567890');
console.log('Patient token:', token);
}
// Get all authenticated patients
const allTokens = HospitalDashboard.getAllStoredTokens();
console.log('All stored tokens:', allTokens);- CSV not loading: Ensure files are served via HTTP/HTTPS, not opened directly
- localStorage not working: Check browser settings and privacy mode
- Authentication failing: Verify ABHA ID matches exactly (case-sensitive)
- Styling issues: Check browser compatibility and CSS support
This project is open source and available under the MIT License.