A secure, local-first patient data management system built with React, TypeScript, and PGlite. This application provides a robust solution for managing patient records entirely in the browser, with no server-side dependencies.
- Patient Pocket Ledger
- π Local-First Storage: All patient data is stored locally using PGlite, ensuring privacy and offline functionality
- π± Responsive Design: Optimized for all devices from mobile to desktop
- π¨ Modern UI: Built with shadcn/ui components for a polished user experience
- π Advanced Search: Powerful patient search and filtering capabilities
- π SQL Interface: Direct raw SQL query interface for advanced data analysis
- π Multi-Tab Support: Real-time data synchronization across browser tabs
- πΎ Data Persistence: Patient records persist across page refreshes
- π Zero-Server Architecture: Everything runs in the browser
Click on the screenshots to see the GIFs in action.
Shows the process of adding a new patient and how the data instantly synchronizes across two different browser tabs.
Demonstrates using the SQL interface to run custom queries against the local patient database.
- Node.js 18+
- Modern web browser with IndexedDB support
-
Clone the repository:
git clone git@github.com:RoystonDAlmeida/Patient-Registration-System.git cd Patient-Registration-System/ -
Install dependencies:
npm install
-
Start the development server:
npm run dev
-
Open your browser and navigate to
http://localhost:8080
- Click "Register Patient" tab in the tabs bar
- Fill in the patient details form
- Click "Register Patient" to submit and save the patient record
- Navigate to the "SQL Query" section
- Enter your SQL query in the editor
- Click "Execute" to run the query
- View results in the table below
The application automatically handles data synchronization across tabs:
- Changes made in one tab are immediately reflected in others
- All tabs maintain consistent data state
- No manual refresh required
npm run dev- Start development servernpm run build- Build for productionnpm run preview- Preview production buildnpm run lint- Run ESLint
- Uses PGlite for local SQL database functionality
- Implements IndexedDB for persistent storage
- Handles data synchronization through BroadcastChannel API
- React Query for server state management
- Local state management with React hooks
- Cross-tab communication using BroadcastChannel
Solution: Implemented a custom synchronization system using BroadcastChannel API to ensure real-time updates across tabs.
Solution: Leveraged PGlite's built-in persistence layer with IndexedDB to maintain data across page refreshes.
Solution: Created a safe SQL query interface with input validation and error handling to prevent SQL injection.
- All data is stored locally in the browser
- No sensitive data is transmitted to external servers
- SQL query interface includes input sanitization
- Regular security audits of dependencies
- React 18
- TypeScript
- Vite
- PGlite
- Tailwind CSS
- shadcn/ui
- React Router
- React Query
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.

