Building the fastest marketplace ever
Building the fastest marketplace involves solving challenges of scalability, real-time performance, and secure financial transactions. Gamification features add complexity, requiring seamless integration while maintaining speed and security.
The architecture of Spaace is the result of extensive thought and multiple iterations, involving both internal team members at Avicenne Studio and external experts. It was designed to address scalability challenges in terms of both features and user load.
The system is divided into microservices, all written in TypeScript using the Nest.js library, except for the front-end, which is built with React, and a specific “OpenRarity” microservice in Python with Flask. The latter was chosen due to technical limitations in calculating the entropy of NFT metadata, which is used to assign rarity scores.
These microservices are deployed using a serverless model, meaning they are containerized with Docker to start on-demand and shut down when idle, enabling horizontal scalability. When user demand spikes, multiple instances of each microservice can be spun up in milliseconds, ensuring smooth operation. Conversely, during low-traffic periods, costs are minimized by keeping only a few instances running.
To secure cryptographic secrets, Google Cloud Key Management Service (KMS) is used. This ensures that cryptographic keys never leave the secure environment, even when distributing rewards. Even if the backend is compromised, attackers cannot manipulate rewards, protecting the platform from significant financial loss. These keys are stored in highly secure data centers using Hardware Security Modules (HSM), certified by the National Institute of Standards and Technology (NIST).
Microservices communicate via Google Cloud Pub/Sub, a message broker that acts like a mailbox. Each microservice sends data to others through this queue system, ensuring messages are handled without overloading the receivers, even during high-traffic events. This system prevents message loss, crucial in environments with financial transactions.
A PostgreSQL database, hosted on Google Cloud SQL, stores all platform data, including NFTs, metadata, order books, and user progress. This setup allows for vertical scalability, where more computing power is allocated during peak times. Redis caching is employed to speed up retrieval of frequently accessed data, particularly for popular NFT collections, while TypeSense, an open-source search engine, powers the search functionality on the web interface, allowing users to find collections, users, or NFTs in milliseconds.

- Designed and deployed a microservices-based architecture utilizing TypeScript with Nest.js for most services, React for the frontend, and Python with Flask for the "OpenRarity" microservice.
- implemented a serverless infrastructure using Docker for containerization, enabling automatic scaling based on user demand, ensuring high availability while minimizing costs during low-traffic periods.
- Deployed and managed three environments (development, staging, and production) on Google Cloud Platform (GCP), fully automated using Terraform, ensuring seamless infrastructure scaling, consistency, and reproducibility across all stages of development.
- Integrated support for various wallets, allowing users to seamlessly connect and interact with the Spaace platform for NFT transactions.
- Developed Web3 interactions to enable users to buy and sell NFTs with a single click, leveraging pre-calculated cryptographic proofs, signed by users in their digital wallets to approve transactions.
- Created auction mechanisms for NFTs, offering various formats such as fixed price, Dutch auctions (declining price over time), and traditional English auctions, all governed by blockchain-based smart contracts.
- Indexed all existing NFTs, including their images, metadata, and statistical calculations, to ensure efficient display and processing within the platform.
- Designed a liquidity system for company tokens, enabling token holders to provide liquidity on an exchange and earn a share of transaction fees, with smart contracts ensuring automatic settlements in the case of liquidity withdrawal.
- Developed and deployed **18 smart contracts** governing various platform features, including NFT auctions, staking, liquidity management, and reward distributions.
- Built staking mechanisms where company revenues are proportionally redistributed to token holders, while maintaining sufficient liquidity for development and operational costs.
- Managed the Initial Coin Offering (ICO) for Spaace, allowing public sale of company “shares” via the blockchain. Smart contracts and Web3 infrastructure were developed to facilitate this.
- Built a rewards system for token holders, including voting rights and dividend-like distributions, based on the quantity of tokens held.
- Developed a user-friendly interface that simplifies Web3 interactions, allowing users to place buy/sell orders for NFTs, manage their token liquidity, and participate in platform activities like staking and auctions.
- Integrated a Loyalty Pass system, inspired by video game mechanics, offering users missions and quests to earn points and rewards such as company shares or bonuses.
- Built a secure backend using Google Cloud Key Management Service (KMS) to manage cryptographic secrets, ensuring secure transactions and reward distribution even in the event of backend compromise.
- Implemented Redis for caching frequently accessed data and TypeSense for quick searching across large NFT datasets, ensuring fast response times on the platform.
Building the fastest marketplace ever
Building the fastest marketplace involves solving challenges of scalability, real-time performance, and secure financial transactions. Gamification features add complexity, requiring seamless integration while maintaining speed and security.
The architecture of Spaace is the result of extensive thought and multiple iterations, involving both internal team members at Avicenne Studio and external experts. It was designed to address scalability challenges in terms of both features and user load.
The system is divided into microservices, all written in TypeScript using the Nest.js library, except for the front-end, which is built with React, and a specific “OpenRarity” microservice in Python with Flask. The latter was chosen due to technical limitations in calculating the entropy of NFT metadata, which is used to assign rarity scores.
These microservices are deployed using a serverless model, meaning they are containerized with Docker to start on-demand and shut down when idle, enabling horizontal scalability. When user demand spikes, multiple instances of each microservice can be spun up in milliseconds, ensuring smooth operation. Conversely, during low-traffic periods, costs are minimized by keeping only a few instances running.
To secure cryptographic secrets, Google Cloud Key Management Service (KMS) is used. This ensures that cryptographic keys never leave the secure environment, even when distributing rewards. Even if the backend is compromised, attackers cannot manipulate rewards, protecting the platform from significant financial loss. These keys are stored in highly secure data centers using Hardware Security Modules (HSM), certified by the National Institute of Standards and Technology (NIST).
Microservices communicate via Google Cloud Pub/Sub, a message broker that acts like a mailbox. Each microservice sends data to others through this queue system, ensuring messages are handled without overloading the receivers, even during high-traffic events. This system prevents message loss, crucial in environments with financial transactions.
A PostgreSQL database, hosted on Google Cloud SQL, stores all platform data, including NFTs, metadata, order books, and user progress. This setup allows for vertical scalability, where more computing power is allocated during peak times. Redis caching is employed to speed up retrieval of frequently accessed data, particularly for popular NFT collections, while TypeSense, an open-source search engine, powers the search functionality on the web interface, allowing users to find collections, users, or NFTs in milliseconds.

