A comprehensive Laravel + Vue.js application for managing patients, medical entries, and entry document attachments with advanced filtering capabilities and SUS integration.
Made with ❤️ by Gustavo M.
- Modal-based Patient Creation - Clean popup interface for adding new patients with SUS number support
- Modal-based Entry Creation - Streamlined entry creation with patient selection
- Advanced Filtering System - Date ranges, patient names, entry IDs with real-time updates
- Configurable Display Limits - Choose 5, 10, 25, 50, or 100 entries per view
- Real-time Updates - Automatic refresh after create/update/delete operations
- Complete Patient Information - Name, email, phone, and SUS (Sistema Único de Saúde) number
- Patient List View - Comprehensive table with search and filtering capabilities
- Individual Patient View - Detailed patient information with statistics and quick actions
- Patient Editing - Update patient information including SUS number
- Entry File Upload - Support for images, PDFs, DOC, and text files (max 10MB) per entry
- Entry Document Categories - Medical Records, Exam Results, Prescriptions, Insurance, Others
- Entry Document Viewing - Download and preview capabilities for entry documents
- Entry Document Organization - Description fields and type categorization per entry
- Secure Storage - Files stored securely with unique naming
- Dedicated Completed View - Separate interface for finished procedures
- Uncomplete Functionality - Mark completed entries as active again
- Safe Deletion - Delete with confirmation dialogs
- Advanced Filtering Popup - Comprehensive filter options in modal
- Visual Filter Indicators - See active filters at a glance
- Backend: Laravel 11.x with Eloquent ORM
- Frontend: Vue 3 with Composition API
- UI: Shadcn/ui components with Tailwind CSS
- Database: MySQL/PostgreSQL
- API: RESTful endpoints with JSON responses
- Docker: Optimized multi-stage builds (5-8 min build time)
# Clone repository
git clone <repository-url>
cd regulacao-list
# Fast production build (5-8 minutes)
./scripts/fast-build.sh
# Or use make command
make build-fast-
Clone and install dependencies
git clone <repository-url> cd regulacao-list composer install npm install
-
Environment setup
cp .env.example .env php artisan key:generate
-
Database setup
php artisan migrate
-
Build assets
npm run build
-
Start development server
php artisan serve
- Create a user account through registration
- Access the dashboard at
/dashboard - Start by creating patients using the "Add Patient" button (include SUS number if available)
- Upload entry documents for better record keeping
- Create entries for patients using the "Add Entry" button
- Patient List: View all patients at
/patientswith search capabilities - Patient Details: Click "View" on any patient to see detailed information
- SUS Integration: Store and search by SUS (Sistema Único de Saúde) numbers
- Document Upload: Attach identity documents, medical records, exam results, etc.
- Patient Statistics: View entry counts and completion statistics
- Active Entries: View and manage ongoing procedures on the Dashboard
- Completed Entries: Access completed procedures at
/entries/completed - Filtering: Use the filter popup to search by date, patient name, or entry ID
- Actions: Complete, uncomplete, or delete entries as needed
- Categorized Storage: Organize documents by type (Identity, Medical Records, etc.)
- Secure Upload: Files stored with unique names and proper validation
- Download/Preview: Easy access to uploaded documents
- File Management: Delete documents with confirmation prompts
GET /api/entries- List active entries (supports filtering)POST /api/entries- Create new entryGET /api/entries/completed- List completed entries (supports filtering)PUT /api/entries/{id}/complete- Toggle entry completion statusDELETE /api/entries/{id}- Delete entry
GET /api/patients- List all patients (supports search and filtering)POST /api/patients- Create new patient (with SUS number support)GET /api/patients/{id}- Get patient details with statisticsPUT /api/patients/{id}- Update patient informationDELETE /api/patients/{id}- Delete patient
GET /api/entries/{id}/documents- List entry documentsPOST /api/entries/{id}/documents- Upload new document to entryGET /api/entries/{id}/documents/{docId}- Get entry document detailsGET /api/entries/{id}/documents/{docId}/download- Download entry documentDELETE /api/entries/{id}/documents/{docId}- Delete entry documentGET /api/entry-document-types- Get available entry document types
All entry endpoints support these query parameters:
date_from- Start date filter (YYYY-MM-DD)date_to- End date filter (YYYY-MM-DD)patient_name- Search by patient name (partial match)entry_id- Find specific entry by IDlimit- Number of results (1-1000, default: 10)
Patient endpoints support these query parameters:
search- Search by name, email, or SUS number (partial match)limit- Number of results (1-1000, default: 50)
Document upload requires:
file- The document file (max 10MB)document_type- Document category (identity, cpf, sus_card, medical_record, exam_result, prescription, insurance, other)description- Optional description text
- Authentication required for all routes
- CSRF protection on forms
- Input validation (client and server-side)
- SQL injection prevention via Eloquent ORM
- XSS protection through data sanitization
For development/testing purposes, you can generate sample data:
# Creates demo patients, entries, and entry documents (optional)
php artisan db:seed --class=CompletedEntriesSeeder
# Creates test user (optional)
php artisan db:seedWarning: Do not run seeders in production - they create test data only.
The application uses Laravel's public disk for document storage:
# Create symbolic link for file access
php artisan storage:linkEnsure your storage directory has proper write permissions.
# Development
npm run dev
# Production build
npm run build
# Watch for changes
npm run dev -- --watchThis application starts with a clean database:
- No pre-populated patients, entries, or entry documents
- Ready for production use with SUS integration
- All test/demo data removed
- Seeders are optional and clearly marked for development only
- Document storage configured for secure file management
The application includes full support for the Brazilian Sistema Único de Saúde (SUS):
- SUS Number Field: 15-digit SUS card numbers
- Validation: Unique SUS numbers per patient
- Search Capability: Find patients by SUS number
- Optional Field: SUS number is not required but recommended
- Formatted Display: SUS numbers displayed with proper spacing (XXX XXXX XXXX XXXX)
The system supports the following document categories:
- Documento de Identidade - Identity documents
- CPF - Brazilian tax ID documents
- Cartão SUS - SUS card documentation
- Prontuário Médico - Medical records
- Resultado de Exame - Exam results and lab reports
- Receita Médica - Medical prescriptions
- Plano de Saúde - Insurance documentation
- Outros - Other document types
- Files stored with UUID-based names to prevent direct access
- Mime type validation on upload
- File size limits (10MB maximum)
- Secure download through application routes
- Automatic file cleanup when documents are deleted
This application supports multiple deployment platforms:
Complete containerization with development and production configurations:
# Development setup
make setup
make dev
# Production deployment
make prod-buildSee DOCKER.md for comprehensive Docker documentation including:
- Multi-stage builds
- Docker Compose configurations
- GitHub Actions CI/CD
- Production optimizations
One-click deployment with automatic dependency detection:
# Install Railway CLI
npm install -g @railway/cli
# Deploy to Railway
railway login
railway init
railway upSee RAILWAY.md for detailed Railway deployment guide including:
- Nixpacks configuration
- Database setup
- Environment variables
- Scaling and monitoring
Global deployment with edge computing capabilities:
# Install Fly.io CLI
curl -L https://fly.io/install.sh | sh
# Automated deployment
./fly-deploy.sh
# Or manual deployment
flyctl auth login
flyctl launch
flyctl deploySee FLY.md for complete Fly.io deployment guide including:
- Global scaling
- Multi-region deployment
- Performance optimization
- Cost optimization
Standard LAMP/LEMP stack deployment:
- Upload files to web server
- Configure environment variables
- Run migrations:
php artisan migrate --force - Build assets:
npm run build - Configure web server (Apache/Nginx)
- DOCKER.md - Complete Docker setup with CI/CD
- RAILWAY.md - Railway platform deployment
- FLY.md - Fly.io global edge deployment
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly (using Docker, Railway, Fly.io, or traditional setup)
- Submit a pull request
This project is open-sourced software licensed under the MIT license.
Made with ❤️ by Gustavo M.