Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ALMANIFI/SmartMirror

Repository files navigation

Smart Mirror React Native App

A React Native smart mirror application built with Expo and TypeScript. The app is designed to run on tablets/devices in landscape mode and display information like time, weather, calendar events, and news in a mirror-like interface.

🚀 Features

  • ⏰ Real-time Clock Display - Shows current time and date
  • 🌤️ Weather Information - Real-time weather data from OpenWeatherMap API
  • 📅 Calendar & Todo Management - Personal todo list with date selection
  • 📰 News Feed - Latest news from Malaysia (NewsAPI)
  • 👋 Personalized Greeting - Time-based greetings with motivational quotes
  • 🎨 Dark Theme UI - Beautiful glassmorphism design optimized for mirrors
  • 📱 Landscape Orientation - Optimized for tablet/mirror display

🛠️ Tech Stack

  • React Native - Mobile app framework
  • Expo SDK 53 - Development platform
  • TypeScript - Type safety
  • React Hooks - State management
  • React Native Vector Icons - Icon library
  • Expo Linear Gradient - Gradient backgrounds
  • Expo Calendar: Calendar integration

Getting Started

Prerequisites

  • Node.js (v16 or later)
  • npm or yarn
  • Expo CLI
  • Expo Go app on your mobile device

Installation

⚠️ Important: You need to install dependencies first!

  1. Install Prerequisites:

  2. Install Project Dependencies:

    cd d:\Dev\SmartMirror
    npm install
  3. Install Additional Dependencies:

    npm install expo-linear-gradient expo-location expo-calendar expo-font @expo/vector-icons react-native-svg
  4. Start the development server:

    npm start
  5. Run on device: Scan the QR code with Expo Go app on your device

For detailed setup instructions, see SETUP.md

Running the App

  • Start Development Server: npm start
  • Run on Android: npm run android
  • Run on iOS: npm run ios
  • Run on Web: npm run web

Project Structure

src/
├── components/
│   ├── TimeDisplay.tsx      # Clock and date display
│   ├── WeatherWidget.tsx    # Weather information
│   ├── CalendarWidget.tsx   # Calendar events
│   ├── NewsWidget.tsx       # News headlines
│   └── GreetingWidget.tsx   # Greetings and quotes
├── App.tsx                  # Main application component
├── app.json                 # Expo configuration
├── package.json             # Dependencies and scripts
└── tsconfig.json           # TypeScript configuration

Customization

Adding Real API Integration

The app currently uses mock data. To integrate real APIs:

  1. Weather API: Replace mock data in WeatherWidget.tsx with calls to OpenWeatherMap or similar
  2. News API: Update NewsWidget.tsx to fetch from NewsAPI or similar service
  3. Calendar: Use Expo Calendar API to access device calendar events

Styling

The app uses a dark theme with glassmorphism effects. Key styling conventions:

  • Dark backgrounds: #000000, #1a1a1a
  • Glassmorphism: rgba(255, 255, 255, 0.1) backgrounds
  • Text shadows for readability
  • Consistent border radius: 15-20px

Configuration

Expo Configuration (app.json)

  • Orientation: Locked to landscape mode
  • Theme: Dark mode optimized
  • Plugins: Location and Calendar permissions

TypeScript

Strict TypeScript configuration for better code quality and IDE support.

Development

Adding New Widgets

  1. Create a new component in src/components/
  2. Import and add to the main App.tsx
  3. Follow the existing styling patterns
  4. Ensure proper TypeScript typing

Testing

  • Test on actual devices using Expo Go
  • Verify landscape orientation works correctly
  • Test with different screen sizes

Deployment

Building for Production

  1. Configure app signing in app.json
  2. Build using Expo Application Services (EAS):
    eas build --platform android
    eas build --platform ios

Hardware Setup

For actual smart mirror deployment:

  1. Use a tablet or Raspberry Pi with display
  2. Mount behind a two-way mirror
  3. Ensure landscape orientation is locked
  4. Consider always-on display settings

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

License

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

Acknowledgments

  • Expo team for the excellent development platform
  • React Native community for the framework
  • All contributors and maintainers

About

Khai's smart mirror

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published