A comprehensive, enterprise-level monorepo solution for monitoring and managing fiber optic installation projects. This system provides real-time project tracking, automated reporting, and seamless collaboration between field workers and management teams.
This project implements a modern, scalable architecture with:
- Microservices Architecture: Separate applications for different user roles
- Real-time Data Synchronization: Live updates across all applications
- Enterprise Security: Role-based access control with Supabase Auth
- Scalable Database Design: PostgreSQL with optimized schemas
- Cloud-Native Storage: R2-compatible object storage for documents
- Mobile-First Design: Responsive interfaces for field operations
- Real-time Project Visibility: Live dashboards with KPIs and progress metrics
- Automated Reporting: Daily, weekly, and monthly reports generation
- Resource Optimization: Track team performance and project efficiency
- Risk Management: Early identification of project delays and issues
- Compliance Tracking: Automated audit trails and documentation
- Streamlined Workflows: Intuitive mobile interfaces for field workers
- Offline Capability: Work continues even with intermittent connectivity
- Photo Documentation: Integrated photo capture with GPS tagging
- Issue Reporting: Real-time problem escalation and tracking
- Progress Tracking: Milestone completion with automated notifications
- Framework: Next.js 14 with App Router
- UI Library: shadcn/ui components with Tailwind CSS
- State Management: React hooks with custom state management
- Real-time Updates: Supabase Realtime subscriptions
- Database: PostgreSQL 15 with Supabase
- Authentication: Supabase Auth with role-based access control
- API: RESTful APIs with Next.js API routes
- Storage: Cloudflare R2 compatible object storage
- Real-time: WebSocket connections via Supabase Realtime
- Monorepo Management: Turborepo for efficient build processes
- Containerization: Docker for consistent deployment
- Type Safety: TypeScript throughout the application
- Code Quality: ESLint, Prettier, and Husky for code standards
Target Users: Project Managers, Supervisors, Executives
Key Features:
- Executive dashboard with KPIs and analytics
- Project portfolio management
- Team performance monitoring
- Automated report generation
- Document approval workflows
- Real-time project status visualization
- User management and role assignment
Technical Highlights:
- Advanced data visualization with charts and graphs
- Bulk operations for project management
- Export capabilities (Excel, PDF)
- Real-time notifications and alerts
Target Users: Field Technicians, Site Supervisors
Key Features:
- Mobile-optimized field reporting
- Photo documentation with GPS coordinates
- Offline-first design for remote locations
- Milestone tracking and completion
- Issue reporting with photo evidence
- Daily progress updates
Technical Highlights:
- Progressive Web App (PWA) capabilities
- Offline data synchronization
- Camera integration with metadata
- Location-based project filtering
- Project metadata and configuration
- Timeline and milestone definitions
- Team assignments and permissions
- Status tracking and progress metrics
- Daily field reports with structured data
- Photo documentation and attachments
- GPS coordinates and location data
- Issue tracking and resolution
- Multi-format document storage
- Version control and audit trails
- Category-based organization
- Access control and permissions
- Role-based access control (RBAC)
- Project-specific permissions
- Activity logging and audit trails
- Authentication and session management
- Node.js: Version 18.0.0 or higher
- Docker: Version 20.10.0 or higher
- Supabase CLI: Latest version
- Git: Version 2.30.0 or higher
-
Clone the Repository
git clone https://github.com/Kevin5621/fiber-monitoring-project.git cd fiber-monitoring-project
-
Install Dependencies
npm install
-
Environment Configuration Create environment files for each application:
Admin App (
apps/admin/.env.local
):NEXT_PUBLIC_SUPABASE_URL=your_supabase_url NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key SUPABASE_SERVICE_ROLE_KEY=your_service_role_key R2_ACCESS_KEY_ID=your_r2_access_key R2_SECRET_ACCESS_KEY=your_r2_secret_key R2_BUCKET_NAME=your_bucket_name R2_ENDPOINT=your_r2_endpoint
Waspang App (
apps/waspang/.env.local
):NEXT_PUBLIC_SUPABASE_URL=your_supabase_url NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key SUPABASE_SERVICE_ROLE_KEY=your_service_role_key R2_ACCESS_KEY_ID=your_r2_access_key R2_SECRET_ACCESS_KEY=your_r2_secret_key R2_BUCKET_NAME=your_bucket_name R2_ENDPOINT=your_r2_endpoint
-
Database Setup
# Start Supabase locally supabase start # Apply migrations supabase db reset
-
Start Development Servers
# Start all applications npm run dev # Or start specific applications npm run dev:admin npm run dev:waspang npm run dev:all
π For a complete list of all available scripts, see Available Scripts
# Install dependencies for all packages
npm install
# Run development servers
npm run dev # All apps
npm run dev:admin # Admin only
npm run dev:waspang # Waspang only
# Build applications
npm run build # All apps
npm run build:admin # Admin only
npm run build:waspang # Waspang only
# Start production servers
npm run start # All apps
npm run start:admin # Admin only
npm run start:waspang # Waspang only
# Type checking
npm run type-check # All packages
npm run type-check:admin # Admin only
npm run type-check:waspang # Waspang only
npm run type-check:shared # Shared package only
npm run type-check:report # Detailed type check report
# Lint and format code
npm run lint # All packages (with turbo - stops on first error)
npm run lint:all # All packages (individual - shows all errors)
npm run lint:admin # Admin only
npm run lint:waspang # Waspang only
npm run lint:shared # Shared package only
npm run format # Format all code
# Database and utilities
npm run seed:storage # Seed storage data
npm run reset:all # Reset all data
# Start Supabase
supabase start
# Stop Supabase
supabase stop
# Reset database (applies migrations and seeds)
supabase db reset
# Generate new migration
supabase migration new migration_name
# Apply migrations only
supabase db push
# View database status
supabase status
The project provides two different linting approaches:
- Uses Turborepo to run lint across all workspaces
- Stops on first error - if shared package has errors, admin and waspang won't show their errors
- Useful for CI/CD pipelines where you want to fail fast
- Runs lint for each workspace independently
- Shows all errors from all workspaces
- Useful for development to see all issues at once
- Provides clear status for each workspace
npm run lint:admin # Lint admin app only
npm run lint:waspang # Lint waspang app only
npm run lint:shared # Lint shared package only
npm run type-check # Check all packages
npm run type-check:admin # Check admin only
npm run type-check:waspang # Check waspang only
npm run type-check:shared # Check shared only
npm run type-check:report # Detailed report with counts
If you encounter authentication errors like:
password authentication failed for user "supabase_storage_admin"
Solution:
# Stop all Supabase services
supabase stop
# Clean Docker resources
docker system prune -f
# Restart Supabase
supabase start
If ports are already in use:
# Check what's using the ports
sudo lsof -i :54321 # API port
sudo lsof -i :54322 # Database port
sudo lsof -i :54323 # Studio port
# Kill processes if necessary
sudo kill -9 <PID>
# Reset database completely
supabase db reset --linked
# Or reset local database
supabase db reset
- Use
npm run dev --filter=<app>
to run only specific applications - Enable Turbo cache:
npx turbo build --cache-dir=.turbo
- Optimize images and assets
- Enable compression and caching
- Use CDN for static assets
- Project completion rates
- Team productivity metrics
- Issue resolution times
- Document upload statistics
- User activity tracking
- Excel export functionality
- PDF report generation
- Real-time dashboard updates
- Automated email notifications
- Multi-factor authentication support
- Role-based access control (RBAC)
- Session management with secure tokens
- Brute force protection
- Encrypted data transmission (HTTPS)
- Secure file uploads with validation
- Audit logging for all operations
- GDPR-compliant data handling
- Rate limiting and throttling
- Input validation and sanitization
- CORS configuration
- API key management
# Build for production
npm run build
# Start production servers
npm run start
# Or start specific applications
npm run start:admin
npm run start:waspang
# Build Docker images
docker-compose build
# Deploy with Docker Compose
docker-compose up -d
Ensure all required environment variables are set in production:
- Database connection strings
- API keys and secrets
- Storage configuration
- Authentication settings
- Indexed queries for performance
- Connection pooling
- Read replicas for analytics
- Automated backups
- Horizontal scaling with load balancers
- Caching strategies (Redis)
- CDN for static assets
- Microservices architecture
- Follow TypeScript best practices
- Write comprehensive tests
- Use conventional commit messages
- Update documentation for new features
- Follow the established code style
- Create feature branches from
main
- Submit pull requests with detailed descriptions
- Ensure all tests pass
- Update relevant documentation
- Get approval from maintainers
This project is licensed under the MIT License - see the LICENSE file for details.
- Available Scripts - Complete list of all available npm scripts
- API Documentation
- Database Schema
- Deployment Guide
- Troubleshooting Guide
- Technical Issues: Create an issue on GitHub
- Feature Requests: Submit via GitHub discussions
- Security Concerns: Email security@company.com
Built with β€οΈ for enterprise-grade fiber optic project management