- About
- Features
- System Architecture
- Project Structure
- Local Setup with XAMPP
- Requirements
- Installation
- Database Setup
- Configuration
- Usage
- API Documentation
- Testing
- Contributing
- License
The Sri Lankan Vaccine Safety Network (SLVSN) is a comprehensive vaccine monitoring and safety tracking system designed to assess vaccine safety and effectiveness across large and diverse populations in Sri Lanka. This Laravel-based web application leverages Big Data Analytics and Visualization to enhance vaccination process monitoring at large scales of public health.
"The project explores the concept of Big Data and Big Data visualization in relation to the vaccination process in Sri Lanka, ensuring vaccine safety and effectiveness through collaborative, investigator-led research efforts."
- Secure Registration/Login: Medical professionals can register with medical license numbers
- Profile Management: Users can update their profiles and credentials
- Password Reset: Secure password recovery system
- Session Management: Secure session handling with Laravel Breeze
- Vaccine Registry: Track vaccines with manufacturer details, batch numbers, and expiration dates
- Patient Records: Comprehensive patient information management
- Vaccination Records: Link patients with administered vaccines and healthcare providers
- Adverse Effects Tracking: Monitor and report vaccine adverse effects with severity levels
- Power BI Integration: Interactive dashboards for vaccination data analysis
- Real-time Monitoring: Live tracking of vaccination progress and adverse effects
- Big Data Processing: Handle large-scale vaccination data efficiently
- Audit Trails: Complete change logging system with database triggers
- News Integration: Real-time vaccine-related news from external APIs
- Research Access: Platform for accessing vaccination studies and data
- Community Engagement: Discussion forums and information sharing
- Database Triggers: Automatic change logging for all critical tables
- Data Integrity: Foreign key constraints and validation rules
- Audit Logging: Comprehensive tracking of all system changes
- Secure API Integration: Protected external service connections
- users: Healthcare professionals with medical license numbers
- patients: Patient demographic and contact information
- vaccines: Vaccine inventory with batch tracking
- vaccination_records: Links patients, vaccines, and administrators
- adverse_effects: Adverse effect reports with severity classification
- adverse_effect_logs: Audit trail for adverse effect changes
- change_log: System-wide change tracking
users (1) -----> (N) vaccination_records
patients (1) ---> (N) vaccination_records
vaccines (1) ---> (N) vaccination_records
vaccination_records (1) -> (N) adverse_effects
- Backend: Laravel 11.31 (PHP 8.2+)
- Frontend: Blade Templates, Alpine.js, Tailwind CSS
- Database: MySQL with automated triggers
- Testing: Pest PHP testing framework
- Build Tools: Vite, PostCSS
- Analytics: Power BI integration
.
ββ backend/ # Laravel application (server-side)
β ββ app/ # Application code (Models, Http Controllers, Requests, etc.)
β ββ bootstrap/ # Framework bootstrap
β ββ config/ # Laravel configuration files
β ββ database/ # Migrations, factories, seeders
β ββ public/ # Public web root (Vite builds output to build/ here)
β β ββ build/ # Compiled assets from frontend (manifest.json, assets/...)
β ββ resources/
β β ββ views/ # Blade templates (server-rendered UI)
β ββ routes/ # Web, console, auth routes
β ββ storage/ # Framework/cache/logs (should be writable)
β ββ tests/ # Pest tests
β ββ vendor/ # Composer dependencies
β ββ artisan # Artisan CLI
β ββ composer.json # Backend Composer config and scripts
β ββ phpunit.xml # PHPUnit/Pest configuration
β
ββ frontend/ # Client-side assets and build tooling
β ββ resources/
β β ββ css/ # Tailwind entry (app.css)
β β ββ js/ # JS entry (app.js, bootstrap.js)
β ββ package.json # Frontend scripts and deps
β ββ package-lock.json # Lockfile
β ββ postcss.config.js # PostCSS configuration
β ββ tailwind.config.js # Tailwind scan paths (points to backend views)
β ββ vite.config.js # Builds to ../backend/public/build and dev server
β
ββ CHANGELOG.md
ββ README.md
ββ (optional) .env files # Backend env at backend/.env; Vite env at frontend/.env
- Backend dev:
cd backend && composer install && composer dev - Frontend dev only:
cd frontend && npm install && npm run dev - Production build:
cd backend && composer build
Apache Alias (serve at http://localhost/slvsn)
- Open
C:\xampp\apache\conf\httpd.confand ensure these are enabled (no leading#):
LoadModule rewrite_module modules/mod_rewrite.so
Include conf/extra/httpd-xampp.conf
- Open
C:\xampp\apache\conf\extra\httpd-xampp.conf(orhttpd.confif preferred) and add:
# Serve SLVSN at http://localhost/slvsn
Alias /slvsn "S:/Vaccine_Monitoring_Sys/backend/public"
<Directory "S:/Vaccine_Monitoring_Sys/backend/public">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
DirectoryIndex index.php
</Directory>- Restart Apache in XAMPP.
Edit backend/.env:
APP_URL=http://localhost/slvsn
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=vaccine_monitoring
DB_USERNAME=root
DB_PASSWORD=
QUEUE_CONNECTION=synccd S:\Vaccine_Monitoring_Sys\backend
php artisan key:generate
php artisan storage:linkcd S:\Vaccine_Monitoring_Sys\frontend
npm install
npm run buildNotes:
- Vite 6 writes the manifest to
public/build/.vite/manifest.json. The build script also copies topublic/build/manifest.jsonfor compatibility.
cd S:\Vaccine_Monitoring_Sys\backend
php artisan config:clear
php artisan cache:clear
php artisan route:clear
php artisan view:clearhttp://localhost/slvsn- If you see a 404 on pretty URLs, verify
mod_rewriteis enabled andAllowOverride Allis set in the Alias<Directory>block.
- PHP: 8.2 or higher
- Composer: Latest version
- Node.js: 18+ and npm
- Database: MySQL 8.0+ or MariaDB 10.3+
- Web Server: Apache/Nginx
- OpenSSL
- PDO
- Mbstring
- Tokenizer
- XML
- Ctype
- JSON
- BCMath
git clone https://github.com/your-username/vaccine-monitoring-system.git
cd vaccine-monitoring-system# Install PHP dependencies
composer install
# Install Node.js dependencies
npm install# Copy environment file
cp .env.example .env
# Generate application key
php artisan key:generateEdit .env file with your settings:
APP_NAME="Vaccine Monitoring System"
APP_ENV=local
APP_KEY=base64:your-generated-key
APP_DEBUG=true
APP_URL=http://localhost
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=vaccine_monitoring
DB_USERNAME=your_username
DB_PASSWORD=your_password
# News API Configuration
NEWS_API_KEY=your_news_api_key# Create database
mysql -u root -p -e "CREATE DATABASE vaccine_monitoring;"
# Run migrations
php artisan migrate
# Seed database (optional)
php artisan db:seed# Development
npm run dev
# Production
npm run build# Option 1: Laravel development server
php artisan serve
# Option 2: Using the dev script (includes queue worker and Vite)
composer run devVisit http://localhost:8000 to access the application.
The system includes comprehensive database migrations:
-
Core Laravel Tables:
0001_01_01_000000_create_users_table.php0001_01_01_000001_create_cache_table.php0001_01_01_000002_create_jobs_table.php
-
Vaccine System Tables:
2024_12_28_070514_create_vaccines_table.php2024_12_28_070602_create_patients_table.php2024_12_28_070631_create_vaccination_records_table.php2024_12_28_071225_create_adverse_effects_table.php
-
Audit & Logging:
2024_12_28_072019_create_change_log_table.php2025_01_13_114103_create_adverse_effect_logs_table.php
-
Database Triggers:
2024_12_28_110152_create_triggers_for_vaccines.php2024_12_28_110647_create_update_trigger_for_patients.php2024_12_28_110658_create_update_trigger_for_vaccination_records.php2024_12_28_110709_create_update_trigger_for_adverse_effects.php
-
User Enhancements:
2025_01_13_083120_add_medical_no_to_users_table.php
# Run all migrations
php artisan migrate
# Rollback migrations (if needed)
php artisan migrate:rollback
# Fresh migration with seeding
php artisan migrate:fresh --seed- Register at NewsAPI.org
- Get your API key
- Add to
.env:NEWS_API_KEY=your_api_key_here
The dashboard integrates with Power BI for advanced analytics. Update the iframe source in resources/views/dashboard.blade.php with your Power BI report URL.
Configure mail settings in .env for password reset functionality:
MAIL_MAILER=smtp
MAIL_HOST=your-smtp-host
MAIL_PORT=587
MAIL_USERNAME=your-email
MAIL_PASSWORD=your-password
MAIL_ENCRYPTION=tls- Navigate to
/register - Fill in required information including medical license number
- Verify email (if email verification is enabled)
- Access the dashboard
- Login to the system
- Navigate to "Adverse Effects" section
- Create, view, edit, or delete adverse effect reports
- View audit logs for all changes
- Login and go to Dashboard
- View Power BI integrated reports
- Analyze vaccination trends and adverse effects
- Export data for further analysis
- Visit
/newsfor latest vaccine-related news - News is automatically fetched from external APIs
- Articles are filtered for vaccine and health-related content
// List all adverse effects
GET /adverse_effects
// Create new adverse effect
POST /adverse_effects
// Edit adverse effect
GET /adverse_effects/{id}/edit
// Update adverse effect
PUT /adverse_effects/{id}
// Delete adverse effect
DELETE /adverse_effects/{id}
// View audit logs
GET /adverse_effects/logs// Registration
GET|POST /register
// Login
GET|POST /login
// Logout
POST /logout
// Password Reset
GET|POST /forgot-password
GET|POST /reset-password/{token}# Run all tests
php artisan test
# Run specific test suite
php artisan test --testsuite=Feature
# Run with coverage
php artisan test --coverage
# Run specific test file
php artisan test tests/Feature/AdverseEffectTest.php- Feature Tests: End-to-end application testing
- Unit Tests: Individual component testing
- Authentication Tests: User registration, login, logout
- Adverse Effects Tests: CRUD operations and validation
tests/Feature/AdverseEffectTest.phptests/Feature/UserAuthenticationTest.phptests/Feature/ProfileTest.phptests/Feature/Auth/AuthenticationTest.phptests/Feature/Auth/RegistrationTest.php
The project uses Laravel Pint for code formatting:
# Format code
./vendor/bin/pint
# Check formatting
./vendor/bin/pint --test# Start development environment
composer run dev
# Clear application cache
php artisan cache:clear
php artisan config:clear
php artisan view:clear
# Generate IDE helper files
php artisan ide-helper:generate# Create new migration
php artisan make:migration create_table_name
# Create new model with migration
php artisan make:model ModelName -m
# Create new controller
php artisan make:controller ControllerName --resourceWe welcome contributions to improve the Vaccine Monitoring System!
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow PSR-12 coding standards
- Write tests for new features
- Update documentation as needed
- Ensure all tests pass before submitting PR
- Use GitHub Issues for bug reports
- Provide detailed reproduction steps
- Include system information and error logs
This project is licensed under the MIT License - see the LICENSE file for details.
- Laravel Framework: For providing an excellent foundation
- Sri Lankan Health Ministry: For supporting vaccine safety initiatives
- Healthcare Professionals: For their valuable feedback and requirements
- Open Source Community: For the amazing tools and libraries
For support and questions:
- Email: [email protected]
- Documentation: Project Wiki
- Issues: GitHub Issues
Crafted with care for Sri Lanka's Healthcare System
Ensuring vaccine safety through technology and data-driven insights.#