Thank you for investing your time in contributing to our project! ✨.
In this guide you will get an overview of the contribution workflow from opening an issue, creating a PR, reviewing, and merging the PR.
Use the table of contents icon on the top left corner of this document to get to a specific section of this guide quickly.
To get an overview of the project, read the README. Here are some resources to help you get started with open source contributions:
- Finding ways to contribute to open source on GitHub
- Set up Git
- GitHub flow
- Collaborating with pull requests
Check to see what types of contributions we accept before making changes. Some of them don't even require writing a single line of code ✨.
If you encounter an issue with Amibot, search if an issue already exists. If a related issue doesn't exist, you can open a new issue using a relevant issue tag.
Scan through our existing issues to find one that interests you. You can narrow down the search using labels
as filters. As a general rule, you should ask to be asigned to the issue you want to work on. However, you can open a PR for an issue even if you're not assigned!
- Fork the repository.
-
Using Github Web :
-
Using GitHub Desktop:
- Getting started with GitHub Desktop will guide you through setting up Desktop.
- Once Desktop is set up, you can use it to fork the repo!
-
Using the command line:
- Fork the repo so that you can make your changes without affecting the original project until you're ready to merge them.
This describes the setup you need to test and run this application on your local computer.
Amibot needs Node version 18+ -- use nvm
for easy setup.
Amibot uses the WhatsApp Business Cloud API to send and recieve messages on WhatsApp. Here's how you can get started:
- Setup a facebook developer account
- Get started with WhatsApp Business Cloud API
- Add a test number so you can interact with your local deployment of the bot.
- Setup a webhook for whatsapp events (once you start Amibot and ngrok).
Amibot uses MongoDB to persist user state. You can either use the hosted MongoDB Atlas (recommended) or spin up an instance locally.
Make a .env
file by copying .env.sample
and populating the WHATSAPP_TOKEN
, VERIFY_TOKEN
(token used for facebook ) and other fields.
We need to expose the local web server to the internet so we can set up a WhatsApp webhook for the Amibot instance. ngrok is an easy-to-use service that lets us do just that! Steps to setup:
- Create account on https://ngrok.com.
- Install the ngrok CLI.
- Login to your ngrok account:
ngrok config add-authtoken <authtoken>
- Expose the local Amibot instance with
ngrok http 3000 --region us
(the region is important -- facebook currently blocks other ngrok regions. - Use
<ngrok-url>/webhook
as the webhook URL on the Meta developer portal.
yarn dev
to start Amibot with live-reload (the bot will restart with each change you make to the code).
Commit your changes to a new branch once you're happy with them. See Conventional Commits -- a lightweight convention for commit messages we recommend for contributions to Amibot.
When you're finished with the changes, create a pull request, also known as a PR.
- Fill the "Ready for review" template so that we can review your PR. This template helps reviewers understand your changes as well as the purpose of your pull request.
- Don't forget to link PR to issue if you are solving one.
- Enable the checkbox to allow maintainer edits so the branch can be updated for a merge. Once you submit your PR, a Docs team member will review your proposal. We may ask questions or request for additional information.
- We may ask for changes to be made before a PR can be merged, either using suggested changes or pull request comments. You can apply suggested changes directly through the UI. You can make any other changes in your fork, then commit them to your branch.
- As you update your PR and apply changes, mark each conversation as resolved.
- If you run into any merge issues, checkout this git tutorial to help you resolve merge conflicts and other issues.
Congratulations 🎉🎉 The Amity student body thanks you ✨
We'll follow up your PR with reviews and suggestions that might require you to work more on your contributions to get them ready.
Once your PR is merged, your contributions will be publicly visible!