Lädt...


🔧 Effortless Image Tag Generation: Streamline Your Workflow with Pinata and IPFS


Nachrichtenbereich: 🔧 Programmierung
🔗 Quelle: dev.to

This is a submission for the The Pinata Challenge

What I Built

I have built an app, called Image Thing, for web developers who are looking for a way to streamline the generation of img tags. Image Thing allows developers to upload images, pin files to IPFS, and generate img tags.

Demo

In this demo, you can see:

  1. User authentication.
  2. File check to make sure only images are uploaded (no PDFs).
  3. Successful image uploads with captions automatically generated.
  4. Pre-signed URLs are generated for unpinned files and opened in separate tabs.
  5. An image is pinned and an img tag is generated.
  6. Files are unpinned and deleted.

My Code

image-thing

This is a Next.js project bootstrapped with create-next-app.

This project was created for the Pinata Challenge; it's an app which combines Pinata's file storage APIs with OpenAI's LLM models to provide unique features tailored towards image files.

Technology

  • Pinata
  • OpenAI
  • Supabase
  • NextJS

Getting Started

Database

One must first set up a database. This application uses Supabase. A table needs to be set up with the following columns:

  1. id int8
  2. created_at timestamptz
  3. upload jsonb
  4. hash text
  5. user_id uuid
  6. is_pinned bool
  7. pinata_id text
  8. pinata_cid_private text
  9. pinata_cid_public text

After that, policies need to be created for SELECT, UPDATE, INSERT, and DELETE to allow only authorized users to access rows in the table. The table should have row-level security (RLS) enabled.

Environment Variables

The following environment variables need to be created:

  1. PINATA_JWT
  2. PINATA_GATEWAY
  3. OPENAI_API_KEY
  4. NEXT_PUBLIC_SUPABASE_URL
  5. NEXT_PUBLIC_SUPABASE_ANON_KEY

Starting the App

First, run the development server:

npm run dev
#

More Details

Users who upload their images automatically have an alt text and caption generated using OpenAI's chat completions API. By default, the images are uploaded to the Pinata Files API which means the images are private. If a user wants to preview an image, they can click a button to generate a pre-signed URL that opens in another tab.

If a user wants to make their image public, the Pinata Web3 file API is used to pin the file to IPFS. Once an image is public, users can click a button to generate an img tag with the IPFS URL and alt text pre-populated.

In the backend, Supabase is used to handle user authentication and track uploads for each user. Image hashing is performed to make sure users aren't uploading duplicate files. Supabase is also used in the frontend to quickly update UI state based on user actions. For example, we can see file stats updating as different actions are taken.

The app is built with NextJS and TypeScript, and published under the MIT license.

...

🔧 Effortless Image Tag Generation: Streamline Your Workflow with Pinata and IPFS


📈 105.67 Punkte
🔧 Programmierung

🔧 StashIt: Your Game Assets Storage Hub | Powered by Pinata 🪅 IPFS SDK


📈 42.98 Punkte
🔧 Programmierung

🔧 StashIt: Your Game Assets Storage Hub | Powered by Pinata 🪅 IPFS SDK


📈 42.98 Punkte
🔧 Programmierung

🔧 A decentralized file storage system using PINATA and IPFS


📈 41.47 Punkte
🔧 Programmierung

🔧 A decentralized file storage system using PINATA and IPFS


📈 41.47 Punkte
🔧 Programmierung

🔧 Pinata CLI: A CLI Application for the Pinata.Cloud Files Interface


📈 40.84 Punkte
🔧 Programmierung

🔧 The Pinata Challenge: Pinata File Hub - Seamless File Management & Uploads


📈 40.84 Punkte
🔧 Programmierung

🔧 Pinata OG! | Generate beautiful OpenGraph Images with Pinata File API


📈 40.84 Punkte
🔧 Programmierung

🔧 Pinata OG! | Generate beautiful OpenGraph Images with Pinata File API


📈 40.84 Punkte
🔧 Programmierung

🔧 Created a dApp storing data on Pinata - IPFS


📈 40.16 Punkte
🔧 Programmierung

🔧 SnipShot: A Stylish Code Snippet Uploader Using Pinata IPFS


📈 40.16 Punkte
🔧 Programmierung

🔧 PinataShot: Multimodal LLaMA 3.2 Screenshot Categorization on Pinata IPFS


📈 40.16 Punkte
🔧 Programmierung

🔧 Real-Time Chat Application with React and Pinata for Effortless Messaging and File Sharing


📈 39.15 Punkte
🔧 Programmierung

🔧 PinFu: A Dual-Purpose Application for Effortless File Uploads to Pinata


📈 36.52 Punkte
🔧 Programmierung

🔧 Image generation with DALL-E and Pinata


📈 34.58 Punkte
🔧 Programmierung

🎥 Streamline your workflow by automating work information retrieval as part of content generation.


📈 34.48 Punkte
🎥 Video | Youtube

🎥 Access advanced data management solutions and streamline your workflow with analytics and AI.


📈 30.45 Punkte
🎥 Video | Youtube

🎥 Access advanced data management solutions and streamline your workflow with analytics and AI.


📈 30.45 Punkte
🎥 Video | Youtube

🔧 Effortless Markdown From ChatGPT: Supercharge Your Workflow Now


📈 29.6 Punkte
🔧 Programmierung

🔧 Tools and Configurations for an Effortless Workflow in Docker and Kubernetes


📈 29.41 Punkte
🔧 Programmierung

🔧 Streamline Your Workflow: A Guide to Normalising Git Commit and Push Processes


📈 29.14 Punkte
🔧 Programmierung

🔧 # Streamline Your Debugging Workflow: Transitioning from Charles and Fiddler to EchoAPI Interceptor


📈 29.14 Punkte
🔧 Programmierung

📰 6 ways to streamline your workflow with Microsoft Excel


📈 27.83 Punkte
📰 IT Nachrichten

🔧 How to use CSS preprocessors to streamline your frontend workflow


📈 27.83 Punkte
🔧 Programmierung

🔧 Streamline your Workflow with VSCode Dev Containers & Red Hat Images


📈 27.83 Punkte
🔧 Programmierung

🐧 Introducing the Zsh Shortcuts Plugin: Streamline Your Terminal Workflow!


📈 27.83 Punkte
🐧 Linux Tipps

🔧 Streamline Your Deployment Workflow with CI/CD in Bitbucket Using Git FTP


📈 27.83 Punkte
🔧 Programmierung

🔧 Streamline Your Django Workflow: A Guide to Creating Custom Management Commands


📈 27.83 Punkte
🔧 Programmierung

🔧 Streamline Your Workflow with Numverify's Zapier Integration


📈 27.83 Punkte
🔧 Programmierung

🔧 Streamline Your Tailwind CSS Workflow with Prettier Plugin Enhancements


📈 27.83 Punkte
🔧 Programmierung

🔧 Streamline Your Coding Workflow with 12 Powerful VS Code Shortcuts


📈 27.83 Punkte
🔧 Programmierung

🔧 Streamline Your Workflow: Automate Frontend Deployment with GitHub Actions


📈 27.83 Punkte
🔧 Programmierung

🔧 Mastering Git Fixup Commits: Streamline Your Workflow


📈 27.83 Punkte
🔧 Programmierung

🔧 Streamline Your Coding Workflow with Remote File Sync for VS Code


📈 27.83 Punkte
🔧 Programmierung

🔧 Streamline Your Coding Workflow with Remote File Sync for VS Code


📈 27.83 Punkte
🔧 Programmierung

matomo