First off, thank you for considering contributing to TSV Ledger! 🎉
It's people like you that make TSV Ledger such a great tool. We welcome contributions of all kinds: bug reports, feature suggestions, documentation improvements, and code contributions.
This guide will help you get started. Don't worry if you're new to open source— we're here to help!
- Code of Conduct
- Architecture Overview
- Quick Start
- Setting Up Your Own Backend
- Development Workflow
- Your First Contribution
- Pull Request Process
- Getting Help
This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to chf3198@gmail.com.
TSV Ledger has a local-first design:
| Component | Description | Required? |
|---|---|---|
| Frontend | Static HTML/CSS/JS served by Pages | Yes |
| LocalStorage | Browser storage for offline mode | Yes |
| Workers API | OAuth + cloud sync (your own deployment) | Optional |
| D1 Database | Cloud data persistence | Optional |
| OAuth Providers | GitHub/Google authentication | Optional |
Key insight: The app works fully offline using localStorage. You only need OAuth and Workers if you're working on authentication or cloud sync features.
For most contributions (UI, import parsers, allocation logic):
# Clone and install
git clone https://github.com/chf3198/tsv-ledger.git
cd tsv-ledger
npm install
# Run tests
npm test
# Start local server
npx serve . -l 3000
# Open http://localhost:3000The app will use localStorage - no authentication required.
If you're working on OAuth, cloud sync, or the Workers API, you'll need your own Cloudflare and OAuth setup. We never share production secrets.
- Create free account at cloudflare.com
- Install Wrangler CLI:
npm install -g wrangler - Login:
wrangler login
cd worker
wrangler d1 create tsv-ledger-db-devCopy the output database_id and update worker/wrangler.toml:
[[d1_databases]]
binding = "DB"
database_name = "tsv-ledger-db-dev"
database_id = "your-database-id-here"Initialize the schema:
wrangler d1 execute tsv-ledger-db-dev --file=schema.sql- Go to GitHub Developer Settings
- Click "New OAuth App"
- Fill in:
- Application name: TSV Ledger Dev
- Homepage URL:
http://localhost:3000 - Callback URL:
https://your-worker.your-subdomain.workers.dev/auth/github/callback
- Save the Client ID and Client Secret
- Go to Google Cloud Console
- Create a new project or select existing
- Click "Create Credentials" → "OAuth client ID"
- Configure consent screen if prompted
- Select "Web application"
- Add authorized redirect URI:
https://your-worker.your-subdomain.workers.dev/auth/google/callback - Save the Client ID and Client Secret
# Copy the example file
cp .env.example .env
# Edit with your values
nano .envSet Workers secrets:
cd worker
wrangler secret put GITHUB_CLIENT_ID
wrangler secret put GITHUB_CLIENT_SECRET
wrangler secret put GOOGLE_CLIENT_ID
wrangler secret put GOOGLE_CLIENT_SECRETcd worker
wrangler deployIn js/auth.js, update the API URL for local development:
// For local development, point to your own worker:
const API_BASE = "https://your-worker.your-subdomain.workers.dev";Note: Don't commit this change! Use it only for local testing.
We follow strict TDD and design-first practices. See AI_AGENT_PROTOCOL.md for the full workflow.
- Read DESIGN.md to understand architecture
- Check existing ADRs in docs/adr/
- Create a feature branch:
git checkout -b feat/your-feature
# Create your test in tests/
# Run to confirm it fails
npm test
# Then implement the feature
# Run again to confirm it passes
npm test- ≤100 lines per file (enforced by
npm run lint) - No external dependencies in frontend code
- E2E tests with Playwright
- Follow STYLE.md
# Must pass
npm test && npm run lint- Ensure all tests pass
- Update CHANGELOG.md under
[Unreleased] - Create PR with clear description
- Reference any related issues
- Wait for review
Use conventional commits:
feat: add expense categorizationfix: correct date parsing for BOA importsdocs: update contributing guidetest: add allocation slider tests
- New bank statement parsers (Chase, Wells Fargo, etc.)
- Accessibility improvements
- Mobile responsiveness
- Performance optimizations
New to the project? Look for issues labeled
good first issue
in GitHub. These are specifically chosen to be approachable for newcomers.
Documentation improvements are always welcome:
- Typo fixes
- Clarifying existing docs
- Adding examples
- Translating documentation
Not sure where to start? Here's a suggested path:
- Star the repo ⭐ — it helps others find the project
- Read the docs — DESIGN.md explains the architecture
- Run the tests —
npm testto see how things work - Find an issue — look for
good first issuelabels - Ask questions — open a Discussion if you're unsure about anything
Check out these resources:
- 💬 GitHub Discussions — Ask questions and discuss ideas
- 🐛 Issues — Report bugs or request features
- 📖 Documentation — Read the design docs and ADRs
Found a security vulnerability? Please do not open a public issue.
Instead, report it privately via GitHub Security Advisories or email chf3198@gmail.com. See SECURITY.md for our full security policy.
Thank you for contributing! 🎉
Every contribution matters, whether it's a typo fix or a major feature. We appreciate you taking the time to help make TSV Ledger better for everyone.