reward-system

Reward System - Indie Creators

MIT License

Stars
33

Reward System

Introducing the perfect companion for your Discord community! πŸ’»πŸš€ This reward calculation bot is the ultimate tool for those seeking recognition for their contributions. From small code tweaks to large collaborative projects, this bot is equipped to calculate and display the rewards deserved for each contribution. βš™οΈπŸ’° With its precision and speed, this bot will make your creators feel valued and motivated to keep working in the community. Don't wait any longer to add it to your Discord server and give your members the gratification they deserve! πŸ’―πŸ’ͺ

Table of Contents

Getting Started

Pre-requisites

Before you start, make sure you have the following:

Project File Tree

.github
  └─ workflows
        └─ CI with pnpm cache setup
.vscode
  └─ Recommended extensions and settings for VSCode users
apps
  β”œβ”€ bot
  |   β”œβ”€ Node
  |   β”œβ”€ Discord JS
  |   β”œβ”€ tRPC Client
  |   └─ TypeScript
  └─ next.js
      β”œβ”€ Next.js 13
      β”œβ”€ React 18
      β”œβ”€ Tailwind CSS
      └─ E2E Typesafe API Server & Client
packages
 β”œβ”€ api
 |   └─ tRPC v10 router definition
 β”œβ”€ auth
     └─ authentication using next-auth. NOTE: Only with Discord
 └─ db
     └─ typesafe db-calls using Prisma

[ ↑ to top ↑ ]

Installation

As the project uses Turborepo, you could run the following commands on the root, and it will run every inner same command.

Note Ensure you have set the enviorimental variables before running the project

Run the Main Project

  1. Install the project dependencies by running pnpm install.
  2. Build the project by running pnpm build.
  3. Start the project by running pnpm dev.

Note pnpm dev will run discord and nextjs project

[ ↑ to top ↑ ]

Usage

To get it running, follow the steps below:

Setup .ENV

You will find a .env.example file in your project's root directory. Use it as a template for your own .env.

These are environment variables that you need to set in order to use Discord's OAuth2 API and to authenticate your bot with Discord.

Once you have set these environment variables in your .env file, you are ready to run the project.

Configure DB (SUPABASE)

To use Supabase as your database provider, you'll need to create a new project in Supabase and obtain your connection string URI. Here's how:

  1. Create a new project in Supabase.
  2. In your project, go to Settings -> Database.
  3. Under the "Connection" tab, copy the Connection string (URI).
  4. In your project, create a .env.local file at the root of the project folder.
  5. In the .env.local file, set the DATABASE_URL variable to your Supabase connection string URI.

For more details on setting up your Supabase database, check out the Supabase documentation.

Configure DISCORD BOT

  1. Go to the Discord Developer Portal.
  1. Click the β€œYes, do it!” button…

DISCORD_BOT_TOKEN="YOUR_TOKEN"

  1. Add Your Bot to a Discord Server

Configure DISCORD KEYS

To configure your Discord keys and enable your application to access the Discord API, follow the steps below:

Client ID: DISCORD_CLIENT_ID="your_client_id_here"
Client Secret: DISCORD_CLIENT_SECRET="your_client_secret_here"
  1. Click β€œYES” button.

  2. You’ll also see a β€œToken” and a blue link you can click called β€œCopy”.

If you need additional help, consult the Discord Developer Documentation.

Configure Discord WEBHOOKS

  1. Go to your Discord server where you want to add the webhook.
  1. Copy the webhook URL and set it as an environment variable in your project:

  2. DISCORD_WEBHOOK_URL="https://discord.com/api/webhooks/your_webhook_id/your_webhook_token"

  3. Save the changes and restart your server to make the changes take effect.

[ ↑ to top ↑ ]

How can I contribute?

We welcome contributions from anyone who would like to help improve our project. Whether you're an experienced developer or just starting out, there are plenty of ways to get involved.

Support

If you need help using our project, please visit our SUPPORT.md file. This document provides information on how to get help from the community, how to report issues, and where to find additional resources.

Join Our Community

Join our Discord community to connect with other contributors and get help from the maintainers. This is a great place to ask questions, get feedback on your ideas, and collaborate with others on the project.

Read the Contribution Guidelines

Before you start contributing, please read our CONTRIBUTING.md file. This outlines the contribution guidelines and provides instructions for setting up your development environment, submitting pull requests, and more.

We appreciate all contributions, big and small. Thank you for helping to make our project better!

Security

We take the security of our project seriously. If you discover a security vulnerability, please let us know right away. We will investigate all legitimate reports and do our best to quickly address any issues.

To learn more about our security practices, please read our SECURITY.md file.

License

MIT License

References

The stack originates from create-t3-app.

A blog post where I wrote how to migrate a T3 app into this

Test the Github GraphQL schema here


Contributors

Made with contrib.rocks.

[ ↑ to top ↑ ]


Folow us at