The GenericSuite software library

The GenericSuite software library

The GenericSuite software library

GenericSuite is a comprehensive software library designed for backend and frontend App development in Python and React.js, including AI features.

https://genericsuite.carlosjramirez.com/

 

What is the GenericSuite for?

The GenericSuite is a frontend and backend set of utilities made with ReactJS and Python to help develop Apps faster.

Features:

  • Generic CRUD database and endpoints: by having a core Create-Read-Update-Delete code that can be parametrized & extended, there’s no need to rewrite code for each table editor.
  • Generic menu and endpoints builder.
  • Database abstractor: The backend can use DynamoDB or MongoDB as the persistent storage, and some software design patterns have been used there (factory method, facade, iterator, template method, decorator). The most remarkable thing about it was to implement DynamoDB access by a MongoDB-styled syntax.
  • Framework abstractor: to develop Apps with FastAPI, Chalice or Flask seamlessly.

Click here to check the Repositories 

The GenericSuite AI

The GenericSuite AI is a frontend and backend set of utilities made with ReactJS and Python to help develop Apps that implements AI.

Features:

  • ai_chatbot endpoint to implement NLP conversations based on OpenAI or Langchain APIs.
  • OpenAI, Google Gemini, Anthropic, Ollama, and Hugging Face models handling.
  • Clarifai models and embeddings handling.
  • Computer vision (OpenAI GPT4 Vision, Google Gemini Vision, Clarifai Vision).
  • Speech-to-text processing (OpenAI Whisper, Clarifai Audio Models).
  • Text-to-speech (OpenAI TTS-1, Clarifai Audio Models).
  • Image generator (OpenAI DALL-E 3, Google Gemini Image, Clarifai Image Models).
  • Vector indexers (FAISS, Chroma, Clarifai, Vectara, Weaviate, MongoDBAtlasVectorSearch)
  • Embedders (OpenAI, Hugging Face, Clarifai, Bedrock, Cohere, Ollama)
  • Web search tool.
  • Webpage scrapping and analyzing tool.
  • JSON, PDF, Git and YouTube readers.
  • Language translation tools.
  • Chats stored in the Database.
  • User Plan, OpenAI API key and model name attributes in the user profile, to allow free plan users to use Models at their own expenses.

Click here to check the Repositories

History

I learned this idea of the generic CRUD editor and the other elements generated with generic programming from structured configurations in the mid-80s, working for a company that already handled this idea using the fashionable languages and databases of the time (Clipper and dBase III), with the configurations generated by a system called System Maker and stored in the database. A concept that, in my opinion, was way ahead of its time.

In 1999 and 2000 I made my own version of the generic CRUD editor in Microsoft ASP (Active Server Pages) for a CMS (Content Management System), something like what WordPress does.

During the pandemic of 2020, I came up with the idea of creating a new App (FynApp) and started the development of the generic editor for frontend in React.js based on Class Components, (more information here) and the backend in Python (more information here), with the configurations in structures specified in the same code.

At the beginning of 2023 I started converting the generic editor to React.js based on Functional Components and the configurations in JSON files.

During PyCon Colombia in June 2023, I had the idea of bringing generic programming to the backend. I started to code the CRUD handlers and the Menu and Endpoints automatic generation from the same configurations used by the frontend generic CRUD editor, using JSON files stored in a repository common to both frontend and backend.

The appearance of ChatGPT at the end of 2022 and the AI (Artificial Intelligence) boom, made me very curious and eager to include some of that in FynApp.

In July 2023 I participated in the lablab.ai Google Vertex AI Hackathon and that gave me the ideas to create FynBot: the artificial intelligence assistant for FynApp, based on OpenAI APIs and later GPT Functions.

Between August and November 2023 I explored and included AI image and audio generation in the App.

In December 2023 I decided to implement generic programming using Langchain for Python, to use any LLM / NLP / Embeddings models  and avoid being tied to a single AI provider.

In February 2024 I started extracting all the generic programming from FynApp and there The GenericSuite was born. The first version was published at the beginning of March 2024 and the ready betty libraries were published in NPMJS and Pypi at the beginning of April 2024.

Click here to check the NPM / Pypi Libraries

This is my first contribution to the open source community.

 

FynApp: an App to achieve Calorie Deficit

FynApp: an App to achieve Calorie Deficit

FynApp: an App to achieve Calorie Deficit

FynApp is nutrition in your pocket. An App to achieve Calorie Deficit, weight loss goals and maintain a better lifestyle, based on proper nutrition.

Technical Specs

