Overview
The Playground project uses a carefully selected set of npm packages to provide Firebase integration, file handling, and calendar functionality. All dependencies are production dependencies as the project requires no build step.Dependency List
Frompackage.json:
Core Dependencies
Firebase (^10.12.2)
Purpose: Client-side Firebase SDK for web applications Use Cases in Playground:- User authentication (Firebase Auth)
- Real-time database access (Firebase Realtime Database)
- Push notifications (Firebase Cloud Messaging)
- User session management
- Real-time data synchronization
- Secure authentication with multiple providers
- Offline data persistence
- Cloud messaging for push notifications
scriptLogin.js- User authenticationAutorizacion.js- Authorization checksFirebaseMonitor.js- Database monitoringFirebaseWrapper.js- Firebase utility wrapperfirebase-messaging-sw.js- Service worker for push notifications- Multiple page scripts for data access
Firebase Admin (^12.0.0)
Purpose: Server-side Firebase SDK for privileged operations Use Cases in Playground:- Sending push notifications from serverless functions
- Server-side database queries
- Administrative operations without client-side restrictions
- Full administrative access to Firebase services
- Bypasses security rules (runs with admin privileges)
- Server-to-server authentication
- Token verification and custom token generation
netlify/functions/enviar-notificaciones.js:
File-SaverJS (^1.3.6)
Purpose: Client-side file download functionality Use Cases in Playground:- Downloading calculated results
- Exporting data to files
- Saving user-generated content
- Backup functionality
- Works across all modern browsers
- Supports Blob and File objects
- No server-side processing required
- UTF-8 and binary file support
- Chrome 14+
- Firefox 4+
- Safari 6.1+
- Edge (all versions)
- IE 10+
ICS (^3.7.6)
Purpose: Generate iCalendar (.ics) files for calendar events Use Cases in Playground:- Exporting work schedules to calendar
- Creating reminders for shifts
- Lunch schedule calendar integration
- Downloadable calendar files
- RFC 5545 compliant iCalendar format
- Support for events, alarms, and recurrence
- Timezone support
- Integrates with Google Calendar, Outlook, Apple Calendar
ics.js- Wrapper module for calendar generation- Shift schedule exports
- Lunch time reminders
TableExport (^5.2.0)
Purpose: Export HTML tables to various file formats Use Cases in Playground:- Exporting shift schedules
- Downloading procedure tables
- Data export functionality
- Report generation
- CSV (Comma Separated Values)
- TXT (Plain text)
- Excel (XLSX)
- SQL (INSERT statements)
- JSON
- Works with any HTML table
- Customizable styling
- Cell formatting preservation
- Multiple table export
- No server-side processing
- Schedule table exports
- Procedure documentation downloads
- Report generation features
External CDN Dependencies
The project also uses several libraries loaded via CDN in HTML files:Font Awesome (6.6.0)
Purpose: Icon library for UI elements Usage:- User icon:
<i class="far fa-user"></i> - Settings:
<i class="fa fa-gear"></i> - List:
<i class="fa fa-list"></i> - Admin:
<i class="fa fa-user-secret"></i>
Math.js (9.4.4)
Purpose: Advanced mathematics library for calculator functionality Usage:- Expression evaluation
- Complex numbers
- Unit conversion
- Matrix operations
- Statistical functions
- Calculator module (
Calculadora.html) - Mathematical computations
Google Fonts
Fonts Used: Nunito:Firebase SDK (8.10.0)
Legacy version loaded via CDN for compatibility:The project uses both Firebase v8 (CDN) and v10 (npm) for backward compatibility with existing code.
Dependency Management
Version Strategy
All dependencies use caret (^) versioning:- Allow minor version updates:
10.12.x→10.13.0✓ - Allow patch version updates:
10.12.2→10.12.3✓ - Prevent major version updates:
10.x.x→11.0.0✗
Updating Dependencies
Check for updates:Security Audits
Regularly check for security vulnerabilities:Bundle Size Analysis
Current Dependencies Size
Approximate unpacked sizes:| Package | Size | Notes |
|---|---|---|
| firebase | ~2.5 MB | Includes all Firebase services |
| firebase-admin | ~4.5 MB | Server-side only (not in client bundle) |
| file-saverjs | ~10 KB | Lightweight |
| ics | ~50 KB | Minimal overhead |
| tableexport | ~100 KB | Includes export libraries |
Optimization Tips
Tree Shaking: When using Firebase v10+ with ES modules:License Information
The Playground project is licensed under MIT License:Dependency Licenses
All dependencies are MIT or compatible licenses:- Firebase: Apache License 2.0
- Firebase Admin: Apache License 2.0
- file-saverjs: MIT License
- ics: MIT License
- tableexport: Apache License 2.0
All licenses are permissive and allow commercial use, modification, and distribution.
Troubleshooting
Common Dependency Issues
Firebase Version Conflicts
Problem: Multiple Firebase versions causing conflicts Solution: Use either v8 (CDN) or v10 (npm), not both. For new code, prefer v10 with ES modules.Missing Peer Dependencies
Problem: Warnings about missing peer dependencies Solution: Install recommended peer dependencies:Module Not Found
Problem:Cannot find module 'package-name'
Solution: Ensure package is in dependencies and run:
Function Bundle Too Large
Problem: Netlify function exceeds size limit (50MB) Solution:- Use
esbuildbundler (already configured) - Exclude unnecessary dependencies
- Use external dependencies where possible
Next Steps
- Set up local development environment
- Configure deployment to Netlify
- Review Firebase security rules
- Optimize bundle size with tree shaking
- Implement lazy loading for heavy components
