Welcome to the Promo Code Generator repository! This project features implementations of promotional code generators using two popular Python frameworks: Flask and FastAPI. It includes both basic and advanced versions of the generator to accommodate different use cases.
The promotional codes generated by this project are specifically designed for the Hamster Kombat game on Telegram. The code generators facilitate the creation of promo codes for in-game use, enabling promotional activities and user engagement for the game.
- Flask Basic Promo README
- Flask Advanced Promo README
- FastAPI Basic Promo README
- FastAPI Advanced Promo README
- Flask Basic Promo For Server README
- Flask Advanced Promo For Server README
The Promo Code Generator enables you to create promotional codes for various categories of games. The project is divided into two main frameworks, each with two versions:
-
Flask: A micro web framework for Python.
- Basic Promo: Generates a fixed number of promo codes for each category.
- Advanced Promo: Provides customizable parameters for generating promo codes.
-
FastAPI: A modern, fast (high-performance) web framework for building APIs with Python.
- Basic Promo: Generates a fixed number of promo codes for each category.
- Advanced Promo: Allows for flexible API queries to customize the number of promo codes.
-
Basic Promo:
- Generates a predetermined number of promo codes for each category.
- Simple and easy-to-use implementation.
-
Advanced Promo:
- Allows for the customization of the number of promo codes generated.
- Supports query parameters for filtering and adjusting the output.
- Includes enhanced error handling and validation.
/project-root
/Flask
/basic_promo
/app.py
/README.md
/advanced_promo
/app.py
/README.md
/FastApi
/basic_promo
/app.py
/README.md
/advanced_promo
/app.py
/README.md
- Clone the Repository:
git clone https://github.com/mamadceto/H-P-G-Api
- Navigate to the Desired Framework and Version:
cd Flask/basic_promo # or Flask/advanced_promo
# or
cd FastApi/basic_promo # or FastApi/advanced_promo
- Install Dependencies:
pip install -r requirements.txt
- Run the Application:
- **Flask:**
python app.py
- **FastAPI:**
uvicorn app:app --reload
- Access the API:
- **Flask:** http://localhost:5000/generate
- **FastAPI:** http://localhost:8000/generate
- Basic Promo: Generates a fixed number of promo codes (default: 4) for each category.
- Advanced Promo: Customize the number of promo codes and category using query parameters:
category
(optional): Specify a category such astrain
,chain
,bike
, orclone
. To generate codes for all categories, useall
.num
(optional): Specify the number of promo codes to generate. Maximum allowed is 20.
Feel free to fork the repository, make changes, and submit pull requests. We welcome contributions that enhance the functionality and usability of the project.
This project is licensed under the MIT License - see the LICENSE file for details.
For any inquiries or feedback, please contact @mmdceto.