Trello+ [Intuitive Trello Storage]

Trello+ Datastore
I’ve been looking at Trello lately, and there aren’t a lot of updated modules for it, hence I did some rush work and whipped up a Trello module in a day. I will be making regular updates.

The reason why I made this module is due to the other Trello modules not incorporating Object-Oriented Programming or are using deprecated/unrecommended functions.

Documentation

Module:
– Methods –
TrelloPlus.Connect(string : Key, string : Token) - returns your Trello, fully authorized.

Trello
– Methods –
Trello:GetBoard(string : NameOrID) - Retrieves the matching board instance from your Trello.

Board
– Methods –
Board:GetList(string : NameOrID) - Retrieves the matching List instance from your Board.
Board:CreateList(string : Name) - Creates a new list instance and returns it

List
– Methods –
List:RetrieveCards() - Returns the names of every card as a table.
List:GetCard(string : NameOrID) - Retrieve the matching Card from your board
List:CreateCard(string : Name) - Creates a Card Instance and returns it

– Properties –
Name - Name of List
ID - ID of List

– Events –
List.CardAdded - Fires when a card has been added
List.CardRemoved - Fires when a card has been removed

:warning: Note :warning:
These events are not reliable, I will be optimizing them soon.

Card
– Methods –
Card:Destroy() - Archives the card
Card:Clone() - Clones the card.

– Properties –
Name - Name of Card
ID - ID of Card
Value - Card Value (Aka description, but encoded)
Description - Card Description (Deprecated, use Card.Value for description)

Code Sample
-- Requires the module --
local TrelloPlus = require(6048117360)

-- [ Trello Part ] --

-- Connect to your Trello --
--[[
How to get your Token and Key.

Key:
	Load this into a broswer of your choice - https://trello.com/app-key
	You should see a container like "Key: [XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX]"
	Copy your key and paste it into the Connect function below, so it would look like:
	TrelloPlus.Connect("KEY HERE", "")

Token:
	Return to the previous link - https://trello.com/app-key
	Below the key area, ththere should be something like:
	"Token:
	Most developers will need to ask each user to authorize your application.
	If you are looking to build an application for yourself, or are doing local testing,
	you can manually generate a Token."

	If you look carefully, the word 'Token' at the end is a link. Click it.
	You should find yourself in a new webpage. Scroll to the bottom and click "Allow" on the right. Which will redirect you.
	Now, you should see a container with red text, Copy it.
	Paste the text into the Connect again:
	TrelloPlus.Connect("KEY HERE", "TOKEN")
]]
local Trello = TrelloPlus.Connect("", "")

-- Getting the Board --
--[[
Instructions:
	You have to create a board with your Trello account first.
	You can either use the Name, or its ID.
	It will look like this:
	local Board = Trello:GetBoard("NAME_OR_ID")
]]
local Board = Trello:GetBoard("")

-- Getting a list --
--[[
Instructions:
	If you opened your board on Trello, you'd notice little containers called "Lists". They are like Mini Tables.
	Each List has a different Name or ID. You can customize the name.
	It will look like this:
	local List = Board:GetList("NAME_OR_ID")
	
	By the way, you can change the list name by doing:
		List.name = "NAME"
	
Bonus: You can create a List!
	Create it like this:
	local List = Board:CreateList("List Name")
]]
local List = Board:GetList("")

-- Getting a card --
--[[
Instructions:
	In every list, there are little 'entries' called Cards
	Each Card has a different Name or ID. You can customize the name.
	It will look like this:
	local Card = List:GetCard("NAME_OR_ID")
	
	You can also use "local Names, CardIDs = List:RetrieveCards" to retrieve all card names and IDs in a table (Tuple).
	
	By the way, you can change the list name or description by doing:
		Card.name = "NAME"
		Card.desc = "Woaaah"
	
Bonus: You can create a Card!
	Create it like this:
	local Card = Board:CreateCard("CardName")
]]
local Card = List:GetCard("")

-- By the way, the Card has multiple things you can do. --
--[[
Card:Clone()			Clones the card.
Card:Destroy()			Removes/Archives the card.

Card.Name				Card Name, you can change it by doing: Card.Name = "NewName" because this module uses metatables to detect the new index
Card.id					Card id, you can technically change it, but I won't suggest you to try.
Card.Value				The value of the card, kinda like a value instance in roblox. You can set it as well.
Card.Description		Deprecated. Card Value uses description and automatically encodes the entry for you
]]

Module:

14 Likes

Good job working on this, only side comment I have to say is that trello isn’t a datastore. It says in their policies that Trello shouldn’t be used to store data and it is just generally slow and unreliable From my experience making a trello ds

3 Likes

It’s common knowledge. Just don’t use it.

3 Likes

I never stated that Trello Datastore is the most efficient, I merely provide an alternative. Yes, it is common knowledge that Trello shouldn’t be used as a mass data store. However, it provides higher utility for data in smaller numbers.

The main reason I worked on this project was due to me requiring a trello datastore for a ‘Report System’, given that Roblox Datastore doesn’t allow you to manually edit the stores, I was inspired to create this module.

As @LucasTutoriaisSaimo mentioned, you should not use Trello for anything a simple datastore can accomplish, due to being less efficient and reliable.

In the future, I may revise the code to allow a queue system that allows for greater speed, and possibly rework some of the functions.

3 Likes

I’m surprised nobody has done this yet, but consider using something like Airtable as a Trello alternative. They offer the power of a database while also providing a great interface, including Kanban, which is similar to the Trello interface. They also have a pretty nice API.

If you really want the full power of a database, then your best bet will be… a database! If you know Node.JS, you can create your own database and API quite easily with an Express server and MySQL, MongoDB, etc… in just a few hours at most.

3 Likes

Thanks for the suggestion, I will check it out.

Oh I know, I tried to use it as a ban DS but when it failed, the whole system dropped.

1 Like

I know this is a bit old of a thread but can anyone explain the basics a bit clearer?