Frontend: has the remarkable Generic CRUD Editor [GCE], a React component to help develop back-office apps faster.

By having a core Create-Read-Update-Delete code that can be parametrized & extended, there’s no need to rewrite code for each table editor.

I did before in other programming languages over the years, like Microsoft ASP in the early Y20K.

The intention is to transform it into an NPM package.

Backend: can use DynamoDB or MongoDB as the persistent storage.

Some software design patterns have been used, like factory method, facade, iterator, template method, decorator.

The most remarkable thing about it was to implement DynamoDB access by a MongoDB-styled syntax.

Gitops/Devops: scripts and configurations necessary to carry out deployments on different platforms (local development servers and VPS), with orchestration technologies such as Kubernetes, artifacts & repository management with Jfrog, Docker, Gitlab, and Gitlab Runners

Tools

This application was built using:

 

Frontend

Backend

  • Python 3, Chalice, JWT
  • MongoDB Atlas, AWS DynamoDB
  • GenericSuite

GitOps / DevOps

  • AWS
  • Kubernetes, Docker
  • Github
  • Jfrog
  • Linux, Bash

Mobile (about to come)

  • Flutter

Live Demo

🔗 Link to the live Demo:

https://app-demo.fynapp.com/

Generation of a Rust program and a Telegram BOT with ChatGPT

Generation of a Rust program and a Telegram BOT with ChatGPT

In this article I share my experience generating a Rust program  and a Telegram BOT with ChatGPT.

I ended my 2022 the way it should be: coding and learning.

In this last year week I decided to try ChatGPT’s much-vaunted AI  to learn how to program some of the resolutions I set for 2023, for example: Rust and a BOT for Telegram.

What is ChatGPT?

AI” is an acronym  for Artificial Intelligence  .

ChatGPT is an Artificial Intelligence developed by OpenAI that has caused a stir since November 30, 2022 for the maturity of its ML (Machine Learning) models: GPT-3, which performs a variety of natural language tasks, Codex, which translates natural language into programming code, and DALL· E, which creates and edits original images.

OpenAI’s goal is to develop and promote safe and “friendly” AI. American entrepreneur Sam Altman (former president of startup accelerator Y Combinator) co-founded OpenAI in 2015 with Elon Musk, who left the project in 2020. Sam Altman serves as CEO of the San Francisco-based company.

ChatGPT is not the first, nor the only, nor the most advanced AI. Its merit lies in putting it in the hands of the general public free of charge, albeit limited, as an opener of the revolution that is coming upon us.

Generating a Rust Language Program with ChatGPT

When trying to make an API in Rust for handling a table of users in a MongoDB database, the result was a bit frustrating.

I built almost the entire API with ChatGPT. The result was good for encouraging me to learn Rust, but the program generated from the query to ChatGPT didn’t work.

I asked him for a complete program that implements CRUD (Create, Read, Update and Delete) operations on a table of users in MongoDB from Rust, with each operation in a separate function and the main function all in a single .rs file

I had to do this little by little so that I could put all the parts together.

Then I asked to implement an API in Rust that handles a user table in MongoDB with Endpoints for all CRUD operations and that follows the REST style, and that can be called by Ajax in Javascript.

He did it for an old version of the MongoDb dependency for Rust, he didn’t give me the configuration of the Cargo.toml file  (especially the necessary features for the serde), he didn’t include the ‘uses‘ of all the necessary elements (for example, for ‘tokyo‘), he didn’t include the structs for the Form and Query in the ‘warps‘ that define Endpoints, among many other things.

I spent hours trying to fix it so that it was an MVP (minimum viable product) and in the end I got stuck at the end of the Endpoint to query a document in the MongoDb database.

I understood something important: for a highly typed programming language, which could be the substitute for C Language, it is not advisable to try to learn in the Learning-by-Example style, in my case it is necessary to take some course, and then put it into Rust.

Generation of a Telegram BOT in Python Language with ChatGPT

Here I did get a very satisfactory result for two reasons: I already knew how to program in Python and a few years ago I tried to do this work in PHP (more or less in 2018, based on this repo by Eleirbag89 and this article by Stackoverflow on how to get price from bitcoin to USD with PHP api) and somehow I already knew how to start the development of the BOT,  although some minor things changed over time.

According to Wikipedia, a BOT is a computer program that automatically performs repetitive tasks over the Internet through a chain of commands or previous autonomous functions to assign an established role; and that has the ability to interact, changing state to respond to a stimulus.

Initially, the project had the objective of giving the quotes of Bitcoin and then having a mechanism to warn when the cryptocurrency reached a specific minimum value, sending an alert through the same Telegram.

