Skip to content

Commit

Permalink
@MrDiceflayerBot - a Mini App designed to assist users in rolling dic…
Browse files Browse the repository at this point in the history
…es for tabletop games like Dungeons & Dragons.
  • Loading branch information
Tratt0re committed Oct 10, 2023
1 parent 9f31780 commit 7785b4a
Show file tree
Hide file tree
Showing 84 changed files with 21,685 additions and 2 deletions.
30 changes: 30 additions & 0 deletions BSD3_LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
BSD 3-Clause License

Copyright (c) [2023], [Salvatore De Luca - @Tratt0re]
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
21 changes: 21 additions & 0 deletions MIT_LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) [2023] [Salvatore De Luca - @Tratt0re]

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS," WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
68 changes: 66 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,66 @@
# diceflayer
@MrDiceflayerBot - a Mini App designed to assist users in rolling dices for tabletop games like Dungeons & Dragons.
# Diceflayer - Unleash the Power of the Dice!

![Diceflayer Logo](./assets/diceflayer_logo.png)

[Diceflayer](https://t.me/MrDiceflayerBot) is a Telegram Mini App designed to assist users in rolling dices for tabletop games like Dungeons & Dragons.

**This repository houses both the frontend and backend code for the Diceflayer Telegram mini-app.** You can access and interact with the bot by adding it to Telegram, just click [HERE](https://t.me/MrDiceflayerBot).

## Adventurer! Bring this with you 📜
This project is an implementation of a Telegram Mini App and Telegram classic Bot. Before you begin, it is highly recommended to consult the official documentations:

- 📖 [Telegram Mini Apps Official Documentation](https://core.telegram.org/bots/webapps)
- 🤖 [Telegram Bot Official Documentation](https://core.telegram.org/bots)

Familiarizing yourself with these resources will ensure a seamless experience with Diceflayer.


## Table of Contents

- [Overview](#overview)
- [Technologies Used](#technologies-used)
- [Navigate the repo](#navigate-the-repo)
- [License](#license)
- [Thanks](#thanks)

## Overview
In the grand realm of online tabletop gaming, Diceflayer emerges as a hero, simplifying the dice-rolling process by offering an easy-to-use interface within the Telegram app. This project is forged with React and Reactstrap for the [Frontend](./frontend/README.md), and Python and Flask for the [Backend](./backend/README.md). Embark on a journey through our documentation to explore the project and learn the arcane arts of crafting your very own Telegram bot with a Mini Web App included!

## Technologies Used

- [Frontend](./frontend/README.md): The frontend uses React.js and Reactstrap UI library, along with telegram functionalities provided by an open source react framework.
- [Backend](./backend/README.md): The backend uses Python(v3.11.3) and Flask, along with telegram official api to manage bot services through https requests.

> Check their respective documentation to learn more about them
## Navigate the repo

This repository contains both the fronted and backend source code of the application. Each folder contains a `README.md` file with specific informations about the part of the project you are exploring. In each folder you will also find a `docs/` folder contaning specific guides to help you install the bot or start your own project using this one for reference.

To simplify the navigation and the project set up you can use the link below:

- [Frontend documentation legend](./frontend/docs/README.md)
- [Main](./frontend/README.md): Here you will find the overview set up for the frontend project.
- [Bot setup guide](./frontend/docs/bot-setup-guide.md): Follow the steps inside this guide to create a Telegram Bot.
- **Hosting**: In order to visualize the mini app on your bot you will need to host the project somewhere.
- [Hosting on Github Pages](./frontend/docs/gh-pages-setup-guide.md): Here you can check the guide on how host the project on Github pages and make the mini app available on your telegram bot.
- [Hosting through Ngrok](./frontend/docs/ngrok-setup-guide.md): Here you can check how to set up ngrok to host the project and develop without the need of deploying a new build each time you update the source code.
- [Want to start from scratch?](./frontend/docs/develop-from-zero.md): Check this guide to setup a new react app and link it to your telegram bot.
- [Backend documentation legend](./backend/docs/README.md)
- [Main](./backend/README.md): Here you will find the overview set up for the backend project.
- [Bot setup guide](./backend/docs/bot-setup-guide.md): Follow the steps inside this guide to create a Telegram Bot and configure it to work with the backend project.
- **Hosting**: In order to let your bot use this backend you will need to host the project somewhere.
- [Hosting on Heroku](./backend/docs/heroku-setup-guide.md): Here you can check the guide on how host the project on Heroku platform.
- [Hosting through Ngrok](./backend/docs/ngrok-setup-guide.md): As per fronted, you can use ngrok to host the backend and develop without the need of deploying a new build each time you update the source code.


## License
This project is dual-licensed under the **BSD License** and the **MIT License**. You are free to use, modify, and distribute the code. If you fork this project or use it as a base, please remember to cite the original author, [@Tratt0re](https://github.com/Tratt0re), in your documentation.

- [MIT licence](./MIT_LICENSE)
- [BSD licence](./BSD3_LICENSE)

## Thanks

- Special thanks to my friend Piero, to have given me the idea of a dice rolling telegram mini app, and supported me with suggestions during the development. Keep your AC solid ✌🏻🛡️
- Also a huge thanks to my friend Edo, to have found a tricky bug i didn't notice! May your save rolls never get a 1 💪🏻🪄
Binary file added assets/diceflayer_logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/heroku_step_1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/heroku_step_2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/heroku_step_3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/heroku_step_4.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/heroku_step_5.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
162 changes: 162 additions & 0 deletions backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

sample.*.json
8 changes: 8 additions & 0 deletions backend/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"python.linting.pylintEnabled": false,
"python.linting.flake8Enabled": false,
"python.linting.enabled": true,
"python.formatting.provider": "black",
"python.formatting.blackArgs": ["--line-length", "120"],
"python.linting.flake8Args": ["--max-line-length=120", "--ignore=E402"]
}
30 changes: 30 additions & 0 deletions backend/BSD3_LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
BSD 3-Clause License

Copyright (c) [2023], [Salvatore De Luca - @Tratt0re]
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
21 changes: 21 additions & 0 deletions backend/MIT_LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) [2023] [Salvatore De Luca - @Tratt0re]

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS," WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
1 change: 1 addition & 0 deletions backend/Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: gunicorn app:app --workers 1

0 comments on commit 7785b4a

Please sign in to comment.