- Designed and deployed a microservices-based architecture utilizing TypeScript with Nest.js for most services, React for the frontend, and Python with Flask for the "OpenRarity" microservice.
- implemented a serverless infrastructure using Docker for containerization, enabling automatic scaling based on user demand, ensuring high availability while minimizing costs during low-traffic periods.
- Deployed and managed three environments (development, staging, and production) on Google Cloud Platform (GCP), fully automated using Terraform, ensuring seamless infrastructure scaling, consistency, and reproducibility across all stages of development.
- Integrated support for various wallets, allowing users to seamlessly connect and interact with the Spaace platform for NFT transactions.
- Developed Web3 interactions to enable users to buy and sell NFTs with a single click, leveraging pre-calculated cryptographic proofs, signed by users in their digital wallets to approve transactions.
- Created auction mechanisms for NFTs, offering various formats such as fixed price, Dutch auctions (declining price over time), and traditional English auctions, all governed by blockchain-based smart contracts.
- Indexed all existing NFTs, including their images, metadata, and statistical calculations, to ensure efficient display and processing within the platform.
- Designed a liquidity system for company tokens, enabling token holders to provide liquidity on an exchange and earn a share of transaction fees, with smart contracts ensuring automatic settlements in the case of liquidity withdrawal.
- Developed and deployed **18 smart contracts** governing various platform features, including NFT auctions, staking, liquidity management, and reward distributions.
- Built staking mechanisms where company revenues are proportionally redistributed to token holders, while maintaining sufficient liquidity for development and operational costs.
- Managed the Initial Coin Offering (ICO) for Spaace, allowing public sale of company “shares” via the blockchain. Smart contracts and Web3 infrastructure were developed to facilitate this.
- Built a rewards system for token holders, including voting rights and dividend-like distributions, based on the quantity of tokens held.
- Developed a user-friendly interface that simplifies Web3 interactions, allowing users to place buy/sell orders for NFTs, manage their token liquidity, and participate in platform activities like staking and auctions.
- Integrated a Loyalty Pass system, inspired by video game mechanics, offering users missions and quests to earn points and rewards such as company shares or bonuses.
- Built a secure backend using Google Cloud Key Management Service (KMS) to manage cryptographic secrets, ensuring secure transactions and reward distribution even in the event of backend compromise.
- Implemented Redis for caching frequently accessed data and TypeSense for quick searching across large NFT datasets, ensuring fast response times on the platform.