What I liked about this exercise was that a project dormant for 4 years, to which I had invested many hours of work to finally put it aside (and I even lost the source code due to several moves from one country to another, changing computers and not putting it in a Github repository) to be able to develop it from scratch in 21 hours (2 days of work practically).

The end result can be summed up in these elements:

Github repository:

hatps://github.com/tomkat-cr/market_alert_from

Telegram BOT URL:

https://t.me/ocr_marketalert_bot

And the Telegram BOT looks like this:

A screenshot of a computer

Description automatically generated

ChatGPT Conversation Tips

Little by little I’ve become friends with this AI…

The conversation was in Spanish entirely and ChatGPT speaks it very well.

Initially, I asked him for an overview of the development.

Since the free version of ChatGPT has limitations on the size of the responses, I gradually ask it for the rest of the things that are cut.

When you are asked for code in a specific programming language, at the end or at some point you should also be asked for configuration files, installation procedures, among other things, to avoid – for example – dependency version conflicts.

The other thing is that I initially asked him to give me the procedure to put the BOT to work in Vercel’s free service, and so far I have not been able to get it to work. I gave up and had to put a question on StackOverflow to see if anyone would help me fix a problem with port forwarding between the BOT in Python and the Vercel Serverless instance.

In the end it was a good experience (there is no bad thing that does not come with good), because I learned the two working modes of the Telegram BOTs, the Polling and the WebHook, I learned how to deploy applications in Fly.io, and most importantly: feeling blocked, minimized, defeated by not being able to deploy in Vercel, in a matter of hours I looked for a viable solution with something new,  even if that means investing time in learning and learning and learning more! The same thing happened to me when Heroku ended its free tier and I had to move the backend from FynApp to Vercel and frontend to Github Pages.

CONCLUSION

It was a very interesting and enriching experience. Definitely, the initial creative development process is streamlined and he challenged me to finish it in record time.

However, I’m still not going to lose my job by being replaced by an AI.

This is missing quite a bit. In the meantime, let’s learn how to develop Artificial Intelligence and Machine Learning.

Here are two interesting articles:

  1. How to program Artificial Intelligence? [5 languages]
  2. 12 Steps to Applied Artificial Intelligence

The best of all was the corrections my mom made minutes before the 2022 new year eve when I shown her this Post. It was something beautiful and unexpected, in addition to her being hired to do the review of all the Posts for my Personal Branding project.

MINE: Physical goods NFT Marketplace

MINE: Physical goods NFT Marketplace

MINE: NFT Marketplace for title deeds of physical properties (cars, motorcycles, boats, among others).

MINE is a platform that allows transactions without the need of buyers and sellers physical presence in the places or countries where the operation is carried out. With purchase / sales transactions paid in cryptocurrencies, protected purchases for the security protection of both the buyer and the seller.

This solution is based on Web3 technologies, through the creation of a DApp deployed on the Ethereum Blockchain.

It was made by The GOF5 (Gang of Five) during Platzi’s Ethereum Developer Program 2022.

NFT Marketplace Features

  • Users (buyers, sellers) must connect their Wallet to:
    • Register.
    • Authenticate.
    • Register new goods for sale.
    • Buy goods.
  • Additionally, they must have contact information to negotiate goods and prices:
    • ID / Driver’s License.
    • First name.
    • Last name.
    • Phone number.
    • Email.
  • There will be a public display of the goods. Observers also need a Wallet to query and view.
  • Goods will be displayed by categories.
  • The currency to display the prices of the Goods will be US Dollar and the official exchange currency will be the ETH (the Ethereum cryptocurrency).
  • Initially it will only be available in Medellín, Colombia.
  • A commission will be associated with each of the NFTs registered in the DApp so that each time this NFT is transferred it sends a percentage to the owner of the Smart Contract.
  • A commission will be charged for each sale made.

What problem does the project solve?

Has it happened to you that you want to buy or sell a vehicle outside your location, and you don’t find the people or tools necessary to perform the transaction?

Are you tired of Marketplaces on social networks that do not deliver the true information of what you are looking for, and if you offer a product, it is not given enough visibility?

Are you tired of paying high commissions for bank transfers to pay for goods?

How the NFT Marketplace solve it?

MINE: A NFT Marketplace that allows transactions without the need for physical presence of buyers and sellers in the localities or countries where the operation is carried out, with purchase / sale transactions paid in cryptocurrencies, with protected purchases for the protection of the security of both the buyer and the seller.

This solution is based on web3 technologies, through the creation of a DApp deployed on the Ethereum Blockchain.

