Skip to content

lekhanpro/spendwisev2

Repository files navigation

πŸ’° SpendWise

A comprehensive money management platform built with React Native (Expo) and Firebase.

GitHub release License Platform CI

πŸ“₯ Download

πŸ“± Download Android App (APK) - Get the latest release

🌐 Use Web App - Access the app directly in your browser

πŸ“– Documentation

πŸ€– CodeWiki - AI-powered codebase documentation - View complete documentation


πŸ“– Overview

SpendWise helps you take control of your finances by tracking income and expenses, managing budgets, setting savings goals, and getting AI-powered insights. The app features personalized recommendations powered by Groq's LLaMA 3.3 70B model.


✨ Features

πŸ’³ Core Features

  • Smart Dashboard: View balance, weekly spending charts, and recent transactions
  • Transaction Tracking: Add income/expenses with categories, payment methods, and notes
  • Budget Management: Set spending limits by category with visual progress tracking
  • Savings Goals: Create goals with deadlines and priority levels

πŸ€– AI Features

  • Financial Health Score: AI-calculated score from 0-100 based on your habits
  • Personalized Insights: Get success, warning, and tip messages about your finances
  • Smart Recommendations: Actionable advice tailored to your spending patterns
  • Weekly AI Summaries: Automated analysis every Monday morning

πŸ“Š Analytics Features

  • Visual Reports: Pie charts for category breakdown, bar charts for daily spending
  • Time Range Selection: View weekly, monthly, or yearly analytics
  • Spending Trends: Understand patterns in your financial behavior

πŸ”” Notification Features

  • Budget Alerts: Get notified at 80% and 100% of budget limits
  • Daily Reminders: Optional reminder to log expenses at 8 PM
  • Weekly Insights: AI summary notifications every Monday

πŸ› οΈ Additional Features

  • Multi-Currency Support: USD, EUR, GBP, INR, and more
  • Dark/Light Theme: Automatic system theme support
  • Cloud Sync: Real-time data sync across devices with Firebase
  • Offline Support: Works offline with automatic sync when online
  • Web App Support: Access via browser with responsive design

πŸ› οΈ Tech Stack

Frontend (Mobile App)

Technology Purpose
React Native 0.76 Cross-platform mobile framework
Expo SDK 52 Development and build tooling
Expo Router File-based navigation
TypeScript Type-safe development
React Context State management
react-native-chart-kit Data visualization
Expo Notifications Push notifications

Backend Services

Service Purpose
Firebase Auth User authentication
Firebase Realtime DB Data storage & sync
Groq API AI insights (LLaMA 3.3 70B)

Build & Deploy

Service Purpose
EAS Build Cloud APK/AAB builds
GitHub Actions CI/CD automation
GitHub Pages Documentation hosting
Vercel Web app hosting

πŸ“ Project Structure

spendwise-native/
β”œβ”€β”€ app/                          # Expo Router screens
β”‚   β”œβ”€β”€ (auth)/                   # Authentication screens
β”‚   β”‚   β”œβ”€β”€ _layout.tsx           # Auth stack layout
β”‚   β”‚   └── login.tsx             # Login/Register
β”‚   β”œβ”€β”€ (tabs)/                   # Main tab screens
β”‚   β”‚   β”œβ”€β”€ _layout.tsx           # Tab navigator (7 tabs)
β”‚   β”‚   β”œβ”€β”€ index.tsx             # Dashboard
β”‚   β”‚   β”œβ”€β”€ transactions.tsx      # Transaction list
β”‚   β”‚   β”œβ”€β”€ insights.tsx          # AI Insights
β”‚   β”‚   β”œβ”€β”€ reports.tsx           # Charts & analytics
β”‚   β”‚   β”œβ”€β”€ budget.tsx            # Budget management
β”‚   β”‚   β”œβ”€β”€ goals.tsx             # Savings goals
β”‚   β”‚   └── settings.tsx          # App settings
β”‚   └── _layout.tsx               # Root layout
β”œβ”€β”€ lib/                          # Service modules
β”‚   β”œβ”€β”€ firebase.ts               # Firebase config
β”‚   β”œβ”€β”€ auth.ts                   # Auth helpers
β”‚   β”œβ”€β”€ database.ts               # DB operations
β”‚   β”œβ”€β”€ ai.ts                     # Groq AI integration
β”‚   └── notifications.ts          # Notifications
β”œβ”€β”€ context/
β”‚   └── AppContext.tsx            # Global state
β”œβ”€β”€ types/
β”‚   └── index.ts                  # TypeScript interfaces
β”œβ”€β”€ constants/
β”‚   └── app.ts                    # Categories, colors
β”œβ”€β”€ docs/                         # GitHub Pages site
β”œβ”€β”€ .github/workflows/            # CI/CD
β”‚   β”œβ”€β”€ build-android.yml         # EAS Build
β”‚   └── pages.yml                 # Pages deploy
β”œβ”€β”€ app.json                      # Expo config
β”œβ”€β”€ eas.json                      # EAS Build profiles
└── package.json                  # Dependencies

