Hello! We'd love to see your contribution on this repository soon, even if it's just a typo fix!
Contributing means anything from reporting bugs, ideas, suggestion, code fix, even new feature.
Bear in mind to keep your contributions under the Code of Conduct for the community.
The issues page is a great way to communicate to us. Other than that, we have a Telegram group that you can discuss your ideas into. If you're not an Indonesian speaker, it's 100% fine to talk in English there.
Please make sure that the issue you're creating is in as much detail as possible. Poor communication might lead to a big mistake, we're trying to avoid that.
A big heads up before you're writing a breaking change code or a new feature: Please open up an issue regarding what you're working on, or just talk in the Telegram group.
You will need a few things to get things working:
- Node.js current version (as of now, we're using v20 as defined in the
.nvmrc
file). You can install it through the official Node.js download page, but we recommend using nvm or fnm. Here's a simple installation/setup guide, but you should really refer directly to the corresponding repository's README.
# If you want to install fnm
$ curl -fsSL https://fnm.vercel.app/install | bash
# Then simply use this command
$ fnm use
# OR if you want to install nvm
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
$ nvm use
-
Docker and Docker Compose if you don't have MongoDB installed on your machine.
-
Telegram Bot Token. You must create one in order to take the bot into development. Telegram has a guide about it.
- Fork this repository to your own Github account and clone it to your local device.
- Run
npm install
to install the dependencies needed. - Get the database up and running. You can use
docker-compose up -d
for this. To stop the container, usedocker-compose stop
. To remove the container, usedocker-compose down
. Bear in mind that the data stored in MongoDB of the Docker container is not persistent. Once it's stopped, the data will be erased. - Rename
.env.example
to.env
and fill the config key=value needed. The one's necessary isBOT_TOKEN
andMONGO_URL
you may leave everything else blank. If you're using the Docker Compose file to spin up the database, your.env
should be:
NODE_ENV=development
BOT_TOKEN=<your own token>
MONGO_URL=mongodb://root:password@localhost:27017/teknologiumum?useNewUrlParser=true&useUnifiedTopology=true&authSource=admin
SENTRY_DSN=
LOGTAIL_TOKEN=
HOME_GROUP_ID=<your test group, if any>
- Run
npm run dev
to start running your bot. - Happy coding!
You are encouraged to use Conventional Commit for your commit message. But it's not really compulsory.
Creating a branch name with the name consisting feat/**
, fix/**
, refactor/**
, and perf/**
will get CI benefits from Github Actions.
It's really up to you to have an unit test or not. But if you do, just create one on the tests
directory, and run the test with:
npm run test
.
├── CONTRIBUTING.md - You are here
├── docker-compose.yml - Docker compose file
├── Dockerfile - Single docker file to run this app
├── fly.toml - Fly.io configuration
├── LICENSE
├── package-lock.json - Package lock file
├── package.json - Meta information & dependencies
├── prepare.cjs - Simple script to run husky install in a cross-environment
├── README.md
├── README_id.md
├── docs - Documentation for users
├── src
│ ├── app.js - App/bot entry point
│ ├── services - Commands logic
│ └── utils - Utilities
└── tests - Unit testing with uvu
Please run ESLint and Prettier with these commands so you're good on the CI process.
$ npm run lint
$ npm run format
And you're set!