Contributing
We’re thrilled you’re interested in helping improve lomi. Whether you’re fixing bugs, adding new features, improving the documentation, or reporting issues, your contributions are valuable and we are grateful for your help.
This section provides guidelines and best practices to help you get started with contributing to the lomi. project.
How to contribute
There are many ways to contribute:
- Reporting bugs: If you find a bug, please report it on GitHub Issues.
- Suggesting enhancements: Have an idea for a new feature or improvement? Share it via GitHub Issues.
- Writing code: Contribute directly to the codebase by fixing bugs or implementing new features. See the Getting Started guide.
- Improving the docs: Help us make our documentation clearer and more comprehensive.
- Community support: Answer questions and help other users in the Discord community.
Links
Before you start, please familiarize yourself with these important documents:
- Code of Conduct: Our expectations for behavior within the community.
- Contributing guidelines: Detailed steps for contributing code and documentation.
- Branching strategy: How we manage branches for development and releases.
We appreciate your interest and look forward to hearing from you!
Getting Started
Ready to make your first contribution to lomi.? This guide will walk you through finding an issue, setting up your development environment, making changes, and submitting them.
Prerequisites
Before you begin, ensure you have the following installed:
- Git: For version control.
- Node.js: We recommend the latest LTS version.
- bun: Our preferred package manager for managing dependencies in the monorepo.
Find an issue to work on (optional, but recommended)
Before diving into code, it’s helpful to find an existing issue or propose a new one:
- Browse open issues on the main repository.
- Look for issues tagged with
good first issue
if you’re new. - If you have a new idea or bug fix, consider creating a new issue to discuss it first.
- Don’t hesitate to ask questions in the issue comments if anything is unclear.
Fork the repository
Start by forking the main lomi. repository on GitHub:
- Go to the lomi. repository.
- Give us a star !
- Click the “Fork” button in the top-right corner.
Clone your fork
Clone your forked repository to your local machine:
git clone https://github.com/beloved_anon/lomi.git
cd lomi.
Replace <beloved_anon>
with your real GitHub username.
Set upstream remote
Add the original lomi. repository as the upstream
remote. This allows you to keep your fork synchronized with the main project.
git remote add upstream https://github.com/lomiafrica/lomi./
Verify the remotes:
git remote -v
# origin https://github.com/<YOUR_USERNAME>/lomi./ (fetch)
# origin https://github.com/<YOUR_USERNAME>/lomi./ (push)
# upstream https://github.com/lomiafrica/lomi./ (fetch)
# upstream https://github.com/lomiafrica/lomi./ (push)
Install dependencies & set up environment
Install the project dependencies using bun
from the root of the monorepo:
bun install
Set up your local environment variables by copying the example file:
cp .env.example .env
# Review the .env file and add any necessary secrets or configurations
Local development commands
Here are some common commands you’ll use during development:
# Start the main development server (specific app may vary)
# Check the package.json in the specific app/package directory
bun run dev
# Build and serve the documentation site locally
bun run docs:dev
# Run linting checks across the project
bun run lint
# Run linters and automatically fix issues
bun run lint:fix
Create a branch
Before making changes, create a new branch based on the develop
branch. Follow our Branching strategy for naming conventions.
# Fetch the latest changes from upstream
git fetch upstream
# Check out the develop branch
git checkout develop
# Pull the latest changes for develop
git pull upstream develop
# Create your feature or bugfix branch
git checkout -b <BRANCH_TYPE>/<SHORT_DESCRIPTION>
# Example: git checkout -b feature/add-cool-new-thing
# Example: git checkout -b fix/resolve-that-bug
Make your changes
Now you can start making your code or documentation changes within the appropriate package or app in the packages/
or apps/
directory.
- Code changes: Write your code, ensuring it adheres to our Code standards and Best practices.
- Documentation changes: Update or add documentation in the relevant
apps/developers/src/pages/docs/
directory. Use Markdown (.mdx
).
Keep your branch updated:
Periodically, keep your branch up-to-date with the latest changes from the upstream develop
branch:
# Fetch the latest changes from upstream
git fetch upstream
# Rebase your branch onto the latest develop branch
# Make sure you have committed or stashed your local changes first!
git rebase upstream/develop
# You might need to resolve conflicts during the rebase process.
# After resolving conflicts: git add . ; git rebase --continue
# If you get stuck: git rebase --abort
Test your changes
Ensure your changes pass all relevant tests and meet our quality standards.
# Example: Running tests for a specific package
# Replace <package_name> with the actual package, e.g., @lomi/api
bun --filter <package_name> test
# Run specific tests using a pattern (e.g., tests related to 'payment')
bun test -- --grep "payment"
# Run all tests across the monorepo
bun test
# Run tests and generate a coverage report
bun run test:coverage
Write tests for your changes. See the Code standards section for an example.
Commit your changes
Commit your changes using a descriptive message that follows our Commit message guidelines. Adhering to the format helps automate releases and changelogs.
Commit message format:
<type>(<scope>): <description>
# Examples:
# feat(api): add support for webhook signature verification
# fix(docs): correct typo in getting started guide
# chore(deps): update dependency xyz
Example commit:
git add .
git commit -m "feat(payments): implement new payment provider"
See Best practices for good vs. bad commit message examples.
Push your changes
Push your branch to your fork on GitHub:
git push origin <BRANCH_NAME>
Submit a pull request (PR)
- Go to your fork on GitHub (
https://github.com/<YOUR_USERNAME>/lomi.
). - You should see a prompt to create a Pull Request from your recently pushed branch. Click “Compare & pull request”.
- Ensure the base repository is
lomiafrica/lomi.
and the base branch isdevelop
. - The head repository should be your fork, and the compare branch should be your feature/fix branch.
- Write a clear PR title: Use the same format as commit messages (
<type>(<scope>): <description>
). - Fill out the PR template: Provide a clear description of your changes, including:
- Changes: What did you change and why?
- My code follows the style guidelines of this project.
- I have performed a self-review of my own code.
- I have commented my code, particularly in hard-to-understand areas.
- I have made corresponding changes to the documentation.
- My changes generate no new warnings.
- I have added tests that prove my fix is effective or that my feature works.
- New and existing unit tests pass locally with my changes (
bun test
). - Any dependent changes have been merged and published in downstream modules.
- Commits are squashed appropriately (if needed) and have meaningful messages.
- Submit the Pull Request.
Review process
Your PR will be reviewed by maintainers.
During review:
- Respond to Feedback: Address comments and questions promptly.
- Make Changes: Push new commits to your PR branch to incorporate requested changes. Avoid force-pushing unless asked.
- Keep Updated: If
develop
advances significantly, rebase your branch to resolve conflicts.
After merge:
- Celebrate! 🎉 Thank you for your contribution.
- Clean Up: You can safely delete your feature branch from your fork.
- Stay involved: Keep an eye on related issues or follow up if needed. Monitor the deployment if applicable.
Next steps
- Familiarize yourself with our Code of conduct.
- Understand our Branching strategy.
- Learn about the Code review process in more detail.
Your PR will be reviewed by maintainers according to our Code Review process. Be prepared to respond to feedback and make further changes if necessary. We’ll be fast to respond to you, don’t you worry!
Thank you so much.