Quickstart Guide
This guide will help you set up OmniEHR on your local machine. You’ll have a fully functional FHIR-compatible EHR system running in minutes.Prerequisites
Before you begin, ensure you have the following installed:- Node.js 18+ and npm
- Docker and Docker Compose (for MongoDB)
- Git for cloning the repository
- OpenSSL for generating encryption keys
If you already have MongoDB running, you can skip Docker and point to your existing instance using the
MONGODB_URI environment variable.Installation Steps
Start MongoDB
Use Docker Compose to start a local MongoDB instance:This starts MongoDB 7 on
Verify MongoDB is running:You should see the
localhost:27017 with a database named ehr.Docker Compose Configuration
Docker Compose Configuration
The Data persists in the
docker-compose.yml file includes:mongo_data Docker volume.mongo:7 container.Install Dependencies
Install all dependencies for both server and client:This installs dependencies for the monorepo workspace, including:Server dependencies:
express- REST API frameworkmongoose- MongoDB ODMjsonwebtoken- JWT authenticationbcryptjs- Password hashinghelmet- Security headerszod- Input validation
react&react-dom- UI frameworkreact-router-dom- Client routingvite- Build tool
Configure Environment Variables
Copy the example environment files:Generate a secure 256-bit (32-byte) encryption key:This outputs a 64-character hex string. Copy it to
Server Configuration
Editserver/.env with the following values:PHI_ENCRYPTION_KEY in server/.env.Example output:Client Configuration
Editclient/.env:Environment Variable Reference
Environment Variable Reference
| Variable | Description | Required | Default |
|---|---|---|---|
NODE_ENV | Environment mode | Yes | development |
PORT | Server port | Yes | 4000 |
MONGODB_URI | MongoDB connection string | Yes | - |
JWT_SECRET | Secret for signing JWTs | Yes | - |
JWT_EXPIRES_IN | Token expiration time | Yes | 8h |
PHI_ENCRYPTION_KEY | 64-char hex key for AES-256-GCM | Yes | - |
CORS_ORIGIN | Allowed frontend origin | No | - |
VITE_API_BASE_URL | Backend API URL | Yes | - |
Start the Application
Run both server and client in development mode:This starts:
- API Server at
http://localhost:4000 - Frontend UI at
http://localhost:5173
The server uses
nodemon for hot-reloading. The client uses Vite’s HMR for instant updates.Demo Credentials
OmniEHR includes demo accounts for testing different roles:Admin Account
Email:
[email protected]Password: Abcdefgh@998761Full system access including user provisioning and patient management.Practitioner Account
Email:
[email protected]Password: Abcdefgh@998761Clinical access with restrictions to own schedule and tasks.Verify Installation
Test that everything is working correctly:1. Check API Health
2. Test Authentication
3. Check FHIR Metadata
- Patient
- Observation
- Condition
- AllergyIntolerance
- MedicationRequest
- Encounter
- Appointment
- Task
Next Steps
Now that OmniEHR is running, explore these features:Create a Patient
Register patients via admin interface or public portal
Schedule Appointments
Book appointments with conflict detection
Use FHIR APIs
Interact with RESTful FHIR endpoints
Review Audit Logs
Monitor system access and changes
Common Issues
MongoDB Connection Failed
MongoDB Connection Failed
Error:
MongooseServerSelectionError: connect ECONNREFUSED 127.0.0.1:27017Solution:- Verify MongoDB is running:
docker ps - Check MongoDB logs:
docker logs [container_id] - Ensure
MONGODB_URIinserver/.envmatches your setup
Invalid PHI_ENCRYPTION_KEY
Invalid PHI_ENCRYPTION_KEY
Error: Update
PHI_ENCRYPTION_KEY must be a 64-char hex string (32 bytes)Solution:
Generate a new key with exactly 64 hex characters:PHI_ENCRYPTION_KEY in server/.envCORS Errors in Browser
CORS Errors in Browser
Error:
Access to fetch at 'http://localhost:4000/api/...' has been blocked by CORS policySolution:- Ensure
CORS_ORIGIN=http://localhost:5173inserver/.env - Restart the server:
npm run dev:server - Verify client is running on port 5173
Port Already in Use
Port Already in Use
Error:
Error: listen EADDRINUSE: address already in use :::4000Solution:- Find process using port:
lsof -i :4000(macOS/Linux) ornetstat -ano | findstr :4000(Windows) - Kill the process or change
PORTinserver/.env
Development Workflow
Running Tests
Project Structure
Production Deployment
Recommended production enhancements:- Multi-factor authentication (MFA)
- Token refresh and revocation
- Immutable audit log storage (WORM)
- SIEM integration for monitoring
- Automated security scanning
- Penetration testing
- Business Associate Agreements (BAAs)
Getting Help
Need assistance?- Check the API Reference for endpoint documentation
- Review Security Best Practices
- Open an issue on GitHub
- Join our community discussions
Remember: HIPAA compliance requires organizational policies, procedures, training, and risk management beyond these technical controls.