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.
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.
- Overview
- System Architecture
- Tech Stack
- Features
- Installation
- Setting Up Firebase
- Development
- Production Deployment
- Security Considerations
- Contributing
Để 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.
The application architecture follows a modern client-side approach with Firebase as the backend, featuring advanced natural language processing through multiple AI services.
-
Frontend Layer:
- React application with TypeScript and Vite build system
- Modular components organized by functionality
- Responsive design for all device sizes
-
State Management:
- React Query for server state and optimized data fetching
- Context API for application-wide state sharing
- Local component state for UI interactions
-
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
-
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
-
Security:
- Comprehensive Firebase security rules
- Environment variable configuration
- Protected API key storage
- 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
- Firebase Authentication integration
- Protected routes and user profiles
- Create and manage shared funds
- Add/remove members to funds
- Archive funds
- Fund settings and customization
- Add, edit, delete transactions
- Split expenses among members
- Natural language processing for Vietnamese expense descriptions
- Multiple transaction categorization options
- Smart parsing of expense descriptions
- Support for multiple AI models (Gemini, Llama 3, etc.)
- API key management per fund
- Usage tracking and statistics
- Responsive design for all devices
- Touch-friendly controls
- Optimized input mechanisms for mobile
- Node.js 18+ or Bun
- Firebase account
- (Optional) AI service API keys (Google, OpenAI, Groq)
- Clone the repository
git clone https://github.com/quochung-cyou/FundFlow.git
- Install dependencies
npm install
# or with Bun
bun install- Create environment file
cp .env.example .env- Update the
.envfile with your Firebase and API credentials
-
Create a new Firebase project at Firebase Console
-
Enable Authentication services
- Go to Authentication > Sign-in method
- Enable Email/Password and Google providers
-
Set up Firestore database
- Create a Firestore database in production mode
- Set up initial security rules
-
Update your Firebase configuration
- Create
src/firebase/config.tswith your Firebase project credentials (use.envvariables)
- Create
// 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;- Deploy Firebase rules
npm run deploy-rulesnpm run dev
# or with Bun
bun run devThis will start the development server at http://localhost:5173
- Build the application
npm run build
# or with Bun
bun run build- Deploy to Firebase Hosting
firebase deploy-
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.envimmediately
-
Firebase Security Rules
- Review and update the Firestore security rules in
firestore.rules - Ensure proper access control for all collections
- Review and update the Firestore security rules in
-
API Key Management
- The application supports storing API keys in Firestore
- Ensure only authorized users can access these keys
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request