Impact on Society

  • In Latin America there is no NFT Marketplace for physical goods like this.
  • Time saving. Buyer and seller can make transactions without leaving home/office.
  • Trust and credibility between the parties: because the Goods are audited by certified experts, and these Experts can be chosen by the buyers.
  • Do not go through banks: thus, avoiding intermediaries.
  • Avoid high fees for large transactions and/or international transfers.

Value Added to Web2

  • Decentralization:
    • Business logic is a Smart Contract.
    • The App Frontend cannot be censored.
    • The data is not under the control of the developers.
    • The Blockchain where the Smart Contract is deployed is Ethereum.
    • The Frontend is built an open source.
  • Traceability of goods, transactions, signatures of involved.
  • Transparency.

NFT Marketplace user types

Buyer:

  • Puts the money from the purchase of the Good.
  • You must have the funds in your Wallet.
  • Pay the tax.

Seller:

  • Owner of Good.
  • It must cover the expenses of the publication of the contract and the NFT mint (issuance), with the characteristics specified below.
  • Pay the Expert’s fee or certification.

Experts / Certifiers:

  • Certify the validity of the Good, then it can be sold.
  • Sign the transaction when the Owner Property is changed on a physical world.
  • Charge transaction fees.
  • Digital Document Creation Service: If a product does not have a title deed, it is generated.
  • The expert is legally responsible for the transaction.

Notary:

  • He/she performs the legal property transfer in the real world.
  • At the digital level, sign the transaction with his/her address / Wallet.
  • Receive taxes.

Administrator (our Wallet):

  • Charging commissions.
  • Send to execute transferFrom from the buyer’s account to the seller’s.

NFT Features

The NFT will be the picture of the Good.

Metadata:

  • Description, categories, photo arrangement.
  • Apart from the main photo, there may be additional photos (example: the motorcycle, vehicle, or boat from different angles).
  • A section of photos only visible to the seller and the buyer who already gives their approval of purchase intention, and the experts. One or more of them will be the ownership legal document.

Possible problems

  • Conversion from ETH to USD/COP or other currency, and vice versa.
  • Duplicate NFT (that the same Good for sale is published several times).
  • More than one owner.
  • Penalties in case of fraud in the properties.

NFT Marketplace Architecture

Plans

  • The goods may only be sold when they are verified by a certified Expert. Experts must have an official certification to exercise their functions, validated by the regulatory entities in the region where they carry out their activities. For this, a badge will appear when displaying the Good indicating such condition.
  • The Experts will be responsible for auditing and certifying that the Goods exist and are in order. On them will fall the legal responsibility of legitimacy of the Goods. They will be able to interact with the system using their Wallets and earning a commission for purchases and sales.
  • Purchase / sale of real estate: real estate, commercial premises, among others adding to the Metadata address, GPS coordinates, photos of exteriors and interiors.
  • Purchase/sale of virtual assets: plots in the Metaverse, NFT works of art, among others.
  • Purchase / sale of Jewelry.
  • Auction of goods and assets.
  • Expand the operation to other Latin American countries and regions.
  • Use as a means of payment Stable Coins as Tether (USDT).
  • Additional photos in the Metadata of the Goods, as well as private photos.
  • Encryption of sensitive user data (PII) stored in the IPFS.
  • Display prices in local currency (e.g., COP).

Tools used

Frontend

  • ReactJS
  • Web3.js (Wallet connection)
  • Chakra-UI (templating)
  • Mocha (testing)
  • HTML
  • CSS
  • JavaScript
  • VS Code (coding & peer programming)

Backend

  • Solidity
  • Hardhat
  • Open Zeppelin
  • Chain.link (exchange rate integration between ETH – and USDT)
  • Chai (testing)
  • VS Code (coding & peer programming)

Integrations

  • Metamask (Wallet + authentication + Ethereum provider)
  • IPFS / Infura (data persistency)
  • Goerli (test net)
  • Goerli PoW Faucet (faucet)

NFT Marketplace Repository

NFT Marketplace Live Demo

Developer Team

Eimer Wilfer Castro Hincapié
🔗 https://github.com/ewcastroh

Carlos J. Ramirez
🔗 https://github.com/tomkat-cr

Javier García
🔗 https://github.com/stratoff

José Valentín Salina
🔗 https://github.com/josevsalina

Fidelina Arteaga
🔗 https://github.com/fidelinaarteaga

How did they solve it as a team?

