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
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 .
.
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
- Maintainer: Théo Vidal
- Libraries: check go.mod