Inspiration

My biggest motivations came from the frustration we face in this part of the world when trying to pay for items online. The unstable FOREX rates, platform restrictions, and being in a low-income country often feel like a dead end. I wanted to create a solution—a platform that offers freedom, fairness, and access to global commerce.

I’ve always loved the idea of using crypto for purchases, but I believe it shouldn’t be limited to digital goods. Why can’t we use crypto to buy real, physical products too? Since crypto is universal, it has the power to eliminate the traditional payment barriers that still hold people back, especially in underserved regions.

That mission led me to think bigger. I was inspired by the metaverse—a world where digital experiences are decentralized, immersive, and borderless. So I asked myself: what if we could build the e-commerce layer of that future?

That’s how PurpleVerse was born—a futuristic, crypto-powered, AI-driven marketplace that empowers buyers and sellers through smart escrow, intelligent tools, and global access. It’s not just another online store—it’s a gateway to borderless commerce and a small step toward the decentralized marketplaces of tomorrow.

What it does

PurpleVerse is an e-commerce marketplace that integrates blockchain technology, specifically Algorand, to facilitate secure and transparent transactions. It aims to bridge traditional e-commerce with cryptocurrency, allowing users to buy and sell products using digital assets like USDC (on the Algorand Testnet for the demo using an hardcoded MockWallet to Simulate this process).

Key functionalities of PurpleVerse include:

Product Listings: Sellers can list and manage their products, including details, images, and pricing, with options for featured products and flash sales.

Order Management: Buyers can place orders, track their status, and confirm delivery, while sellers can manage incoming orders and update their fulfillment status.

Secure Payments: Payments are processed via Algorand, with funds held in escrow until delivery is confirmed, ensuring security for both buyers and sellers.

Seller Payouts: Sellers receive payouts directly to their Algorand wallets, with a platform fee deducted automatically.

User Management: It supports different user roles, including buyers, sellers, and various types of administrators, each with specific permissions.

Content Management: Includes a blog section for articles and a chatbot for customer support.

Analytics: Provides sales and inventory analytics for sellers and administrators to gain insights into performance.

Ai Assistance: Sellers can generate description for their products at a push of a button, Admin can post blogs through the assistance of ai.

Sustainable Revenue Model: 5% commission on every sale + fees for featured product placements.

How I built it

PurpleVerse is built using a modern web development stack, leveraging several key technologies to deliver its features:

Frontend: The user interface is developed with React and TypeScript, providing a robust and scalable foundation. Tailwind CSS is used for styling, enabling rapid and consistent UI development. Lucide React provides the icons used throughout the application. Vite serves as the build tool, offering a fast development experience.

Backend & Database: Supabase is the core backend service, providing a PostgreSQL database for data storage, Supabase Auth for user authentication, and Supabase Edge Functions for server-side logic and API endpoints (e.g., for handling crypto payments, sales analytics, and payout distribution). Supabase Storage is utilized for managing product images.

Blockchain Integration: The application integrates with the Algorand blockchain for cryptocurrency payments. This is facilitated through the algosdk library and Pera Wallet Connect for wallet interactions.

AI/Content Generation: For generating product descriptions and blog content, the application can utilize the Gemini API, with a local fallback mechanism in place if the API is unavailable.

Geographical Data: A custom geoData.ts file is used to manage country, state/province, and city/LGA information for address inputs.

Challenges I ran into

During the development of PurpleVerse, several challenges were encountered and addressed:

Database RLS Policy Recursion: A significant challenge involved configuring Row Level Security (RLS) policies in Supabase. Policies on tables like orders, order_items, and products often led to circular dependencies and infinite recursion errors, requiring multiple iterations and careful simplification of policy logic.

Notification System RLS Issues: Ensuring that system-generated notifications (e.g., from order status changes) could be inserted into the notifications table while maintaining strict RLS for user-specific access proved complex, necessitating several policy adjustments.

Crypto Payment Status Synchronization: Integrating Algorand crypto payments required careful synchronization of payment statuses with order statuses. Challenges arose in ensuring orders correctly transitioned from "pending" to "processing" upon payment confirmation and handling fund releases upon delivery.

Platform Wallet Balance Logic: Initial implementations of the platform wallet's balance updates had logical flaws, particularly in correctly accounting for the full order amount and subsequent deductions for seller payouts. This required refining the database functions responsible for financial tracking.

User Role Management and Permissions: Implementing a granular admin role system and ensuring that administrators could manage users and their roles according to a defined hierarchy, without encountering subquery errors or unintended access, was a complex task.

