Skip to content

mzaintariqdev/focustimer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ… FocusTimer

A Pomodoro-style productivity app built with React Native + Expo. Create tasks, run timed focus sessions, track streaks and stats β€” all stored locally on your device with full dark mode support.


πŸ“± Screenshots & Video

app.demo.mp4
WhatsApp Image 2026-06-20 at 5 56 34 PM WhatsApp Image 2026-06-20 at 5 56 34 PM (4) WhatsApp Image 2026-06-20 at 5 56 34 PM (3) WhatsApp Image 2026-06-20 at 5 56 34 PM (2) WhatsApp Image 2026-06-20 at 5 56 34 PM (1) WhatsApp Image 2026-06-20 at 5 56 33 PM WhatsApp Image 2026-06-20 at 5 56 33 PM (5) WhatsApp Image 2026-06-20 at 5 56 33 PM (4) WhatsApp Image 2026-06-20 at 5 56 33 PM (3) WhatsApp Image 2026-06-20 at 5 56 33 PM (2) WhatsApp Image 2026-06-20 at 5 56 33 PM (1) WhatsApp Image 2026-06-20 at 5 56 32 PM WhatsApp Image 2026-06-20 at 5 56 32 PM (2) WhatsApp Image 2026-06-20 at 5 56 32 PM (1) WhatsApp Image 2026-06-20 at 5 56 30 PM WhatsApp Image 2026-06-20 at 5 56 30 PM (1)

Add your screenshots here after final build


✨ Features

πŸ“ Tasks

  • Create, edit and delete focus tasks
  • Mark tasks complete with animated checkbox
  • Filter by All / Active / Done
  • Session count per task
  • Animated card entrance on load
  • Time-based greeting (morning / afternoon / evening)

⏱️ Timer

  • Pomodoro countdown with animated progress ring
  • Duration picker β€” 15 / 25 / 50 min or custom (1–180 min)
  • Pause, Resume and Reset controls
  • Auto 5-minute break mode after each session
  • Background timer β€” stays accurate when app is minimised
  • Haptic feedback on every interaction
  • Push notification when session ends (real APK build only)

πŸ“Š Stats

  • Sessions and minutes tracked today
  • Daily streak counter with motivational banner
  • 7-day bar chart of focus sessions
  • All-time total focus hours and sessions
  • Recent session history list (last 20)
  • Stats update in real time after every session

βš™οΈ Settings

  • Dark mode / Light mode / System theme toggle
  • Persistent theme preference saved to device
  • App info and how-it-works guide

πŸ›  Tech Stack

Layer Technology
Framework React Native 0.74 (Expo SDK 51 managed workflow)
Navigation React Navigation v6 (Bottom Tabs + Stack)
Storage @react-native-async-storage/async-storage
Notifications expo-notifications
Haptics expo-haptics
Theme System React Context API (light / dark / system)
Build Tool EAS Build (Expo Application Services)
Language JavaScript ES2022

πŸ“ Project Structure

FocusTimer/
β”œβ”€β”€ App.js                          # Entry point with providers
β”œβ”€β”€ app.json                        # Expo config + build settings
β”œβ”€β”€ eas.json                        # EAS build profiles
β”œβ”€β”€ assets/
β”‚   β”œβ”€β”€ icon.png                    # App icon (1024Γ—1024)
β”‚   β”œβ”€β”€ notification-icon.png       # Notification icon (white, 96Γ—96)
β”‚   β”œβ”€β”€ splash-icon.png             # Splash screen
β”‚   └── adaptive-icon.png           # Android adaptive icon
└── src/
    β”œβ”€β”€ context/
    β”‚   └── ThemeContext.js         # Dark/light/system theme context
    β”‚   └── TimerContext.js         # Timer context
    β”œβ”€β”€ navigation/
    β”‚   └── RootNavigator.js        # Tab + stack navigation setup
    β”œβ”€β”€ screens/
    β”‚   β”œβ”€β”€ TasksScreen.js          # Task list with filters + animations
    β”‚   β”œβ”€β”€ TimerScreen.js          # Pomodoro timer with progress ring
    β”‚   β”œβ”€β”€ StatsScreen.js          # Session stats + 7-day chart
    β”‚   └── SettingsScreen.js       # Theme toggle + app info
    β”œβ”€β”€ components/
    β”‚   β”œβ”€β”€ TaskCard.js             # Animated task card with edit/delete
    β”‚   β”œβ”€β”€ AddTaskModal.js         # Bottom sheet to add tasks
    β”‚   β”œβ”€β”€ EditTaskModal.js        # Bottom sheet to edit tasks
    β”‚   └── EmptyState.js           # Empty list placeholder
    β”œβ”€β”€ storage/
    β”‚   └── index.js                # All AsyncStorage CRUD helpers
    β”œβ”€β”€ services/
    β”‚   └── notifications.js        # Push notification setup + handlers
    └── theme/
        └── index.js                # Colors, spacing, typography, shadows

