Giter VIP home page Giter VIP logo

anaai's Introduction

anaai

Build Status License: MIT

ana.ai is a generative art platform for creating your own art as NFTs. The idea is to allow users to create their own art using different generative mathematical and AI models. It is live on Polygon and can be found here!

anaai-demo.mp4

How it is used:

  1. Copy image url you want to transform
  2. Accept the transaction in your metamask wallet
  3. Enjoy your generated image!

What happens in the background

  1. ana.ai listens for events on Ethereum
  2. When an event is received, a background job is triggered
  3. After the image is generated, it is uploaded to IPFS and the token is minted for you
  4. ana.ai emits another event to notify your browser that your image is successfully generated

Platform architecture

Architecture

Components

Contract

Contract defines what data we want to store on the blockchain and how to manipulate it. It is based on the ERC721 standard. For more information, check it out here.

Event listener

Event listener listens for events on the blockchain and triggers actions int the platform. When users pay for generating an image, a background job is triggered that generates the image. For more information, check it out here.

Job service

Service responsible for triggering background jobs that generate images. Requests are emmited via the event listener. Job service does the following:

  1. Stores the job request
  2. Published to redis to trigger a background job For more information, check it out here.

Job orchestrator

Task queue used for running background jobs. Implemented using Celery. Redis is used as a messaging queue and postgres is used as the result db. Job orchestrator is subscribed to redis and upon receiving a message starts a background job that does the following:

  1. Generate image
  2. Upload image to IPFS
  3. Post a mint token request to nft service For more information, check it out here.

NFT service

NFT service is responsible for all admin transactions for our contract. In this case, it's only used for minting NFTs for users. For more information, check it out here.

Client

Frontend application for interracting with the platform. Allows user's to pay for generating images and shows their gallery of generated images. For more information, check it out here.

Requirements

  1. Metamask wallet for testing and deploying contracts
  2. Alchemy for running blockchain nodes and interracting via API
  3. Pinata for storing images and token metadata
  4. Docker and docker-compose

Setup

  1. Deploy contract on Ethereum (or use an existing one)
  2. Setup environment variables for services (check .env.example of each service)
  3. docker-compose up build

Testing

Contract

  1. cd contract
  2. npm install
  3. npm test

NFT service

  1. cd nft-service
  2. docker build -t nft-service .
  3. docker run nft-service python -m pytest tests

Event listener

No tests yet.

Job service

  1. cd job-service
  2. docker build -t job-service .
  3. docker run job-service python -m pytest tests

Job orchestrator

  1. cd job-service
  2. docker build -t job-orchestrator .
  3. docker run job-orchestrator python -m pytest tests

Client

Not yet runnable through docker:

  1. yarn install
  2. yarn test

anaai's People

Contributors

vonum avatar kisfilip avatar besermenji avatar mariobasic avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.