πŸš€ Installation

Prerequisites

  • Node.js 18+
  • npm or yarn
  • Expo CLI (npm install -g expo-cli)
  • EAS CLI (npm install -g eas-cli)

Setup

# Clone the repository
git clone https://github.com/lekhanpro/spendwisev2.git
cd spendwisev2

# Install dependencies
npm install

# Create environment file
cp .env.example .env
# Edit .env and add your GROQ API key

# Start development server
npm start

Building for Production

# Login to EAS
npx eas-cli login

# Build APK (for testing)
npx eas-cli build --platform android --profile preview

# Build AAB (for Play Store)
npx eas-cli build --platform android --profile production

πŸ”§ Environment Variables

Variable Description Required
EXPO_PUBLIC_GROQ_API_KEY Groq API key for AI insights βœ… Yes

Local Development

Create a .env file in the project root:

EXPO_PUBLIC_GROQ_API_KEY=gsk_your_api_key_here

Production (EAS)

npx eas-cli secret:create --name EXPO_PUBLIC_GROQ_API_KEY --value gsk_your_key

πŸ—„οΈ Database Schema

Firebase Realtime Database Structure

/users/{userId}/
β”‚
β”œβ”€β”€ transactions/{transactionId}
β”‚   β”œβ”€β”€ id: string
β”‚   β”œβ”€β”€ type: "income" | "expense"
β”‚   β”œβ”€β”€ amount: number
β”‚   β”œβ”€β”€ category: string
β”‚   β”œβ”€β”€ date: timestamp
β”‚   β”œβ”€β”€ note: string
β”‚   └── paymentMethod: string
β”‚
β”œβ”€β”€ budgets/{budgetId}
β”‚   β”œβ”€β”€ id: string
β”‚   β”œβ”€β”€ category: string
β”‚   β”œβ”€β”€ limit: number
β”‚   └── period: "daily" | "weekly" | "monthly" | "yearly"
β”‚
β”œβ”€β”€ goals/{goalId}
β”‚   β”œβ”€β”€ id: string
β”‚   β”œβ”€β”€ name: string
β”‚   β”œβ”€β”€ targetAmount: number
β”‚   β”œβ”€β”€ currentAmount: number
β”‚   β”œβ”€β”€ deadline: timestamp
β”‚   └── priority: "low" | "medium" | "high"
β”‚
└── settings/
    β”œβ”€β”€ currency: { code, symbol, name }
    └── darkMode: boolean

πŸ”Œ API Endpoints

Groq AI API

Method Endpoint Description
POST api.groq.com/openai/v1/chat/completions Generate financial insights

Firebase Services

Service Operations
Auth signUp, signIn, logout, resetPassword
Database CRUD for transactions, budgets, goals, settings
Real-time Subscribe to data changes with onValue()

πŸ“± Key Services

authService (lib/auth.ts)

signUp(email, password): Promise<User>
signIn(email, password): Promise<User>
logout(): Promise<void>
resetPassword(email): Promise<void>

databaseService (lib/database.ts)

saveTransaction(userId, transaction): Promise<void>
saveBudget(userId, budget): Promise<void>
saveGoal(userId, goal): Promise<void>
subscribeToTransactions(userId, callback): Unsubscribe
subscribeToBudgets(userId, callback): Unsubscribe
subscribeToGoals(userId, callback): Unsubscribe

aiService (lib/ai.ts)

getFinancialInsights(transactions, budgets, goals, currency): Promise<AIInsightResponse>
getQuickTip(): string

notificationService (lib/notifications.ts)

requestNotificationPermission(): Promise<boolean>
sendNotification(title, body, data?): Promise<void>
sendBudgetAlert(category, percentage): Promise<void>
scheduleDailyReminder(hour, minute): Promise<void>
scheduleWeeklySummary(): Promise<void>

πŸ”” Push Notifications

Notification Types

Type Trigger Channel
Budget Alert 80% or 100% budget used budget-alerts (HIGH)
Daily Reminder 8:00 PM daily default
Weekly Summary Monday 9:00 AM insights

πŸ‘¨β€πŸ’» Development Team

Name Role GitHub
Lekhan Full Stack Developer @lekhanpro

🀝 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/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“„ License

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


πŸ’¬ Support


Made with ❀️ by Lekhan