πŸš€ Getting Started

Prerequisites

  • Node.js 18+
  • Expo Go app on your Android device
  • Both device and laptop on the same WiFi

Installation

# Clone the repository
git clone https://github.com/yourusername/FocusTimer.git

# Navigate into the project
cd FocusTimer

# Install dependencies
npm install

Run in development (Expo Go)

# Start the development server
npx expo start

# Scan the QR code with Expo Go on your Android phone
# The app hot-reloads every time you save a file

Run on specific platform

# Android only
npx expo start --android

# iOS only
npx expo start --ios

# Web (limited β€” no haptics/notifications)
npx expo start --web

πŸ“¦ Building the APK

We use EAS Build (Expo Application Services) to generate real APK/IPA files. Builds run on Expo's cloud servers β€” no Android Studio or Xcode needed.

First time setup

# Install EAS CLI globally
npm install -g eas-cli

# Login to your Expo account (create one free at expo.dev)
eas login

# Configure EAS for this project (run once)
eas build:configure

Android builds

# Preview build β€” fast, for testing on real device (~68MB)
# Generates a downloadable APK link
eas build -p android --profile preview

# Production build β€” optimised, smaller (~20MB), for Play Store
eas build -p android --profile production

# Check build status / download link
eas build:list

iOS builds

# Preview build β€” requires Apple Developer account ($99/year)
eas build -p ios --profile preview

# Production build β€” for App Store submission
eas build -p ios --profile production

Install APK on Android

After the build finishes EAS gives you a download link. Either:

  • Open the link on your phone browser β†’ download β†’ install
  • Or run: eas build:run -p android (installs via USB)

Note: When installing outside the Play Store, Android will ask to allow installs from unknown sources. Go to Settings β†’ Security β†’ enable it.


πŸ”” Notifications Setup

Notifications require a real device build (not Expo Go). They are already configured β€” just build the APK and they work automatically.

The notification channel is set up in src/services/notifications.js:

  • Channel name: Focus Timer
  • Priority: MAX
  • Vibration pattern: enabled
  • Sound: enabled

For the notification icon, add a white PNG at assets/notification-icon.png (96Γ—96, transparent background) and reference it in app.json:

"plugins": [
  ["expo-notifications", {
    "icon": "./assets/notification-icon.png",
    "color": "#6C63FF"
  }]
]

🧠 Key Technical Decisions

Context API for theming A ThemeContext wraps the entire app providing colors, isDark, and setTheme to every component. Theme preference persists to AsyncStorage so it survives app restarts.

AsyncStorage with typed wrappers All storage logic lives in src/storage/index.js with named exports (getTasks, addTask, editTask, deleteTask, addSession, getStreak etc). Screens never call AsyncStorage directly β€” easy to swap to MMKV later.

Background timer via AppState When the app is backgrounded we record Date.now(). On foreground return we subtract elapsed time from the countdown β€” the timer stays accurate even if the phone locks for 20 minutes.

Task edit syncs sessions When you rename a task, editTask() also updates taskTitle in all stored sessions for that task β€” so Stats always shows the current name.

EAS Build for notifications expo-notifications requires a development build for full Android notification support. Expo Go removed push notification support in SDK 53+. We use eas build --profile preview to generate a real APK with proper notification channels.

πŸ“¦ Dependencies

{
  "expo": "~51.0.0",
  "react": "18.2.0",
  "react-native": "0.74.5",
  "@react-navigation/native": "^6.0.0",
  "@react-navigation/bottom-tabs": "^6.0.0",
  "@react-navigation/stack": "^6.0.0",
  "@react-native-async-storage/async-storage": "^1.0.0",
  "react-native-gesture-handler": "^2.0.0",
  "react-native-screens": "^3.0.0",
  "react-native-safe-area-context": "^4.0.0",
  "expo-haptics": "^13.0.0",
  "expo-notifications": "^0.28.0",
  "expo-device": "^6.0.0",
  "eas-cli": "latest"
}

πŸ‘€ Author

Built by Zain.


πŸ“„ License

MIT β€” free to use and modify.

About

No description or website provided.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors