A secure, modern healthcare platform that digitizes prescriptions and patient records, enabling seamless communication between doctors, patients, and pharmacists through QR code technology.
Traditional healthcare systems rely heavily on handwritten prescriptions, which are:
- Prone to misinterpretation and errors
- Easily lost or damaged
- Vulnerable to fraud and forgery
- Inefficient for tracking patient medical history
- Time-consuming for pharmacy verification
MedConnect solves these challenges by providing a comprehensive digital platform that connects all stakeholders in the healthcare prescription ecosystem.
- Digital Prescription Creation: Issue prescriptions with detailed medication information
- Patient Medical History: Access complete patient records and visit history
- QR Code Generation: Automatic generation of secure QR codes for each prescription
- Visit Documentation: Record consultations, diagnoses, and treatment notes
- Digital Medical Records: Maintain comprehensive health history
- Prescription Tracking: Monitor prescription status and fulfillment
- Secure Access: Role-based authentication and data protection
- Emergency Information: Store critical health information and emergency contacts
- QR Code Verification: Instantly verify prescription authenticity by scanning QR codes
- Prescription Fulfillment: Process and mark prescriptions as completed
- Audit Trail: Complete logging of all pharmacy interactions
- Anti-Fraud Protection: Secure validation prevents prescription tampering
- End-to-End Encryption: All sensitive data is encrypted
- Role-Based Access Control: Users only access data relevant to their role
- Audit Logging: Complete tracking of all system interactions
- Data Privacy: Compliance with healthcare data protection standards
- Node.js with Express.js - RESTful API server
- TypeScript - Type-safe development
- PostgreSQL - Primary database
- Sequelize ORM - Database modeling and migrations
- JWT - Authentication and authorization
- bcryptjs - Password hashing
- QRCode - QR code generation
- Nodemailer - Email delivery
- ESLint - Code linting and formatting
- Nodemon - Development server auto-reload
- Sequelize CLI - Database migrations and seeding
- ts-node - TypeScript execution
- Node.js 18+
- PostgreSQL 12+
- npm or yarn
-
Clone the repository
git clone <repository-url> cd mediConnect-API
-
Install dependencies
npm install
-
Environment Configuration
cp .env.example .env # Edit .env with your database credentials and other settings -
Database Setup
# Create database npm run db:reset # Run migrations npm run db:migrate # Seed with sample data npm run db:seed
-
Start Development Server
npm run dev
The server will be available at http://localhost:3000
| Command | Description |
|---|---|
npm run dev |
Start development server with hot reload |
npm run build |
Build TypeScript to JavaScript |
npm start |
Start production server |
npm run lint |
Run ESLint code analysis |
npm run lint:fix |
Auto-fix ESLint issues |
npm run db:migrate |
Run database migrations |
npm run db:seed |
Seed database with sample data |
npm run db:reset |
Reset database (drop, create, migrate) |
npm run db:fresh |
Fresh database with seeds |
The system uses a relational database with the following core entities:
- Users - Base user accounts (doctors, patients, pharmacists, admins)
- Patients - Patient-specific information and medical history
- Doctors - Doctor credentials and hospital affiliations
- Medical Visits - Individual consultation records
- Prescriptions - Digital prescriptions linked to visits
- Prescription Items - Individual medications within prescriptions
- QR Codes - Secure QR codes for prescription verification
- Pharmacy Logs - Audit trail of pharmacy interactions
The system implements role-based access control with four user types:
- Admin: Full system access and user management
- Doctor: Create prescriptions, view patient records, manage visits
- Pharmacist: Scan and fulfill prescriptions, view pharmacy logs
- Patient: View own medical history and prescriptions
GET /health - System health status
GET /api/v1 - API information and status
POST /api/v1/auth/login - User authentication
POST /api/v1/auth/register - User registration
POST /api/v1/auth/refresh - Token refresh
POST /api/v1/prescriptions - Create new prescription
GET /api/v1/prescriptions/:id - Get prescription details
PUT /api/v1/prescriptions/:id/status - Update prescription status
POST /api/v1/qr/scan - Scan and verify QR code
GET /api/v1/qr/:hash/details - Get prescription from QR hash
- β Secure web platform for digital prescription management
- β QR code generation and email delivery system
- β Role-based access for all healthcare stakeholders
- β Complete patient medical history management
- β³ Sub-10 second pharmacy verification process
- β³ Healthcare data compliance and privacy protection
- Prescription verification time < 10 seconds
- Zero prescription fraud incidents
- 99%+ system uptime
- Full audit trail for all transactions
- Seamless user experience across all roles
Current Phase: Backend Development & Database Architecture β
Completed:
- Database schema design and migrations
- Core model definitions and relationships
- Development environment setup
- Basic server configuration
- Authentication framework preparation
In Progress:
- REST API endpoint implementation
- Authentication and authorization system
- QR code generation and verification
- Email notification system
Upcoming:
- Frontend React application
- API integration and testing
- Security auditing and compliance
- Production deployment
This is currently a team development project. For team members:
- Create feature branches from
main - Follow the established ESLint configuration
- Run tests before submitting pull requests
- Update documentation for new features
MIT License - This project is open source and available for educational and non-commercial use.
MedConnect is designed to modernize healthcare prescription management in Rwanda and beyond. By connecting doctors, patients, and pharmacists through secure digital technology, we aim to improve healthcare delivery, reduce errors, and enhance patient safety.