Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 21 additions & 97 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,106 +1,30 @@
# CONTRIBUTING.md — SwiftPay Contribution Guide
# Contributing to SwiftPay

Welcome to SwiftPay! We're glad you want to contribute. This guide covers everything you need to get started.
Thanks for contributing.

---
## Getting Started

## Prerequisites
1. Fork the repository
2. Clone your fork: git clone https://github.com/YOUR_USERNAME/SwiftPay.git
3. Create a branch: git checkout -b feature/your-feature
4. Make your changes
5. Run tests: pytest
6. Push and open a pull request

- Python 3.10 or higher
- Git
- A GitHub account
## Code Style

---
- Follow PEP 8 for Python code
- Use type hints where possible
- Keep functions small and focused
- Add docstrings for public functions

## Setup Instructions
## Pull Request Guidelines

```bash
# 1. Fork this repository on GitHub, then clone your fork
git clone https://github.com/YOUR_USERNAME/SwiftPay.git
cd SwiftPay
- Link your PR to an open issue
- Keep changes focused � one PR per feature/fix
- Update documentation if needed
- Ensure tests pass before submitting

# 2. Verify Python version
python3 --version # must be 3.10+
## Questions

# 3. No pip install needed — SwiftPay uses stdlib only
# Optionally install pytest for enhanced test output:
pip install pytest pytest-cov

# 4. Run all tests to verify your setup
python3 tests/run_all_tests.py
```

All **41 tests should pass** before you start making changes.

---

## How to Pick an Issue

1. Browse [open issues](../../issues)
2. Look for issues labelled:
- `good-first-issue` — small, well-scoped tasks perfect for new contributors
- `help-wanted` — larger tasks where input is welcome
- `feature-request` — new capabilities (higher impact, more complex)
3. Comment on the issue: *"I'd like to work on this!"* — wait for confirmation before starting to avoid duplicate work
4. Create a branch: `git checkout -b fix-issue-42` or `git checkout -b feature/redis-otp`

---

## Coding Standards

- **Language:** Python 3.10+
- **Style:** Follow PEP 8. Function and variable names in `snake_case`, classes in `PascalCase`
- **Private fields:** Prefix with `_` (e.g. `self._balance`)
- **Type hints:** Use them on all public method signatures
- **Docstrings:** Required on all public classes and methods
- **No external dependencies** for core domain/service/repository code — stdlib only
- External dependencies for API framework (Flask/FastAPI) are acceptable; add to `requirements.txt`

---

## Testing Requirements

- Every new feature must include tests in the `/tests` directory
- Every bug fix must include a test that reproduces the bug before the fix
- Run `python3 tests/run_all_tests.py` — all tests must pass before submitting a PR
- Aim for coverage of happy path + at least 2 edge cases per function

---

## Submitting a Pull Request

1. Ensure all tests pass: `python3 tests/run_all_tests.py`
2. Write a clear PR title: `Fix: Rollback not triggered on gateway timeout` or `Feature: Add OTP expiry endpoint`
3. In the PR description:
- Link the issue: `Closes #42`
- Describe what changed and why
- List any edge cases you tested
4. CI will run automatically — the PR cannot be merged if CI fails
5. A maintainer will review within 2 business days

---

## Project Structure

```
SwiftPay/
├── src/ # Domain models (User, Wallet, Transaction...)
├── repositories/ # Repository interfaces + in-memory implementations
├── services/ # Business logic (UserService, TransactionService...)
├── api/ # REST API (app.py)
├── tests/ # All tests
│ ├── services/
│ └── api/
├── .github/workflows/ # CI/CD pipeline
└── docs/ # OpenAPI specification
```

---

## Code of Conduct

Be respectful. Be constructive. If you disagree with a review comment, explain your reasoning — don't just revert it.

---

*SwiftPay — CONTRIBUTING.md*
Open a discussion or issue for questions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2026 SwiftPay Project
Copyright (c) 2026 SwiftPay

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down