Skip to content

Samnan/mobile-expense-tracker

Repository files navigation

Mobile Expense Tracker

A simple, lightweight expense tracking application built with React Native and Expo.

Features

  • Completely offline app (no internet required)
  • 💰 Quick add income and expense transactions
  • 📱 Categorized transactions with icons
  • 📈 Analytics and monthly breakdowns
  • 🔍 Search and filter transactions
  • 💾 Local storage with AsyncStorage
  • 📱 Cross-platform (iOS, Android, Web)

Getting Started

Prerequisites

  • Node.js (v16 or higher)
  • npm or yarn
  • Expo CLI (npm install -g @expo/cli)

Installation

  1. Clone the repository

  2. Install dependencies:

    npm install
  3. Start the development server:

    npm run dev

If you are running expo web, you can use this script to generate seed data for last three months to quickly see app functionality with demo data by running the following script code in your browser console.

scripts/seed.js

Building with capacitor (faster but less optimal build process)

npm install @capacitor/core @capacitor/cli 
npx cap init Expenser dev.expenser.app --web-dir=_build
npx expo export --platform web --output-dir  _build
npm install @capacitor/ios @capacitor/android
npx cap add android
npx cap sync
npx cap open android

Building for Android (hard work and time required)

Quick Start - Choose Your Method:

Method 1: EAS Build (Cloud - Recommended)

# One-time setup
npm run setup:android

# Build in the cloud
npm run build:eas

Method 2: Local Build

# Setup dependencies (one-time)
npm run setup:android

# Build locally (requires Android SDK)
npm run build:android        # macOS/Linux
npm run build:android:windows # Windows

Detailed Build Instructions

Prerequisites Setup:

# Install all required dependencies
./scripts/install-android-deps.sh

EAS Build (Cloud):

  • ✅ No local Android SDK required
  • ✅ Consistent build environment
  • ✅ Automatic signing
  • ✅ Build logs and artifacts stored in cloud
./scripts/build-eas.sh

Local Build:

  • ⚠️ Requires Android SDK and Java 17+
  • ✅ Faster iteration for development
  • ✅ Full control over build process
# macOS/Linux
./scripts/build-android.sh

# Windows
./scripts/build-android.bat

Build Outputs:

  • EAS Build: Download from EAS dashboard or use eas build:list
  • Local Build: APK saved to builds/expense-tracker-release-[timestamp].apk

Available Scripts:

  • npm run setup:android - Install Android development dependencies
  • npm run build:eas - Build using EAS (cloud)
  • npm run build:android - Local build (macOS/Linux)
  • npm run build:android:windows - Local build (Windows)
  • npm run prebuild - Generate native code for all platforms
  • npm run prebuild:android - Generate native code for Android only

Troubleshooting

If you encounter build issues:

  1. Clear cache:

    npx expo start --clear
  2. Reset project:

    rm -rf node_modules
    npm install
  3. Clean Android build:

    cd android
    ./gradlew clean

Project Structure

├── app/                    # App screens and navigation
│   ├── (tabs)/            # Tab-based screens
│   └── _layout.tsx        # Root layout
├── components/            # Reusable components
├── contexts/              # React contexts
├── hooks/                 # Custom hooks
├── types/                 # TypeScript type definitions
├── utils/                 # Utility functions
├── assets/                # Images and static assets
└── scripts/               # Build scripts

Technologies Used

  • React Native - Mobile app framework
  • Expo - Development platform
  • TypeScript - Type safety
  • React Navigation - Navigation
  • AsyncStorage - Local storage
  • Lucide React Native - Icons
  • Expo Linear Gradient - Gradients
  • React Native Reanimated - Animations

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

License

This project is licensed under the MIT License.

About

AI generated light expense tracking app

Resources

Stars

Watchers

Forks

Contributors