twir icon indicating copy to clipboard operation
twir copied to clipboard

feat: giveaways

Open danluki opened this issue 1 year ago • 1 comments

There is giveaways implementation with good foundation for future.

List of features:

  1. Required min messages, watch time.
  2. Additional luck for subscribers and followers.
  3. Multiple giveaways for one channel.
  4. Unlimited participants

Planned features in terms of importance:

  1. Set roles for giveaways.
  2. More settings like min sub time and etc.
  3. Follow time based luck(I have some ready math to implement it, but first lets test this first). I think this is huge one.
  4. Case like animation for winners choose.
  5. Transparent implementation of winners choose. Also already have some math to implement this.

What can be helpful.

  • Test this locally on some big stream. Currently tested only with two people.
  • Help with frontend. This is always needed.
  • Test build on stage server.

You can always contact me if you have some proposals, reviews or bug reports.

Summary by CodeRabbit

  • New Features

    • Introduced a comprehensive giveaways management system across various components including API, bots, and the frontend dashboard.
    • Added permissions for viewing and managing giveaways.
    • Implemented CRUD functionality for giveaways in the frontend.
    • Integrated giveaways functionality into the message handling of bots.
    • Established gRPC services for processing giveaways participants and winners.
    • Developed database migrations for channel giveaways and participants management.
    • Included a new giveaways section in the dashboard navigation and added a dedicated route for managing giveaways.
  • Documentation

    • Updated API documentation to include new giveaways management functionalities.
  • Refactor

    • Structured the codebase to integrate giveaways management smoothly across different applications and services.
  • Chores

    • Set up Dockerfile for giveaways service deployment using Alpine Linux.

danluki avatar Mar 22 '24 04:03 danluki

Walkthrough

This update introduces a comprehensive giveaways feature across various components of the application, including the API, bots, and frontend. It encompasses the creation, management, and participation aspects of giveaways, integrating services via gRPC, updating permissions, and enhancing the UI for better interaction. The changes span from backend service implementations and database migrations to frontend management and display, ensuring a seamless experience for managing and participating in giveaways.

Changes

File(s) Change Summary
apps/api/app/app.go, apps/bots/app/app.go Added imports for giveaways and functions to create a GiveawaysClient.
apps/api/internal/.../impl_deps.go, .../impl_protected/impl_protected.go, apps/bots/internal/messagehandler/messagehandler.go Added giveaways imports and updated structs to include giveaways related fields.
apps/api/internal/impl_protected/giveaways/giveaways.go, apps/giveaways/internal/grpc_impl/grpc_impl.go Introduced functionality for managing giveaways, including CRUD operations and participant handling.
apps/giveaways/Dockerfile, apps/giveaways/cmd/main.go, apps/giveaways/app/app.go Setup for giveaways service including Dockerfile, main application initialization, and service configurations.
cli/internal/goapp/apps.go, libs/grpc/clients/giveaways.go, libs/api/api.proto, libs/api/messages/giveaways/giveaways.proto, libs/grpc/giveaways/giveaways.proto Added giveaways app, gRPC client creation function, and protobuf definitions for giveaways.
frontend/dashboard/src/api/..., frontend/dashboard/src/components/giveaways/..., frontend/dashboard/src/pages/Giveaways.vue Updated frontend to manage and display giveaways, including new API functions, Vue components, and a page for giveaways.
frontend/dashboard/src/layout/navigation.vue, frontend/dashboard/src/plugins/router.ts Updated navigation and router configuration to include a section for managing giveaways.
libs/gomodels/channel_giveaway.go, libs/gomodels/channel_giveaway_participant.go Defined models for channel giveaways and participants.
libs/migrations/migrations/20240318125351_channel_giveaways.sql Database migration scripts for channel giveaways and participants tables.
libs/grpc/constants/constants.go Added a constant for the giveaways server port.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

coderabbitai[bot] avatar Mar 22 '24 04:03 coderabbitai[bot]