-
Notifications
You must be signed in to change notification settings - Fork 0
Contributing
We welcome contributions from the community! To contribute:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Submit a pull request with a detailed description.
We appreciate your interest in Tactigon Shapes! If you encounter any issues or have feedback, feel free to open an issue.
We'll walk you through how to create the block and handle the Python code generation. The easiest step is to create your custom blocks on the Blockly Developer website: Blockly Developer Tools. This platform provides an intuitive interface for defining block shapes, fields, and behavior without needing to write code manually. You can customize the block's appearance, input types, and logic connections. Once your block is designed, the tool generates the corresponding JSON, which can be easily integrated into Tactigon Shapes project.
-
Create a Category (Optional)
- If you want to organize your blocks, you can create a new category or assign your block to an existing category.
- To create a new category, go to the Edit page in the Shape module.
<category name="To Uppercase" colour="#f1c40f ">
<block type="to_uppercase">
</block>
</category>-
Design Your Block
- Use the Blockly Developer Tools to create your new block by customizing its inputs, logic, and appearance.
- Once done, copy the generated JSON code for your block.
Blockly.Blocks['to_uppercase'] = {
init: function () {
this.jsonInit({
"type": "to_uppercase",
"tooltip": "",
"helpUrl": "",
"message0": "To Uppercase %1",
"args0": [
{
"type": "input_value",
"name": "TEXT",
"check": "String"
}
],
"previousStatement": null,
"nextStatement": null,
"colour": '#f1c40f'
});
}
};-
Add the Block to Tactigon Shapes
- Paste the JSON code into the Custom blocks file page in the Shapes module.
- After adding it, you will see both the new category (if created) and the new block in the Tactigon Shapes workspace.

-
Write Custom Code for the Block
- You can write custom Python code for your block in the Custom blocks file page in the Shapes module.
- From Tactigon Shapes, you can generate code in JavaScript, Python, PHP, or Dart based on the visual blocks. But we recommend using Python because almost all of our projects speak Python.
python.pythonGenerator.forBlock['to_uppercase'] = function(block) {
var text_to_print = Blockly.Python.valueToCode(block, 'TEXT', Blockly.Python.ORDER_ATOMIC) || "''";
var code = `debug(logging_queue, ${text_to_print}.upper())\n`;
return code;
}; -
Run and Test
- After creating your block, rerun the project and test your block by running your shape.

Here, we have attached a demo video about how to create your own block in the Tactigon Shapes project.
custom_blocks.mp4
This guide will walk you through how to add your own module to the Tactigon Shape system.
Here's what each main folder does:
Stores all config files for the app and its modules.
Holds trained machine learning models and related info.
Includes speech recognition models and files.
The main Python package where everything connects.
This file is where everything starts. It handles command-line options and runs the Tactigon server.

Inside the project folder tactigon_shapes, you’ll find a folder named modules. This is where all modules live.
Each module should have:

-
blueprint.py: Flask routes and web APIs. -
extension.py: Connects your module to other systems/devices. -
manager.py: Business logic and how your module works. -
models.py: Data structures for your module. -
templates/,static/: For web UI (Jinja HTML, CSS, JS).
- Inside
modules/, create a new folder with your module’s name.

- Inside that folder, add these files (empty or with templates):
__init__.pyblueprint.pyextension.pymanager.pymodels.py-
templates/andstatic/folders if needed
- If you're building a web page, put your Jinja templates in the
templates/folder.

- In
models.py, define your module's data (like configs or status).

- In
manager.py, write your core logic (how it behaves or reacts).

- In
extension.py, connect to external devices or other modules.

- In
blueprint.py, create Flask routes and link your Jinja UI files.

Example:
When users go to /zion, they'll see index.jinja from the zion module.

This is what that page would look like:

Want to create custom blocks? Use this link

- Import your module’s
extensionandmanagerwhere needed.

- Register your module in
tactigon_shapes/__init__.py.

- Register the blueprint in the same file.

- Add your module to the navigation bar (optional, but useful!).

To do this, update tactigon_shapes/templates/base.jinja to include your link and icon:

- Need real-time updates from server to browser?
Use SocketApp from tactigon_shapes/modules/socketio/extension.py. It pushes live data from your backend to the UI.

That’s it! Now you know how to build a new module in the Tactigon Shapes system 🎉