CoFi is a privacy-focused finance tracking application designed for couples. It provides transparency on overall spending while keeping individual transactions private, helping families maintain healthy financial habits through comprehensive analytics and insights.
Managing family finances as a couple is challenging. Existing solutions either force complete transparency (awkward for personal purchases) or complete separation (missing the big picture). CoFi solves this by introducing selective privacy - the first and only spending tracker that lets couples share overall financial trends while keeping individual transactions private.
With CoFi, you can:
- Share monthly spending summaries without revealing every coffee purchase
- Keep surprise gifts or personal expenses truly private
- Maintain financial transparency without sacrificing personal privacy
- Build trust through shared financial goals while respecting individual autonomy
- 🔒 Privacy-First Design: Share overall spending trends while keeping individual transactions private
- 📊 Comprehensive Analytics: Monthly income, spending, and net balance charts
- 👥 Multi-User Support: Designed for couples with individual PIN-based authentication
- 📱 Modern UI: Clean, responsive interface built with React 19 and Tailwind CSS
- 📈 Category Analytics: Track spending by categories with customizable views
- 🔍 Advanced Filtering: Search, sort, and filter transactions with pagination
- 📊 Data Import: CSV import functionality for bulk transaction uploads
- 🎨 Beautiful Charts: Interactive visualizations using Recharts
- Node.js 15+
- pnpm (recommended) or npm/yarn
-
Clone the repository
git clone https://github.com/zackszhu/CoFi.git cd cofi
-
Install dependencies
pnpm install # or npm install
-
Configure the application
- Copy environment variables:
cp .env.example .env.local
- Edit
.env.local
and set your NextAuth.js secret and other required variables - Configure application settings in
cofi.config.yaml
(categories, user settings, etc.)
- Copy environment variables:
-
Initialize the database
pnpm db:init
-
Start the development server
pnpm dev
-
Open your browser Navigate to http://localhost:3000
pnpm dev
- Start development serverpnpm build
- Build for productionpnpm start
- Start production serverpnpm lint
- Run ESLintpnpm db:init
- Initialize database with sample data
- Frontend: Next.js 15, React 19, TypeScript
- Styling: Tailwind CSS, shadcn/ui components
- Database: SQLite with better-sqlite3
- Authentication: NextAuth.js with credentials provider
- Charts: Recharts for data visualization
- State Management: TanStack Query (React Query)
- Build Tool: Next.js built-in tooling
cofi/
├── src/
│ ├── app/ # Next.js App Router
│ │ ├── api/ # API routes
│ │ ├── dashboard/ # Dashboard page
│ │ ├── transactions/ # Transactions management
│ │ └── statistics/ # Analytics and charts
│ ├── components/ # React components
│ ├── lib/ # Utilities and configurations
│ └── hooks/ # Custom React hooks
├── public/ # Static assets
└── prisma/ # Database schema
CoFi uses a simple PIN-based authentication system designed for couples:
- Each user has a unique 4-digit PIN
- Users can change their PIN in User Management
- Transactions can be marked as private (visible only to the creator) or public (visible to both users)
- Monthly Overview: Income, expenses, and net balance
- Category Spending: Track spending by categories
- Trend Analysis: Visualize financial trends over time
- Privacy Controls: Choose what data to share vs keep private
# Using Docker Compose for development
docker-compose -f docker-compose.dev.yml up
# Build and run production container
docker build -t cofi .
docker run -p 3000:3000 cofi
CoFi is designed for self-hosting to keep your financial data private and under your control.
# Build the application
pnpm build
# Start production server
pnpm start
# Build production image
docker build -t cofi .
# Run with persistent volume for database
docker run -d \
-p 3000:3000 \
-v /path/to/data:/app/data \
-e NEXTAUTH_SECRET=your-secret \
--name cofi \
cofi
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
- Built with Next.js and shadcn/ui
- Charts powered by Recharts
- Icons from Lucide React
- Database with SQLite
- 🐛 Bug Reports: GitHub Issues
- 💡 Feature Requests: GitHub Discussions
- 📧 Email: [email protected]
Made with ❤️ for couples who want to build a healthy financial future together.