Skip to content

quochung-cyou/DeTuiTra

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

29 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Để Tui TrαΊ£

Pain Point

Vietnamese

Trong nhα»―ng lαΊ§n Δ‘i Δƒn, Δ‘i chΖ‘i chung cΓΉng bαΊ‘n bΓ¨, Δ‘α»“ng nghiệp, mα»™t trong nhα»―ng vαΊ₯n đề mΓ  mΓ¬nh hay gαΊ·p lΓ  liΓͺn tα»₯c phαΊ£i lΖ°u lαΊ‘i việc mọi người nợ nhau bao nhiΓͺu tiền, vΓ­ dα»₯ tαΊ‘t qua 1 quΓ‘n kem, Δ‘i qua 1 hΓ ng Δƒn, vΓ  thường sαΊ½ cΓ³ 1 người Δ‘α»©ng ra trαΊ£ tiền, sau Δ‘Γ³ người nΓ y nợ người kia, người kia lαΊ‘i nợ người nΓ y, ....

Tα»« nhα»―ng giαΊ£i phΓ‘p nhΖ° lΖ°u trα»― bαΊ±ng tin nhαΊ―n, rα»“i ghi chΓΊ lαΊ‘i. MΓ¬nh Δ‘Γ£ lΓ m ra 1 sαΊ£n phαΊ©m vα»›i mα»₯c tiΓͺu chΓ­nh lΓ  giΓΊp lΖ°u trα»― lαΊ‘i nhα»―ng thΓ΄ng tin chuyển khoαΊ£n, vα»›i 1 sα»‘ Δ‘iểm hα»— trợ sau

  • TαΊ­p trung cαΊ£i thiện UI/UX để việc tαΊ‘o giao dα»‹ch trở lΓͺn nhanh chΓ³ng, rαΊ₯t Γ­t nΓΊt vΓ  mΓ n hΓ¬nh
  • CΓ³ A.I Hα»— trợ để cΓ³ thể nhαΊ­p cΓ‘c ghi chΓΊ phα»©c tαΊ‘p nhΖ° "SΓ‘ng, HΖ°ng chia tiền cαΊ£ nhΓ³m 600k, trΖ°a Linh trαΊ£ tiền Δƒn 60k, chiều Quα»³nh trαΊ£ cho HΖ°ng, Minh 100k , ...." vΓ  A.I sαΊ½ tΓ­nh toΓ‘n kαΊΏt quαΊ£ cuα»‘i ai nợ ai bao nhiΓͺu.
  • Hα»— trợ chuyển Δ‘α»•i ngoαΊ‘i tệ ngay trΓͺn app, hα»— trợ cho du lα»‹ch nΖ°α»›c ngoΓ i
  • KhΓ΄ng cΓ³ tΓ­ch hợp vα»›i cα»•ng thanh toΓ‘n nΓ o cαΊ£, Δ‘iều nΓ y khΓ‘c vα»›i cΓ‘c app thanh toΓ‘n nhΖ° MoMo, Quα»Ή chia tiền khΓ‘c, ... nΖ‘i mΓ  chΓΊng mΓ¬nh sαΊ½ phαΊ£i tαΊ‘o tΓ i khoαΊ£n trΓͺn nền tαΊ£ng, rα»“i phαΊ£i nαΊ‘p tiền vΓ o nền tαΊ£ng Δ‘Γ³, ... vΓ  bα»‹ gαΊ―n chαΊ·t vα»›i nền tαΊ£ng. Hệ thα»‘ng sαΊ½ cho phΓ©p bαΊ‘n Δ‘Δƒng kΓ­ STK NgΓ’n HΓ ng/ NgΓ’n hΓ ng cα»§a bαΊ£n thΓ’n, vΓ  chỉ lΖ°u trα»― ,khi trαΊ£ tiền ai thΓ¬ hệ thα»‘ng hiển thα»‹ QR người kia để nhanh chΓ³ng chuyển tiền.

English

In group outings, one common issue is keeping track of who owes what to whom, especially when multiple people are involved in paying for shared expenses. This often leads to confusion and the need for meticulous record-keeping.

To address this, I've developed a product aimed at simplifying the process of recording and managing these transactions, with several key features:

  • Focus on improving UI/UX for quick transaction creation with minimal buttons and screens.
  • AI support for parsing complex notes like "In the morning, Hung paid 600k for the group, in the afternoon, Linh paid 60k for lunch, and in the evening, Quynh paid 100k to Hung and Minh." The AI will calculate the final balances between users.
  • Support for currency conversion within the app, catering to international travel needs.
  • No integration with any payment gateways, unlike other payment apps (e.g., MoMo, shared funds), which require users to create accounts and deposit money into the platform. Instead, our system allows users to register their own bank accounts and only stores transaction information. When settling debts, the system displays the QR code of the recipient for quick payments.

Demo Image

alt text alt text

alt text alt text alt text

alt text alt text alt text

πŸ“‹ Table of Contents

🌐 Overview

Để Tui TrαΊ£ Style is a responsive web application designed to simplify shared expense management. It enables users to create funds for different groups, add members, track transactions, and automatically calculate balances with support for Vietnamese language processing.

The application solves the common problem of tracking "who owes who" in shared expenses scenarios, with particular optimization for Vietnamese language patterns when describing expense splits.

