From 527b17c971af02a2b84ea437f4f5644fe6ffdb97 Mon Sep 17 00:00:00 2001 From: eduardozgz Date: Sat, 13 Jul 2024 10:29:42 +0000 Subject: [PATCH] Add README and update links --- .env.example | 2 +- README.md | 55 +++++++++++++++++++++++++++++++++++++++++ apps/website/Dockerfile | 2 +- 3 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 README.md diff --git a/.env.example b/.env.example index 9519bcfc8..5d2e3e7f3 100644 --- a/.env.example +++ b/.env.example @@ -26,7 +26,7 @@ REDIS_URL='redis://redis:6379' NEXT_PUBLIC_SUPPORT_URL='https://discord.com/invite/g4MfV6N' NEXT_PUBLIC_BOT_DOCS_URL='https://docs.membercounter.app/' -NEXT_PUBLIC_BOT_REPO_URL='https://github.com/Member-Counter/bot' +NEXT_PUBLIC_BOT_REPO_URL='https://github.com/member-counter/bot' NEXT_PUBLIC_TRANSLATION_PLATFORM_URL='https://tolgee.membercounter.app/' NEXT_PUBLIC_SENTRY_ADMIN_URL='https://sentry.membercounter.app/' # DO NOT ADD A TRAILING SLASH, THIS IS ALSO USED AS A BASE URL diff --git a/README.md b/README.md new file mode 100644 index 000000000..1393102dd --- /dev/null +++ b/README.md @@ -0,0 +1,55 @@ +# Member Counter + +[Add this bot](https://membercounter.app/invite) **|** [Website](https://membercounter.app/) **|** [Translation Project](https://tolgee.membercounter.app) **|** [Documentation](https://docs.membercounter.app/) + +Member Counter is a Discord bot which lets you easily display counts and other dynamic information in a channel name or topic, to get started, [add this bot](https://membercounter.app/invite) to your Discord server and run `/setup server` + +# Self-host + +Read this guide to setup this bot using docker: https://docs.membercounter.app/guides/how-to-self-host-member-counter + +# Development environment + +## Software requirements + +- [Git](https://git-scm.com/downloads) +- [NodeJS 20](https://nodejs.org/en/download/) +- [Docker](https://www.docker.com/get-started) + +## Clone the bot and install dependencies + +``` +git clone -b dev git@github.com:member-counter/bot.git member-counter-bot +cd member-counter-bot +corepack enable +pnpm install +``` + +## Configure the app + +Open `.env` with a text editor + +- Set `COOKIE_SECRET` to something secure with at least 32 characters (or just add one more character for development purposes) +- Set `DISCORD_CLIENT_ID`, `DISCORD_CLIENT_SECRET` and `DISCORD_BOT_INSTANCE_TOKEN` with your development bot credentials +- Update `DISCORD_OAUTH2_REDIRECT_URI` as needed in the `.env` file and at the [Discord developer portal](https://discord.com/developers/applications) (**OAuth2 redirect URL**) +- Set `DATABASE_URL` to `mongodb://localhost:27017/memberCounter?replicaSet=rs0&directConnection=true` + Save this file as `.env` +- Set `REDIS_URL` to `redis://localhost:6379` +- Set `NODE_ENV` to `development` + +Remember that you can't hot-reload this file, you must fully restart the app to apply new changes + +## Starting the bot and website + +``` +docker compose -f docker-compose.dev.yml up -d +npm run dev +``` + +Now you can start editing the code, when you save a file the app will be reloaded automatically + +### Do a pull request + +Now just [create a pull request](https://github.com/eduardozgz/member-counter-bot/pulls) to the `dev` branch, and we will review it as soon as possible + +Happy coding! diff --git a/apps/website/Dockerfile b/apps/website/Dockerfile index 508e0da48..79071b762 100644 --- a/apps/website/Dockerfile +++ b/apps/website/Dockerfile @@ -32,7 +32,7 @@ COPY --from=builder /app/out/full/ . ENV SKIP_ENV_VALIDATION=true ENV NEXT_PUBLIC_SUPPORT_URL='https://discord.com/invite/g4MfV6N'\ NEXT_PUBLIC_BOT_DOCS_URL='https://docs.membercounter.app/'\ - NEXT_PUBLIC_BOT_REPO_URL='https://github.com/Member-Counter/bot'\ + NEXT_PUBLIC_BOT_REPO_URL='https://github.com/member-counter/bot'\ NEXT_PUBLIC_TRANSLATION_PLATFORM_URL='https://tolgee.membercounter.app/'\ NEXT_PUBLIC_SENTRY_ADMIN_URL='https://sentry.membercounter.app/'