Skip to content

casheridan/sitescan

Repository files navigation

SiteScan - AI-Powered Infrastructure Inspection

SiteScan is a cutting-edge web application that leverages artificial intelligence to revolutionize infrastructure inspection and analysis. Upload videos from drones, cameras, or mobile devices, and get instant AI-powered defect detection with professional reporting.

πŸš€ Features

  • AI-Powered Analysis: Advanced machine learning models detect cracks, corrosion, and structural issues
  • Universal Compatibility: Works with videos from any device - drones, cameras, smartphones
  • Professional Reports: Generate comprehensive PDF reports with findings and recommendations
  • Real-time Processing: Fast analysis with progress tracking
  • Mobile-Responsive Landing: Optimized mobile experience for marketing pages
  • Desktop-Only App: Full application requires desktop for optimal user experience
  • Secure & Reliable: Enterprise-grade security with encrypted data handling

πŸ—οΈ Project Structure

sitescan-frontend/
β”œβ”€β”€ public/                     # Static assets
β”‚   β”œβ”€β”€ demo-video.mp4         # Demo video for landing page
β”‚   β”œβ”€β”€ manifest.json          # PWA manifest
β”‚   └── robots.txt             # SEO robots file
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ api/                   # API service layer
β”‚   β”‚   β”œβ”€β”€ auth.ts            # Authentication services
β”‚   β”‚   β”œβ”€β”€ videoApi.ts        # Video processing APIs
β”‚   β”‚   └── ...
β”‚   β”œβ”€β”€ app/                   # App-level routing
β”‚   β”‚   └── AppRoutes.tsx      # Main routing configuration
β”‚   β”œβ”€β”€ components/            # Shared components
β”‚   β”‚   β”œβ”€β”€ navigation/        # Navigation components
β”‚   β”‚   β”œβ”€β”€ ui/               # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ DesktopOnlyBlocker.tsx  # Mobile blocker component
β”‚   β”‚   └── ...
β”‚   β”œβ”€β”€ contexts/             # React contexts
β”‚   β”‚   β”œβ”€β”€ AuthContext.tsx   # Authentication state
β”‚   β”‚   └── AnalyticsContext.tsx
β”‚   β”œβ”€β”€ features/             # Feature-based modules
β”‚   β”‚   β”œβ”€β”€ landing/          # Landing page components
β”‚   β”‚   β”‚   β”œβ”€β”€ components/   # Landing-specific components
β”‚   β”‚   β”‚   └── pages/        # Landing page layouts
β”‚   β”‚   β”œβ”€β”€ auth/             # Authentication features
β”‚   β”‚   β”œβ”€β”€ dashboard/        # Dashboard features
β”‚   β”‚   β”œβ”€β”€ projects/         # Project management
β”‚   β”‚   β”œβ”€β”€ video-analysis/   # Video processing features
β”‚   β”‚   └── map/              # Defect mapping features
β”‚   β”œβ”€β”€ hooks/                # Custom React hooks
β”‚   β”‚   β”œβ”€β”€ useDeviceDetection.ts  # Device detection hook
β”‚   β”‚   β”œβ”€β”€ useVideoProcessing.ts  # Video processing hook
β”‚   β”‚   └── ...
β”‚   β”œβ”€β”€ lib/                  # External library configurations
β”‚   β”œβ”€β”€ styles/               # Global styles and CSS
β”‚   β”œβ”€β”€ types/                # TypeScript type definitions
β”‚   └── utils/                # Utility functions
β”œβ”€β”€ supabase/                 # Database migrations and config
β”‚   └── migrations/           # SQL migration files
β”œβ”€β”€ dist/                     # Production build output
└── docs/                     # Additional documentation
    β”œβ”€β”€ ACCESS_CONTROL.md     # User access control guide
    β”œβ”€β”€ ANALYTICS.md          # Analytics implementation
    β”œβ”€β”€ BACKEND_INTEGRATION.md # Backend integration guide
    └── SEO.md                # SEO optimization guide

πŸ› οΈ Technology Stack

Frontend

  • React 18 - Modern React with hooks and concurrent features
  • TypeScript - Type-safe JavaScript development
  • Vite - Fast build tool and development server
  • Chakra UI - Modern, accessible component library
  • React Router - Client-side routing
  • React Query - Server state management

Backend Integration

  • Supabase - Database and authentication
  • REST APIs - Video processing and data management
  • WebSocket - Real-time updates (where applicable)

Development Tools

  • ESLint - Code linting and formatting
  • Prettier - Code formatting
  • Vitest - Unit testing framework
  • TypeScript - Static type checking

πŸš€ Getting Started

Prerequisites

  • Node.js (v18 or higher)
  • npm or yarn
  • Git

Installation

  1. Clone the repository

    git clone <repository-url>
    cd sitescan/sitescan-frontend
  2. Install dependencies

    npm install
  3. Set up environment variables

    cp env.example .env.local

    Edit .env.local with your configuration:

    VITE_SUPABASE_URL=your_supabase_url
    VITE_SUPABASE_ANON_KEY=your_supabase_anon_key
    VITE_API_BASE_URL=your_api_base_url
  4. Start the development server

    npm run dev
  5. Open your browser Navigate to http://localhost:5173