Algorand Wallet Connection and Transaction Reliability: Integrating with the Algorand blockchain and Pera Wallet presented challenges related to connection stability, transaction timeouts, and handling various user-side errors (e.g., rejected transactions, insufficient balance). Robust retry mechanisms and detailed error handling were crucial. This part was really frustrating that i had to seek for help on X(twitter) (https://x.com/PBabawibe/status/1937510089650504158) and on Discord (https://discord.com/channels/364486390102097930/1387070671011581972) sadly i couldn't get any help but thanks to Claude Ai and Grok Ai, they were really supportive.

Chatbot Search Functionality: Developing an effective and performant search function for the chatbot's knowledge base involved multiple iterations to refine relevance scoring and ensure accurate retrieval of answers based on user queries, I battled with this twice before claude ai helped to correct the issue.

Product Image Storage Policies: Setting up Supabase Storage for product images was challenging because storage policies cannot be fully automated via SQL migrations and required manual configuration, Thanks to Claude Ai for some of those SQLs.

Accomplishments that I'm proud of

I'm proud of the comprehensive design and structure of the PurpleVerse project's database. The schema lays a robust foundation for an e-commerce platform, incorporating complex features like crypto payments, product and seller reviews, and a sophisticated order management system. Building a full functional Crypto-based E-commerce platform within a month seem impossible before but now I'm a proud owner of one.

What we learned

Character wise, it i learnt a new type of patience that stems from frustrated debugging, and resilience even when i contemplating discarding the project.

Technically: Database RLS Policy Recursion: A significant challenge involved configuring Row Level Security (RLS) policies in Supabase. Policies on tables like orders, order_items, and products often led to circular dependencies and infinite recursion errors, requiring multiple iterations and careful simplification of policy logic.

Notification System RLS Issues: Ensuring that system-generated notifications (e.g., from order status changes) could be inserted into the notifications table while maintaining strict RLS for user-specific access proved complex, necessitating several policy adjustments.

Crypto Payment Status Synchronization: Integrating Algorand crypto payments required careful synchronization of payment statuses with order statuses. Challenges arose in ensuring orders correctly transitioned from "pending" to "processing" upon payment confirmation and handling fund releases upon delivery.

Platform Wallet Balance Logic: Initial implementations of the platform wallet's balance updates had logical flaws, particularly in correctly accounting for the full order amount and subsequent deductions for seller payouts. This required refining the database functions responsible for financial tracking.

User Role Management and Permissions: Implementing a granular admin role system and ensuring that administrators could manage users and their roles according to a defined hierarchy, without encountering subquery errors or unintended access, was a complex task.

Algorand Wallet Connection and Transaction Reliability: Integrating with the Algorand blockchain and Pera Wallet presented challenges related to connection stability, transaction timeouts, and handling various user-side errors (e.g., rejected transactions, insufficient balance). Robust retry mechanisms and detailed error handling were crucial.

Chatbot Search Functionality: Developing an effective and performant search function for the chatbot's knowledge base involved multiple iterations to refine relevance scoring and ensure accurate retrieval of answers based on user queries.

Product Image Storage Policies: Setting up Supabase Storage for product images was challenging because storage policies cannot be fully automated via SQL migrations and required manual configuration thanks to Claude Ai for some of the SQLs

What's next for PurpleVerse

PurpleVerse is positioned to evolve significantly by building upon its current foundation as a blockchain-powered e-commerce platform. Here are some potential next steps:

1. Enhanced Blockchain Integration and Features:

Mainnet Deployment: Transitioning from the Algorand Testnet to the Algorand Mainnet would enable real-world transactions with actual cryptocurrency, moving beyond the current demo mode. This would involve careful planning for smart contract audits and user education on managing real digital assets.

Multi-currency Support: Expanding payment options beyond USDC to include other cryptocurrencies and stablecoins, offering users more flexibility.

Advanced Smart Contracts: Implementing more complex smart contracts for automated dispute resolution, escrow enhancements, or even tokenized loyalty programs.

NFT Integration: Exploring the sale of digital goods as NFTs, or using NFTs for product authenticity verification, especially for high-value or collectible items.

Decentralized Identity: Leveraging blockchain for user identity verification could enhance security and privacy, reducing reliance on traditional authentication methods.

2. Advanced E-commerce Functionality:

Negotiation Mode: Since this is a marketplace, we are considering allowing buyers to be able to make an offer to the sellers and negotiate to get a price that seem fair to them.

Personalization and AI: Utilizing AI to provide hyper-personalized product recommendations, tailored shopping experiences, and AI-powered chatbots for instant customer service.

Social Commerce: Integrating more deeply with social media platforms to enable direct shopping experiences within social channels, as a significant portion of online shopping is expected to occur there by 2030 and i would love PurpleVerse to be among the frontrunners.

Immersive Shopping Experiences: Exploring Augmented Reality (AR) and Virtual Reality (VR) for virtual try-ons, product visualization, or even metaverse shopping experiences.

Enhanced Seller Tools: Providing sellers with more sophisticated analytics, marketing tools, and potentially advertising options within the platform.

Supply Chain Transparency: Leveraging blockchain to provide immutable records of product origin and journey, enhancing transparency and combating counterfeit goods.

3. Scalability and User Adoption:

Performance Optimization: Continuously optimizing the platform's performance to handle a growing number of users and transactions, especially as blockchain adoption increases.

User Education: As blockchain technology can be complex, continued focus on user-friendly interfaces and educational resources will be crucial for broader adoption.

Mobile Applications: Developing dedicated mobile applications for iOS and Android to provide a seamless experience for users on the go.

Built With

  • algorand
  • eslint
  • lucied
  • netlify
  • perawallet/connect)
  • postgresql
  • react
  • supabase
  • tailwind
Share this project:

Updates