Git Product home page Git Product logo

simple-quiz's Introduction

Simple quiz Telegram Web App example

Inspired by zubiden/tg-web-bot-demo.

Demo bot: @yaqb_bot

What this bot can do?

This bot demonstrates how to develop Telegram bots with WebApp feature and simple setup backend with express.js and grammyjs

webapp-vanilla is used in the project.

What is important?

  • Keyboard Button use to additional Bot UI, because user data is not passed
  • Inline Button use to handle user data like language and user id. It's useful for more loaded components like forms
  • It is advisable not to use JQuery and build the project with Vite, Parcel or other modern bundlers.
  • Be sure to use dark and light themes.

Installation and local launch in DEVELOPMENT mode

  1. Clone this repo: git clone https://github.com/ShinkarenkoMaxim/simple-quiz
  2. Create .env file with the environment variables listed below
  3. Run yarn in the root folder
  4. Run yarn build
  5. Run yarn serve and yarn bot separately

If you want to add several features then you can create directory public/feature and add to this directory your component and serve static file like in example:

app.use('feature', express.static('feature'));

Environment variables in .env file

  • PORT - port number for listen server
  • HOST - hostname or your server ip address. For local development use Ngrok tunnel
  • BOT_TOKEN - telegram bot token

simple-quiz's People

Contributors

shinkarenkomaxim avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.