Our call as a team was quite spontaneous. Eimer summoned Carlos, then both summoned on channel #General of the Discord of the #EthDevProgram challenge and then Javier, José and Fidelina appeared. Eventually, the group adopted the name GOF5 (Gang of Five).

There was a spirit of equality among us, and everyone’s interventions were respected. This came naturally from the beginning.

We started meeting to see what ideas we had. Each one presented his idea, and with a mastermind we were adding details and other things that were appearing.

We let the idea land for a day or two, and then it was put to a vote. No one lobbied, no advertising, no lobbying. No votes were bought. It didn’t matter whose ideas they were either.

We agreed to start doing daily meetings to achieve the goals. The first meetings last less than 1 hour to put the mastermind to work and shape the project.

After establishing the Jira board, starting to create and assign tasks in the Backlog, we meet daily in Stand Ups of 15-20 minutes to follow up, seeing what was done the day before, what is planned to be done today and the existence of some blockage.

We started working on the Whitepaper, in somewhat marathonic meetings (3-5 hours) but very productive. We delimit the project, describe actors, procedures, and above all, the conceptual part: the history, the impact, added value of Web 3 on doing it in Web 2, possible problems, legal framework, pitch, technologies, among other things.

At one point we lost faith in the project, because we came to think that the conceptual part regarding the advantages of the Blockchain vs the current applications of Web 2.0 and the complexity of the legal issues involved in the transfer of goods did not make much sense, however, we managed to establish well the added value that we can give by solving the problem with our platform that would facilitate and give security in the user’s purchase / sale of goods.

In another marathonic session we defined the 90-second Pitch Elevator, the presentation of the project, the logos for the DApp and the group, and a model with the design of the screens.

With the agenda for the next 2 weeks clearer, we started working in teams for the Frontend, Backend and Operations.

Our official slogan: “Let’s solve with what we have“.

Work Methodology, Monitoring and Deliverables

We established Scrum as an agile work methodology and Jira as a tool to follow up.

We established 1-week Sprint starting August 23, 2022.

It was done in 2 Sprints and at the end of each one there was a deliverable:

  1. 2022-08-30 – MINE Project White Paper.
  2. 2022-09-06 – MVP (Minimal Viable Product).
Dynamic NFT Dapp with Chainlink Keeper and IPFS

Dynamic NFT Dapp with Chainlink Keeper and IPFS

Dynamic NFT Dapp with Chainlink Keeper and IPFS

Dynamic NFT Dapp with Chainlink Keeper and IPFS: App create a dynamic Ethereum NFT which changes its metadata depending on certain defined conditions, in this case a time lapse.

It uses Keeper service from Chainlink, IPFS, Hardhat, React, Goerli Faucet and Solidity programming language.

This projec is based on the Dinamic NFT master class by Camilo Molano during the Platzi’s 2022 Ethereum Developer Program de Plazi.

https://platzi.com/clases/3235-ethereum-dev-program/52575-08_220712_eth/

It belongs to my Development Portfolio.

What is Solidity?

Solidity is a high-level contract-oriented language.

Its syntax is like JavaScript and it’s specifically focused on the Ethereum Virtual Machine (EVM).

Solidity is statically typed and accepts, among other things, inheritances, libraries, and complex user-defined types.

What is Chainlink’s Automation

Chainlink’s Automation (previously named “Chainlink Keepers”) is a decentralized off-chain computing layer to automate smart contract functions and introduce new features to dApp.

Developers no longer must carry out processes manually, rely on centralized servers, or make changes to their protocol in order to automate on-chain functions when certain conditions are met. Instead, they can delegate that task to Chainlink Keepers.

Website link: https://chain.link/automation 

What is IPFS

IPFS or Interplanetary File System, is a decentralized file system that seeks to guarantee the security, privacy, and resistance to censorship of your data.

It is the mechanism used in Web3 and Blockchain to allow file persistence without having to use centralized services such as AWS S3 Buckets.

Github

The source code link is:

https://github.com/tomkat-cr/platziretoDNFT

Pokémon Factory Ethereum smart contract

Pokémon Factory Ethereum smart contract

Pokémon Factory Ethereum smart contract

Pokémon Factory: Ethereum smart contract to generate Pokemons, with their skills, types, and weaknesses. Developed using the Solidity language.

It was the first Smart Contract I deployed, as part of Platzi’s Ethereum Developer Program.

It is part of my Development Portfolio.

What is Solidity?

Solidity is a high-level contract-oriented language.

Its syntax is like JavaScript and it’s specifically focused on the Ethereum Virtual Machine (EVM).

Solidity is statically typed and accepts, among other things, inheritances, libraries, and complex user-defined types.