πŸ—οΈ Overview Architecture

alt text

The application architecture follows a modern client-side approach with Firebase as the backend, featuring advanced natural language processing through multiple AI services.

Architectural Layers

  1. Frontend Layer:

    • React application with TypeScript and Vite build system
    • Modular components organized by functionality
    • Responsive design for all device sizes
  2. State Management:

    • React Query for server state and optimized data fetching
    • Context API for application-wide state sharing
    • Local component state for UI interactions
  3. Backend Services:

    • Firebase Authentication for secure user management
    • Firestore for real-time NoSQL database storage
    • Firebase Storage for files and attachments
    • Robust security rules enforcing access controls
  4. AI Integration:

    • Multiple AI service providers (Google, OpenAI, Groq)
    • Natural language processing optimized for Vietnamese
    • API key management at the fund level for team sharing
    • Usage tracking and statistics
  5. Security:

    • Comprehensive Firebase security rules
    • Environment variable configuration
    • Protected API key storage

πŸ› οΈ Tech Stack

  • Frontend Framework: React 18 with TypeScript
  • Routing: React Router 6
  • State Management: React Query, React Context API
  • UI Components: ShadcnUI, Radix UI, Tailwind CSS
  • Build Tool: Vite
  • Backend: Firebase (Authentication, Firestore, Security Rules)
  • External APIs: Google AI, OpenAI, Groq
  • Package Manager: npm/bun

✨ Features

Authentication & User Management

  • Firebase Authentication integration
  • Protected routes and user profiles

Fund Management

  • Create and manage shared funds
  • Add/remove members to funds
  • Archive funds
  • Fund settings and customization

Transaction Tracking

  • Add, edit, delete transactions
  • Split expenses among members
  • Natural language processing for Vietnamese expense descriptions
  • Multiple transaction categorization options

AI Integration

  • Smart parsing of expense descriptions
  • Support for multiple AI models (Gemini, Llama 3, etc.)
  • API key management per fund
  • Usage tracking and statistics

Mobile Optimization

  • Responsive design for all devices
  • Touch-friendly controls
  • Optimized input mechanisms for mobile

πŸš€ Installation

Prerequisites

  • Node.js 18+ or Bun
  • Firebase account
  • (Optional) AI service API keys (Google, OpenAI, Groq)

Setup

  1. Clone the repository
git clone https://github.com/quochung-cyou/FundFlow.git
  1. Install dependencies
npm install
# or with Bun
bun install
  1. Create environment file
cp .env.example .env
  1. Update the .env file with your Firebase and API credentials

πŸ”₯ Setting Up Firebase

  1. Create a new Firebase project at Firebase Console

  2. Enable Authentication services

    • Go to Authentication > Sign-in method
    • Enable Email/Password and Google providers
  3. Set up Firestore database

    • Create a Firestore database in production mode
    • Set up initial security rules
  4. Update your Firebase configuration

    • Create src/firebase/config.ts with your Firebase project credentials (use .env variables)
// Import the functions you need from the SDKs you need
import { initializeApp } from "firebase/app";
import { getAuth } from "firebase/auth";
import { getAnalytics } from "firebase/analytics";
import { getFirestore } from "firebase/firestore";

// Your web app's Firebase configuration
const firebaseConfig = {
  apiKey: import.meta.env.VITE_FIREBASE_API_KEY,
  authDomain: import.meta.env.VITE_FIREBASE_AUTH_DOMAIN,
  projectId: import.meta.env.VITE_FIREBASE_PROJECT_ID,
  storageBucket: import.meta.env.VITE_FIREBASE_STORAGE_BUCKET,
  messagingSenderId: import.meta.env.VITE_FIREBASE_MESSAGING_SENDER_ID,
  appId: import.meta.env.VITE_FIREBASE_APP_ID,
  measurementId: import.meta.env.VITE_FIREBASE_MEASUREMENT_ID
};

// Initialize Firebase
const app = initializeApp(firebaseConfig);
export const auth = getAuth(app);
export const analytics = getAnalytics(app);
export const db = getFirestore(app);
export default app;
  1. Deploy Firebase rules
npm run deploy-rules

πŸ§ͺ Development

npm run dev
# or with Bun
bun run dev

This will start the development server at http://localhost:5173

πŸ“¦ Production Deployment

  1. Build the application
npm run build
# or with Bun
bun run build
  1. Deploy to Firebase Hosting
firebase deploy

πŸ”’ Security Considerations

Important Security Notes

  1. API Keys Protection

    • DO NOT commit API keys directly in source code
    • Use environment variables for all sensitive credentials
    • If you found hardcoded API keys in config.ts, move them to .env immediately
  2. Firebase Security Rules

    • Review and update the Firestore security rules in firestore.rules
    • Ensure proper access control for all collections
  3. API Key Management

    • The application supports storing API keys in Firestore
    • Ensure only authorized users can access these keys

🀝 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 some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

About

A simple app to track group expenses and debts with a focus on fast UI/UX, AI-powered note parsing (e.g. 'Hung paid 600k for breakfast, B paid 60k for lunch...'), currency conversion for travel, and QR-based transfers without locking users into third-party payment platforms.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors