Thank you for your interest in contributing to SmartCard! This document provides guidelines and instructions for contributing.
- Code of Conduct
- Getting Started
- How to Contribute
- Development Setup
- Coding Standards
- Pull Request Process
- Reporting Bugs
- Suggesting Features
This project follows the Contributor Covenant Code of Conduct. By participating, you agree to uphold this code. Please:
- Be respectful and constructive in discussions
- Welcome newcomers and help them get started
- Focus on what is best for the community
- Show empathy towards other community members
Please report unacceptable behavior by opening an issue with the conduct label.
- macOS 14.0 or later
- Xcode 15.0 or later
- iOS 17.0+ simulator or device
- Git
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/SmartCard.git cd SmartCard - Add the upstream repository:
git remote add upstream https://github.com/Rich627/SmartCard.git
| Type | Description |
|---|---|
| Bug Fixes | Fix issues and improve stability |
| Features | Add new functionality |
| Documentation | Improve README, comments, guides |
| Localization | Add/improve translations |
| Tests | Add or improve test coverage |
| UI/UX | Improve design and user experience |
| Card Data | Add new credit card definitions |
Look for issues labeled good first issue - these are great for newcomers!
-
Open the project
open SmartCard.xcodeproj
-
Select a simulator
- Choose iPhone 15 or newer simulator
- Or connect a physical device
-
Build and run
- Press
⌘ + Rto build and run - Press
⌘ + Uto run tests
- Press
SmartCard/
├── App/ # App entry point
├── Models/ # Data models (Card, Spending, etc.)
├── Views/ # SwiftUI views
├── ViewModels/ # State management
├── Services/ # Business logic
└── Utils/ # Helper extensions
- Follow Swift API Design Guidelines
- Use meaningful variable and function names
- Keep functions small and focused
- Add comments for complex logic
// Good: Small, focused views
struct CardRowView: View {
let card: CreditCard
var body: some View {
HStack {
CardIconView(card: card)
CardInfoView(card: card)
}
}
}
// Avoid: Large, monolithic views
struct CardRowView: View {
var body: some View {
// 200+ lines of code...
}
}| Type | Convention | Example |
|---|---|---|
| Types | UpperCamelCase | CreditCard, SpendingCategory |
| Functions | lowerCamelCase | calculateReward(), fetchCards() |
| Variables | lowerCamelCase | selectedCard, totalSpending |
| Constants | lowerCamelCase | maxCards, defaultReward |
// MARK: - Properties
// MARK: - Initialization
// MARK: - Body (for Views)
// MARK: - Private Methods
// MARK: - Static Methods- Code compiles without warnings
- All tests pass (
⌘ + U) - New code has appropriate tests
- Code follows project style guidelines
- Documentation updated if needed
-
Create a feature branch
git checkout -b feature/your-feature-name
-
Make your changes
- Write clean, documented code
- Add tests for new functionality
- Update documentation if needed
-
Commit with clear messages
git commit -m "Add: credit card sorting by reward rate" git commit -m "Fix: rotating category activation bug" git commit -m "Update: README installation instructions"
-
Push and create PR
git push origin feature/your-feature-name
Then open a Pull Request on GitHub.
[Type] Brief description
Types:
- Add: New feature
- Fix: Bug fix
- Update: Enhancement to existing feature
- Remove: Removing code/feature
- Refactor: Code restructuring
- Docs: Documentation only
- Test: Adding tests
- A maintainer will be automatically assigned via CODEOWNERS
- At least 1 maintainer review is required before merging
- All CI checks must pass (build, tests, SwiftLint, scraper validation)
- Address any requested changes and re-request review
- Once approved and CI is green, your PR will be merged
- Check existing issues to avoid duplicates
- Try to reproduce with the latest version
**Description**
A clear description of the bug.
**Steps to Reproduce**
1. Go to '...'
2. Tap on '...'
3. See error
**Expected Behavior**
What should happen.
**Actual Behavior**
What actually happens.
**Screenshots**
If applicable.
**Environment**
- iOS Version:
- Device:
- App Version:**Problem**
What problem does this solve?
**Proposed Solution**
How should it work?
**Alternatives Considered**
Other solutions you've thought about.
**Additional Context**
Mockups, examples, etc.Credit card data is managed through the scraper system in Functions/scraper/.
- Open the appropriate scraper in
Functions/scraper/scrapers/(e.g.,chase.js,amex.js) - Add the card to the
CARDSarray:
{
name: 'Card Name',
annualFee: 0,
rewardType: 'cashback', // 'cashback', 'points', or 'miles'
network: 'visa', // 'visa', 'mastercard', 'amex', 'discover'
baseReward: 1,
categories: [
{ category: 'dining', multiplier: 3, cap: 1500, capPeriod: 'quarterly' }
],
imageURL: 'https://...',
imageColor: '#1A1A1A'
}- Run the scraper and upload:
cd Functions/scraper
npm run full # Scrapes all cards and uploads to Firestore- Create a new scraper file in
Functions/scraper/scrapers/ - Extend
BaseScraperclass (see existing scrapers for examples) - Register it in
Functions/scraper/index.js
- Verify card data accuracy from official issuer websites
- Run
npm run validateto check data format - Test in the iOS app after uploading
Feel free to open an issue with the question label or reach out to the maintainers.
Thank you for contributing!