This repository contains code for all tools running at https://free-tools.io We are open for public contribution for this open source repository. Follow below guide to create your own tool at here.
Thank you for showing interest in creating a new tools for the public. It is very easy to develop a tool with our simple SDK. All the tools are developed with NodeJS.
- Fork Github project https://github.com/free-tools-io/free-tools-io to your github.com account
- Create new folder for your tool (Folder name to be clear and denotes the tool)
- Inside the folder create your tool with this FTIO SDK (https://www.npmjs.com/package/ftio-sdk)
- After testing, Raise pull-request to https://github.com/free-tools-io/free-tools-io at master branch
- After review and validation, it would be deployed to production at https://free-tools.io
Install FTIO SDK
npm install -g ftio-sdk
Create a new folder for the tool and run below command from the new folder.
ftio create
This would create sample base64 tool with all the files required. Below sections will cover how to customize these generated files specific to your tool.
This is the important meta file for your tool. Below are the field details
- name - Name of the tool. Displayed to the end users. Make it more meaningful.
- description - Description about the tool. Short and clear description of the tool what it does.
- author - Name of the author/organization
- icon - Icon name from https://ionicons.com/
- npm-packages - List of NPM packages required to run the tool. (Specify version too like [email protected])
- tags - Array list of tags. Tags are important for tool to appear on search or on Google.
Along with meta.info, three other important files developer has to know.
- input.ejs - UI form component to render form on UI to get inputs. Written in HTML with EJS template engine.
- run.js - Core algorithm to process input and produces the output data. Written in NodeJS
- output.ejs - UI component to render output of the algorithm. Written in HTML with EJS template engine.
- meta.info - Covered above
This file is regular HTML file with embeded javascript templates with EJS template engine. JsonForm is used to render forms easily from JSON. JSONForm has very good playground (https://jsonform.github.io/jsonform/playground/index.html) with more examples with all possible forms.
Along with that you can access query
variable to read query params. After input form is filled the data is submitted back to the same url with new query parameters. You can refer any input.ejs file of the any above tools.
Other than these, you can use any Bootstrap 4 code to render your input form.
References:
- EJS Templates - https://ejs.co/
- JSONForm Home Page - https://github.com/jsonform/jsonform
- JSONForm Playground - https://jsonform.github.io/jsonform/playground/index.html
- Bootstrap Components - https://getbootstrap.com/docs/4.0/getting-started/introduction/
This file is NodeJS file with regular code exposing run(req)
function. This function is expected to return promise which resolves output in following fields.
- data - Output of your algorithm to be used in output later.
- status -
success
orerror
as per your output. Generally we resolve withsuccess
In all other failure scenarios we resolve with undefined object asresolve()
- title - Title of the output personalized to the output like 'Calculated BMI for Age 56 with Height 5.4'. This is used to show the page title and to show description for the recent activities.
Data Validation is done with validatorjs library. Refer https://www.npmjs.com/package/validatorjs for more details on validations.
This file is regular HTML file with embedded javascript templates with EJS template engine (same as input.ejs). output
variable (resolved/returned from run.js) will be available on output.ejs. You can use as <h1><%= output.data %></h1>
Start local instance with below command
ftio start
Access via http://localhost:3000
Port number can be changed by setting environment variable PORT
Raise PR to our master Git Repo https://github.com/free-tools-io/free-tools-io After the review and automated testing, This would be deployed to production at https://free-tools.io
Refer: https://github.com/free-tools-io/free-tools-io/blob/master/CONTRIBUTING.md
That's all. You are done. Wait for our response.
For any queries, ask at https://github.com/free-tools-io/free-tools-io/issues/new
Thank You !!!