Skip to content

A modern, responsive world clock application built with React, TypeScript, and Vite. Features real-time updates, day/night indicators, and an intuitive interface for tracking time across multiple cities and time zones.

License

Notifications You must be signed in to change notification settings

hugomrvt/mrvt-timespot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ•š TimeSpot - World Clock Application

React TypeScript Vite License

A modern, responsive world clock application built with React, TypeScript, and Vite. Features real-time updates, day/night indicators, and an intuitive interface for tracking time across multiple cities and time zones.

πŸ“Έ Screenshots

TimeSpot App Screenshot

✨ Features

  • πŸ• Real-time Clock Display - Live updates for multiple time zones
  • πŸŒ… Day/Night Indicators - Visual cues based on local sunrise/sunset times
  • πŸ” City Search & Selection - Easy-to-use search functionality
  • πŸ“± Responsive Design - Optimized for mobile, tablet, and desktop
  • 🎨 Adaptive Typography - Dynamic text sizing based on available space
  • ⚑ Fast Performance - Built with Vite for lightning-fast development and builds
  • πŸ§ͺ TypeScript Support - Full type safety throughout the application
  • 🎯 Accessible UI - WCAG compliant interface

πŸš€ Quick Start

Prerequisites

  • Node.js 18.0 or higher
  • npm 9.0 or higher (or yarn/pnpm)

Installation

  1. Clone the repository

    git clone https://github.com/hugomrvt/mrvt-timespot.git
    cd mrvt-timespot
  2. Install dependencies

    npm install
  3. Start the development server

    npm run dev
  4. Open your browser

    Navigate to http://localhost:3000 (or the port shown in your terminal)

πŸ“‹ Table of Contents

πŸ“œ Scripts

Command Description
npm run dev Start development server with hot reload
npm run build Create production build
npm run preview Preview production build locally
npm run typecheck Run TypeScript type checking
npm run lint Run ESLint with error reporting
npm run format Format code with Prettier

πŸ“ Project Structure

src/
β”œβ”€β”€ components/          # React components organized by feature
β”‚   β”œβ”€β”€ layout/         # Layout components
β”‚   β”‚   β”œβ”€β”€ Header.tsx
β”‚   β”‚   β”œβ”€β”€ AppHeader.tsx
β”‚   β”‚   β”œβ”€β”€ ResponsiveAppHeader.tsx
β”‚   β”‚   └── MobileNavigation.tsx
β”‚   β”œβ”€β”€ time/           # Time-related components
β”‚   β”‚   β”œβ”€β”€ PrimaryTimeDisplay.tsx
β”‚   β”‚   β”œβ”€β”€ ResponsivePrimaryTimeDisplay.tsx
β”‚   β”‚   β”œβ”€β”€ TimeZoneCard.tsx
β”‚   β”‚   β”œβ”€β”€ ResponsiveTimeZoneGrid.tsx
β”‚   β”‚   └── TimeFormatToggle.tsx
β”‚   β”œβ”€β”€ city/           # City information components
β”‚   β”‚   β”œβ”€β”€ CityInfoSection.tsx
β”‚   β”‚   └── ResponsiveCityInfoSection.tsx
β”‚   β”œβ”€β”€ common/         # Shared/common components
β”‚   β”‚   β”œβ”€β”€ AdaptiveText.tsx
β”‚   β”‚   β”œβ”€β”€ ApiDataMonitor.tsx
β”‚   β”‚   β”œβ”€β”€ Credits.tsx
β”‚   β”‚   β”œβ”€β”€ StatusNotification.tsx
β”‚   β”‚   └── TimeSpotIcon.tsx
β”‚   └── ui/             # UI library components (shadcn/ui)
β”œβ”€β”€ hooks/              # Custom React hooks
β”‚   β”œβ”€β”€ useTimeZoneData.ts
β”‚   β”œβ”€β”€ useSunData.ts
β”‚   β”œβ”€β”€ useAdaptiveTextSize.ts
β”‚   β”œβ”€β”€ useBreakpoint.ts
β”‚   β”œβ”€β”€ useRealTimeUpdates.ts
β”‚   β”œβ”€β”€ useServerConnection.ts
β”‚   β”œβ”€β”€ useTouchDevice.ts
β”‚   └── useUserPreferences.ts
β”œβ”€β”€ lib/                # Library code
β”‚   β”œβ”€β”€ api/            # API services
β”‚   β”‚   β”œβ”€β”€ localTimeApi.ts
β”‚   β”‚   └── supabaseTimeApi.ts
β”‚   └── utils/          # Utility functions
β”‚       β”œβ”€β”€ timezoneUtils.ts
β”‚       β”œβ”€β”€ secureLogger.ts
β”‚       └── validation.ts
β”œβ”€β”€ pages/              # Page components
β”‚   └── Frame6.tsx
β”œβ”€β”€ types/              # TypeScript type definitions
β”‚   └── index.ts
β”œβ”€β”€ constants/          # Application constants
β”‚   └── timezones.ts
β”œβ”€β”€ styles/             # Global styles
β”‚   └── globals.css
β”œβ”€β”€ App.tsx             # Main application component
└── main.tsx            # Application entry point

πŸ—οΈ Architecture

TimeSpot follows a modular, hook-based architecture with a local data service:

Core Components

  • ResponsivePrimaryTimeDisplay: Main time display with adaptive sizing
  • ResponsiveTimeZoneGrid: Grid layout for multiple time zones
  • TimeZoneCard: Individual time zone display cards

Custom Hooks

  • useTimeZoneData: Manages time zone information and real-time updates
  • useSunData: Provides sunrise/sunset data from local cache
  • useAdaptiveTextSize: Dynamic font sizing based on container width
  • useBreakpoint: Responsive design breakpoint detection

🌐 Environment Variables

No environment variables are required by default. Everything works locally with the bundled JSON data and localStorage.

πŸš€ Deployment

Static Hosting

  1. Build the application

    npm run build
  2. Deploy the dist/ folder to your preferred hosting platform:

Server Functions

None required.

🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Workflow

  1. Fork the repository
  2. Create a feature branch
    git checkout -b feature/amazing-feature
  3. Make your changes
  4. Run quality checks
    npm run typecheck && npm run lint && npm run format
  5. Commit your changes
    git commit -m 'feat: add amazing feature'
  6. Push to your branch
    git push origin feature/amazing-feature
  7. Open a Pull Request

Commit Convention

We follow Conventional Commits:

  • feat: - New features
  • fix: - Bug fixes
  • docs: - Documentation changes
  • style: - Code style changes
  • refactor: - Code refactoring
  • test: - Adding tests
  • chore: - Maintenance tasks

πŸ› οΈ Tech Stack

Frontend

  • React 18 - Modern React with concurrent features
  • TypeScript - Type-safe JavaScript
  • Vite - Next-generation frontend tooling

Development Tools

🎨 Design Credits

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


⭐ Star this repository if you find it helpful!

Made with Figma Make & Trae by Hugo Mourlevat

About

A modern, responsive world clock application built with React, TypeScript, and Vite. Features real-time updates, day/night indicators, and an intuitive interface for tracking time across multiple cities and time zones.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages