Skip to content

bklmustapha/codmaker-lifecost

Repository files navigation

LifeCost

Convert money into time of life.

LifeCost is a minimalist mobile app that helps you understand the true cost of purchases by showing how much of your working life each purchase represents.

☕ Coffee ($4) → "23 minutes of your life"


📱 Features

Core

  • Offline-First — No internet required, no data leaves your device
  • Price to Time Calculator — Instantly see how long you work to afford something
  • Shock Mode — Visual emphasis when a purchase costs more than a day of work
  • Shareable Cards — Generate beautiful cards to share your realizations
  • Multi-Currency Support — USD, EUR, GBP, JPY, INR

New Features

  • 📜 History Log — View all your past calculations with date/time stamps
  • ⚖️ Comparison Mode — Compare up to 3 items side by side to find the best value
  • ⏳ Regret Timers — Set cooling-off periods before purchases (1h to 30 days)
    • Track how much money you've saved by skipping impulse purchases
    • Get notified when your timer expires
    • Make more mindful spending decisions

🏗️ Monorepo Structure

lifecost/
├── apps/
│   ├── mobile/          # Expo React Native app (main product)
│   └── web/             # Next.js app (coming soon placeholder)
├── packages/
│   ├── types/           # Shared TypeScript types
│   ├── utils/           # Shared calculation utilities
│   └── ui/              # Shared UI constants
├── turbo.json           # Turborepo config
├── pnpm-workspace.yaml  # PNPM workspace config
└── package.json         # Root package

🚀 Quick Start

Prerequisites

  • Node.js 18+
  • npm 9+ (comes with Node.js)
  • Expo CLI (will be installed locally)
  • iOS Simulator (Mac) or Android Emulator

Installation

# Clone the repository
git clone <your-repo-url>
cd lifecost

# Install dependencies
npm install

# Start the mobile app
npm run dev:mobile

Running on Devices

# iOS Simulator (Mac only)
npm run ios

# Android Emulator
npm run android

# Web (development)
npm run dev:web

📦 Available Scripts

Command Description
npm run dev:mobile Start Expo dev server for mobile
npm run dev:web Start Next.js dev server
npm run ios Run on iOS Simulator
npm run android Run on Android Emulator
npm run build:web Build web app for production
npm run lint Run linters across all packages
npm run clean Clean all build artifacts

🛠️ Tech Stack

Mobile App

  • React Native with Expo SDK 52
  • Expo Router for file-based navigation
  • TypeScript for type safety
  • AsyncStorage for local persistence
  • expo-sharing + react-native-view-shot for share cards

Web App (Scaffold)

  • Next.js 14 with App Router
  • TypeScript
  • Tailwind CSS

Monorepo Tools

  • Turborepo for build orchestration
  • npm Workspaces for package management

📐 How It Works

Calculation Logic

// 1. User provides income and work hours
const monthlyIncome = 5000;  // $5,000/month
const hoursPerWeek = 40;     // 40 hours/week

// 2. Calculate hourly rate
// Monthly: income / (hoursPerWeek × 4.33 weeks)
const hourlyRate = 5000 / (40 × 4.33) = $28.87/hour

// 3. Convert price to time
const coffeePrice = 4;  // $4
const timeMinutes = (4 / 28.87) × 60 = 8.3 minutes

// Result: "8 minutes of your life"

Data Storage

All data is stored locally using AsyncStorage:

interface UserSettings {
  income: number;           // User's income
  incomeType: 'monthly' | 'yearly';
  hoursPerWeek: number;     // Work hours per week
  hourlyRate: number;       // Calculated hourly value
  currency: '$' | '€' | '£' | '¥' | '₹';
  hasOnboarded: boolean;
}

🎨 Design Philosophy

  • Dark Mode First — Easy on the eyes, modern aesthetic
  • Big Numbers — Emotional impact through typography
  • Minimalist — No clutter, no charts, no complexity
  • Philosophical — "Calculator + Philosophy" approach

📸 App Icons

SVG assets are provided in apps/mobile/assets/:

  • icon.svg — Main app icon (1024×1024)
  • adaptive-icon.svg — Android adaptive icon
  • splash-icon.svg — Splash screen icon
  • favicon.svg — Web favicon

To convert to PNG for production builds, use a tool like:


🔒 Privacy

LifeCost is designed with privacy as a core principle:

  • ❌ No backend servers
  • ❌ No authentication
  • ❌ No analytics
  • ❌ No tracking
  • ❌ No network requests
  • ✅ 100% offline operation
  • ✅ All data stays on device

📄 License

MIT License — feel free to use, modify, and distribute.


🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

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

💡 Philosophy

"The price of anything is the amount of life you exchange for it." — Henry David Thoreau

LifeCost turns this philosophy into a practical tool, helping you make more mindful spending decisions by revealing the true cost of purchases in the most precious currency: your time.


Built with ❤️ for mindful spending

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published