Git Product home page Git Product logo

hod1's Introduction

Project Overview

Production Deploy on Telegram: @HarmonyLotteryBot

Front-End

  • Framework: React
  • Deployment: Netlify (Automatic deployment from miniApp branch)
  • Video Player: User's viewing status is consistently tracked down every fraction of a second to ensure the user has indeed watched the video until the end to reward NIL points. Users must watch threshold (90%) of video duration to claim reward. If video is skipped (>3 seconds), watch time counter is halted.

Back-End

  • Framework: Express, Node.js, Axios
  • Deployment: Heroku (Manual deployment with git push heroku master)
  • Components: Includes both bot server and API server in index.js

REST API Endpoints

  • GET /points

    • Parameters: userId
    • Description: Retrieves the user's NIL balance (points).
  • GET /watch

    • Parameters: userId, videoId
    • Description: Calls the function to mark a video as watched.
  • GET /watchedVideos

    • Parameters: userId
    • Description: Retrieves the list of videos the user has watched.
  • POST /updateWatchedVideos

    • Parameters: userId, videoId
    • Description: Updates the user's watched videos list.
  • GET /youtube/viewcount

    • Parameters: url
    • Description: Fetches view count of specific youtube video from url

Telegram MiniApp

Tasks

  • Database: Port user database from index.js server to an actual database.
  • Video Player: Implement a video player to embed YouTube videos when clicked on "watch" button.
  • Verify watching video: Implement a way to confirm the user has watched the video until the end, no skipping or just clicking on url.
  • Fix fastfowarding increasing watch time issue
  • UI Update: Enhance the web UI for better visuals.--TBD
  • Video List Management: Clean up and streamline the video list to allow updates from a single file.
  • TMA UI Improvement: Enhance the Telegram Mini App UI with features such as back buttons and better navigation.
  • Update bot details (change bot username)
  • Add inline keyboard menu button 'play'
  • Integrate Youtube API

Notes

Previous testing stuff are stored on other branches (chat-based inetraction, lottery, etc)

Instructions for replicating:

  1. Install dependencies for both client and server:
npm i
  1. Telegram: Create your bot with Telegram BotFather. Get API key, touch .env in /server (example given in .env.example).
  2. Server-side: Dpeloy to server-hosting or on local:
cd server
node index.js
  1. Modify client-side API endpoint URLs in client/App.js with your PORT or deployed server URL.
  2. Client-side: Deploy client side on hosting app. Make sure to add deploy setting npm run build. (Will need to be on hosting app, not local since need to connect through Telegram).
  3. Give command to BotFather /newapp and register your Web App URL (front-end deploy link).
  4. (Optional) Give command to BotFather /setmenubutton to add menu button to bot.

hod1's People

Contributors

rika97 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.