Welcome! This guide will help you make your first contribution to Ashfolio in 30 minutes.
Perfect for getting familiar with the codebase:
- Check GitHub Issues labeled "good first issue"
- Look for documentation improvements, typo fixes, or small UI enhancements
- Or fix a typo you notice while exploring the code!
# Fork the repository on GitHub, then:
git clone https://github.com/YOUR_USERNAME/ashfolio.git
cd ashfolio
just dev # This sets everything upgit checkout -b fix/your-improvement-descriptionExamples of great first contributions:
- Fix a typo in documentation
- Improve a comment or error message
- Add a helpful code comment
- Update outdated documentation links
- Improve formatting or styling
just test # Run all tests
just format # Format your code
just check # Run format + compile + testgit add .
git commit -m "fix: improve error message clarity in Account validation"
git push origin fix/your-improvement-descriptionThen open a Pull Request on GitHub with a clear description!
Ready for something more substantial:
Look for features in the project tasks:
- Small UI improvements
- Additional validation
- New helper functions
- Test improvements
# 1. Write a failing test first
just test-file test/path/to/your_test.exs
# 2. Implement the feature
# Edit the relevant files
# 3. Make the test pass
just test-file test/path/to/your_test.exs
# 4. Run all tests to ensure no regressions
just testLet's walk through adding a small feature:
Step 1: Write a failing test (test/ashfolio/portfolio/transaction_test.exs):
test "validates quantity is not zero for BUY transactions" do
attrs = @valid_attrs |> Map.put(:quantity, Decimal.new("0"))
assert {:error, %Ash.Error.Invalid{}} = Transaction.create(attrs)
endjust test-file test/ashfolio/portfolio/transaction_test.exsStep 3: Implement the feature (lib/ashfolio/portfolio/transaction.ex):
validations do
validate validate_quantity_not_zero(:quantity)
end
defp validate_quantity_not_zero(quantity) do
if Decimal.eq?(quantity, 0) do
{:error, "Quantity cannot be zero"}
else
:ok
end
endjust test-file test/ashfolio/portfolio/transaction_test.exs
just test # Ensure no regressionsAshfolio follows specific patterns:
- All business logic in Ash resources
- Always use
Decimalfor monetary values - Use
ErrorHandlerfor consistent messages - Write tests for all new functionality
If your feature changes behavior:
- Update relevant
.mdfiles - Add comments to complex code
- Update the CHANGELOG.md
Before submitting your PR:
-
just testshows all green -
just formatapplied -
just checksucceeds - Explains what and why
- If behavior changed
- You've reviewed your own changes
# Always use Ash resources for business logic
{:ok, user} = User.create(%{name: "New User"})
{:ok, users} = User.list()case Account.create(attrs) do
{:ok, account} ->
# Success path
{:error, error} ->
ErrorHandler.handle_error(error, "Failed to create account")
enddescribe "create/1" do
test "creates account with valid attributes" do
attrs = %{name: "Test Account", platform: "Schwab"}
assert {:ok, %Account{} = account} = Account.create(attrs)
assert account.name == "Test Account"
end
end- Stuck on Ash Framework? Check Ash Documentation
- Phoenix/LiveView Questions? See Phoenix Guides
- Testing Issues? Review Testing Guide
- Architecture Questions? Read Architecture Overview
- General Help? Ask on GitHub Discussions or open an issue
- Even small improvements help
- Shows you understand the codebase
- Consistent with existing code
- Explains the what and why
- Formatted, tested, documented
- Learn from code review comments
- Look for more complex issues
- Review other contributors' PRs
- Share what you learned
- Propose new functionality
Ready to start? Pick an issue and follow the 15-minute quick win process! Need more context? Review the Architecture Overview first.