theovidal / cubcarre

🎲 Rubik's cube timer on a Telegram bot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CubCarré logo

CubCarré

Rubik's cube timer on a Telegram bot

Add the botLicense

💻 Development

Thanks for participating in CubCarré's improvement and/or debugging! First, check the following requirements:

  • Git, for version control
  • Golang 1.18 or higher with go-modules for dependencies
  • Node.js (tested on v14+) with npm or yarn for dependencies
  • A SQLite database file (whatever location)

Clone the project on your local machine:

git clone https://github.com/theovidal/cubcarre  # HTTP
git clone git@github.com:theovidal/cubcarre      # SSH

Telegram bot

The bot itself is a Go program that uses the telegram-bot-api library.

  • Database models are located under the database directory
  • Commands and callback actions are in handlers
  • Some helpers can be found in lib

Set up some environment variables described in the .env.example file, either by adding them in the shell or by creating a .env file at the root of the project. To run and test the bot, simply use go run . in the working directory. To build an executable, use go build ..

Web app

The web app associated with the bot is located under the webapp folder. It is written with Svelte and built with Vite. This combination ensures a light and instant experience to the user.

To start, go in the folder and install required dependencies :

npm i          # Install the dependencies
yarn i

While developing, you can run a local test server that you plug to the Telegram bot. You can either open your ports on your router, or use services such as ngrok that creates a tunnel to your machine.

npm run dev    # Run the development server
yarn dev

Once done, to build for production, use the script below and serve the output directory through a web server, like Apache or nginx. You can also deploy on GitHub Pages, Netlify....

npm run build  # Build for production
yarn build

📜 Credits

🔐 License

GNU GPL v3

About

🎲 Rubik's cube timer on a Telegram bot

License:GNU General Public License v3.0


Languages

Language:JavaScript 67.9%Language:Go 25.6%Language:Svelte 5.5%Language:HTML 0.9%Language:Shell 0.1%