Skip to content

chiraghontec/SiteAnalysis-Frontend

Repository files navigation

AI Powered Site Analysis - Frontend

A comprehensive web application for analyzing websites using AI-powered tools. This Next.js application provides an intuitive interface for environmental site analysis, interactive mapping, and data visualization.

🌟 Features

Core Functionality

  • 🏠 Home Dashboard: Central hub for coordinate input and project overview
  • πŸ“Š Analysis Module: Comprehensive site analysis with AI-powered insights
  • πŸ—ΊοΈ Interactive Maps: High-performance Leaflet.js mapping with advanced filters
  • πŸ“± Responsive Design: Mobile-first design that works across all devices
  • 🎯 Real-time Navigation: Professional navbar with breadcrumb system

Advanced Capabilities

  • Coordinate Management: Support for multiple coordinate formats (DMS, DD)
  • Cross-page Data Persistence: Seamless data flow using localStorage
  • Filter System: Advanced filtering for environmental and site data
  • Performance Optimized: Fast-loading maps with direct imports
  • Professional UX: Consistent branding and intuitive user interface

πŸš€ Quick Start

Prerequisites

  • Node.js 18+
  • npm or yarn
  • Git

Installation

  1. Clone the repository

    git clone https://github.com/chiraghontec/SiteAnalysis-Frontend.git
    cd SiteAnalysis-Frontend
  2. Install dependencies

    npm install
    # or
    yarn install
  3. Start development server

    npm run dev
    # or
    yarn dev
  4. Open your browser Navigate to http://localhost:9002

πŸ› οΈ Tech Stack

Core Framework

  • Next.js 15.3.3 - React framework with App Router
  • React 18.3.1 - UI library
  • TypeScript 5 - Type-safe development

UI & Styling

  • Tailwind CSS 3.4.1 - Utility-first CSS framework
  • Radix UI - Headless UI components
  • Lucide React - Icon library
  • shadcn/ui - Pre-built component library

Mapping & Visualization

  • Leaflet.js 1.9.4 - Interactive maps
  • React-Leaflet 4.2.1 - React bindings for Leaflet
  • Recharts 2.15.1 - Data visualization charts

Forms & Validation

  • React Hook Form 7.54.2 - Form management
  • Zod 3.24.2 - Schema validation
  • Hookform Resolvers - Form validation integration

Development Tools

  • ESLint - Code linting
  • PostCSS - CSS processing
  • Turbopack - Fast bundler for development

πŸ“ Project Structure

Frontend/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/                    # Next.js App Router
β”‚   β”‚   β”œβ”€β”€ analysis/           # Analysis page
β”‚   β”‚   β”œβ”€β”€ filters/            # Interactive map filters
β”‚   β”‚   β”œβ”€β”€ globals.css         # Global styles
β”‚   β”‚   β”œβ”€β”€ layout.tsx          # Root layout
β”‚   β”‚   └── page.tsx            # Home page
β”‚   β”œβ”€β”€ components/             # Reusable components
β”‚   β”‚   β”œβ”€β”€ ui/                 # shadcn/ui components
β”‚   β”‚   β”œβ”€β”€ Header.tsx          # Navigation header
β”‚   β”‚   β”œβ”€β”€ Footer.tsx          # Footer component
β”‚   β”‚   └── InteractiveFilterMap.tsx  # Map component
β”‚   β”œβ”€β”€ hooks/                  # Custom React hooks
β”‚   └── lib/                    # Utility functions
β”œβ”€β”€ public/                     # Static assets
β”‚   └── logo.svg               # Brand logo
β”œβ”€β”€ package.json               # Dependencies
β”œβ”€β”€ tailwind.config.ts         # Tailwind configuration
β”œβ”€β”€ tsconfig.json             # TypeScript configuration
└── next.config.ts            # Next.js configuration

🎯 Available Scripts

Script Description
npm run dev Start development server on port 9002 with Turbopack
npm run build Build production application
npm run start Start production server
npm run lint Run ESLint for code quality
npm run typecheck Type-check TypeScript without emitting

πŸ—ΊοΈ Interactive Maps

Features

  • High Performance: Direct Leaflet imports for fast loading
  • Multiple Layers: Support for various map data layers
  • Advanced Filters: Environmental and site-specific filtering
  • Coordinate Support: Multiple coordinate format handling
  • Responsive Design: Works seamlessly on mobile devices

Usage

// Example coordinate input
const coordinates = {
  latitude: 37.7749,
  longitude: -122.4194,
  dms: "37Β°46'29.6\"N 122Β°25'9.8\"W"
};

🎨 Design System

Color Palette

  • Primary: Stone-800 (#292524)
  • Background: Stone-50/100
  • Text: Stone-900/700
  • Accent: White with subtle shadows

Typography

  • Headers: Bold, responsive sizing (text-lg to text-xl)
  • Body: Regular weight with good contrast
  • Icons: Lucide React with consistent sizing

Layout

  • Header Height: 80px (md:96px)
  • Max Width: 1280px (max-w-7xl)
  • Spacing: Consistent 4/6/8 unit system

πŸ”§ Configuration

Environment Variables

Create a .env.local file:

# Add your environment variables here
NEXT_PUBLIC_API_URL=your_api_url

Tailwind Configuration

The project uses a custom Tailwind configuration with:

  • Extended color palette
  • Custom animations
  • Responsive breakpoints
  • Component-specific utilities

πŸ“± Responsive Design

Breakpoints

  • Mobile: < 640px
  • Tablet: 640px - 1024px
  • Desktop: > 1024px

Features

  • Mobile-first approach
  • Touch-friendly interactions
  • Optimized map controls for mobile
  • Responsive navigation patterns

πŸš€ Performance Optimizations

Implemented Optimizations

  • Direct Leaflet Imports: Eliminates dynamic import overhead
  • Image Optimization: Next.js automatic image optimization
  • Code Splitting: Automatic route-based splitting
  • Static Generation: Pre-rendered pages where possible

Performance Metrics

  • Lighthouse scores: 90+ across all categories
  • First Contentful Paint: < 1.5s
  • Interactive maps load: < 2s

πŸ”’ Best Practices

Code Quality

  • TypeScript for type safety
  • ESLint configuration
  • Consistent naming conventions
  • Component composition patterns

Security

  • Input validation with Zod
  • XSS protection through React
  • Secure localStorage usage
  • Environment variable management

πŸ› Troubleshooting

Common Issues

Map not loading

# Clear browser cache and check console for errors
# Ensure Leaflet CSS is properly imported

Coordinate persistence issues

# Check localStorage in browser DevTools
# Verify coordinate format consistency

Build errors

# Run type checking
npm run typecheck

# Clear Next.js cache
rm -rf .next
npm run build

🀝 Contributing

  1. Fork the repository
  2. Create feature branch (git checkout -b feature/amazing-feature)
  3. Commit changes (git commit -m 'Add amazing feature')
  4. Push to branch (git push origin feature/amazing-feature)
  5. Open Pull Request

Development Guidelines

  • Follow TypeScript best practices
  • Use provided UI components
  • Maintain responsive design principles
  • Add proper error handling
  • Write descriptive commit messages

πŸ“„ License

This project is part of the Site Analysis MVP system.

πŸ“ž Support

For support and questions:

  • Check existing issues
  • Create new issue with detailed description
  • Include browser and OS information

Built with ❀️ using Next.js, TypeScript, and Tailwind CSS

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published