Available Scripts

  • npm run dev - Start development server
  • npm run build - Build for production
  • npm run preview - Preview production build
  • npm run lint - Run ESLint
  • npm run test - Run unit tests
  • npm run type-check - Run TypeScript type checking

πŸ“± Mobile vs Desktop Experience

Mobile Experience

  • Landing Page: Fully responsive and optimized for mobile devices
  • Navigation: Touch-friendly mobile menu
  • Content: Streamlined mobile layout without video clutter
  • CTA Buttons: Stacked layout for easy touch interaction

Desktop Experience

  • Full Application: Complete feature set with desktop-optimized UI
  • Video Demo: Interactive video player in hero section
  • Floating Elements: Animated feature cards and visual enhancements
  • Side-by-side Layouts: Optimized for larger screens

Desktop-Only Blocker

When mobile users try to access the full application (/app/* or /ai-scanner), they see a professional blocker that:

  • Explains the desktop requirement
  • Shows supported devices (desktop/laptop vs mobile)
  • Provides clear instructions
  • Offers contact information for support

🀝 Contributing

We welcome contributions! Please follow these guidelines:

Development Workflow

  1. Fork the repository

  2. Create a feature branch

    git checkout -b feature/your-feature-name
  3. Make your changes

    • Follow the existing code style
    • Add TypeScript types for new code
    • Write tests for new functionality
    • Update documentation as needed
  4. Test your changes

    npm run lint
    npm run type-check
    npm run test
    npm run build
  5. Commit your changes

    git commit -m "feat: add your feature description"

    Use conventional commit format:

    • feat: - New features
    • fix: - Bug fixes
    • docs: - Documentation changes
    • style: - Code style changes
    • refactor: - Code refactoring
    • test: - Adding tests
    • chore: - Maintenance tasks
  6. Push to your fork

    git push origin feature/your-feature-name
  7. Create a Pull Request

Code Style Guidelines

  • TypeScript: Use strict typing, avoid any
  • Components: Use functional components with hooks
  • Styling: Use Chakra UI components and responsive design
  • File Naming: Use PascalCase for components, camelCase for utilities
  • Imports: Use absolute imports with path mapping (@/, @components/, etc.)

Component Structure

// components/MyComponent.tsx
import React from 'react'
import { Box, Text } from '@chakra-ui/react'

interface MyComponentProps {
  title: string
  children?: React.ReactNode
}

const MyComponent: React.FC<MyComponentProps> = ({ title, children }) => {
  return (
    <Box>
      <Text>{title}</Text>
      {children}
    </Box>
  )
}

export default MyComponent

Responsive Design Guidelines

  • Mobile First: Start with mobile design, then enhance for desktop
  • Breakpoints: Use Chakra UI's responsive props
    • base - Mobile (0px+)
    • sm - Small tablet (480px+)
    • md - Tablet (768px+)
    • lg - Desktop (992px+)
    • xl - Large desktop (1280px+)
// Example responsive component
<Box 
  p={{ base: 4, md: 8 }}
  fontSize={{ base: 'sm', md: 'md', lg: 'lg' }}
  direction={{ base: 'column', lg: 'row' }}
>

πŸ§ͺ Testing

Running Tests

npm run test          # Run all tests
npm run test:watch    # Run tests in watch mode
npm run test:coverage # Run tests with coverage report

Writing Tests

  • Use Vitest for unit tests
  • Test components with React Testing Library
  • Mock external dependencies
  • Test responsive behavior when applicable

πŸš€ Deployment

Production Build

npm run build

Environment Setup

  • Set up environment variables for production
  • Configure Supabase for production database
  • Set up analytics tracking
  • Configure error monitoring

Deployment Platforms

  • Vercel (recommended) - Automatic deployments from Git
  • Netlify - Static site hosting with form handling
  • AWS S3 + CloudFront - Scalable static hosting

πŸ“Š Analytics & Monitoring

The application includes:

  • Vercel Analytics - Performance and usage metrics
  • Error Tracking - Production error monitoring
  • User Analytics - User behavior tracking (privacy-compliant)

See ANALYTICS.md for detailed analytics implementation.

πŸ” Security

  • Authentication - Secure user authentication via Supabase
  • Data Encryption - All data encrypted in transit and at rest
  • Access Control - Role-based access control system
  • Input Validation - Comprehensive input sanitization
  • CORS - Properly configured cross-origin requests

πŸ“ Additional Documentation

πŸ†˜ Support

  • Email: ian@sitescan.build
  • Phone: (424) 354-0889
  • Issues: Create a GitHub issue for bugs or feature requests

πŸ“„ License

This project is proprietary software. All rights reserved.

πŸ™ Acknowledgments

Built with modern web technologies and best practices for performance, accessibility, and user experience.


Made with ❀️ for construction professionals

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •