Giter VIP home page Giter VIP logo

infiniteoo / wbdemo Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 80.82 MB

Game of Thrones character creator and card-battle RPG. Features automatic avatar image generation based on character's stats and lore. Utilizes Angular / TypeScript / TailwindCSS / Python / Flask / AWS : S3 & DynamoDB / OpenAI: DALL-E

Python 22.47% HTML 17.20% TypeScript 34.86% CSS 25.21% JavaScript 0.27%
angular aws card-game character-creator dall-e-api dynamodb game-of-thrones openai-api s3

wbdemo's Introduction

Game of Thrones Character Creator & Card Game

Demo for tech assessment / interview

This project was created to help deeply familiarize myself, and review previous attained knowledge of the various technologies included in this stack.

Tech Stack

  • Angular w/TailwindCSS
  • Python (w/Flask)
  • AWS: DynamoDB & S3 (w/boto3)
  • OpenAI DALL-E Generative AI
  • Three.js

Dashboard

Dashboard

Character Selection Screen

Choose a name, pick a house, a class, then roll some randomly generated stats. Dashboard

Generative AI

The first time you click your character's name on the list component (middle), an Open AI/DALL-E image is generated from the prompt we provide, which includes the character's details:

promptString = "This is a photo of a Game of Thrones character named " + data['name'] + ". They are a " + data['characterClass'] + " from the house " + data['house'] + ". They have " + data['strength'] + " strength, " + data['intelligence'] + " intelligence, and " + data['charisma'] + " charisma. Please generate a cool looking photo of them. overlay the character's name, house and stats. use house sigil as background."

    response = client.images.generate(
        model="dall-e-3",
        prompt=promptString,
        size="1024x1024",
        quality="standard",
        n=1,
    )

Before you make any AWS calls you will need to supply your authentication credentials. the easiest way is to install the Amazon CLI and do 'aws configure'. This setup should enable "automatic" AWS authentication within your app. You can always do the old skool way and feed your boto3.resource the credentials within the code. Ultimately I'll be wanting to deploy this project, so I will have to enable this method anyway, so chances are by the time you read this it's already integrated and I forgot to update the README.

After generation, the image is uploaded to an AWS S3 bucket, and the image URL link is written to the character's database row.

Dashboard

Battlefield

After a character is selected, you can now enter the battlefield. A random opponent is selected from our generated characters, in similar fashion to classic arcade games such as Street Fighter. All potential opponents are displayed in grayscale, and the app quickly cycles through each pontential oppenent by briefly increasing their size and color. The cycle ultimately slows down and lands on the chosen opponent.

Dashboard

The Battle

Finally, you and your opponent engage in mortal combat: Dashboard

Install Instructions

create a .env file in the root of your project and enter your OpenAI key.

Note: To generate images with DALL-E, you need to sign up and pay about four cents per image.

OPEN_AI=ENTER_YOUR_KEY_HERE

from your terminal:

git clone https://github.com/infiniteoo/wbdemo.git
cd wbdemo
pip install && python -m venv venv && source venv/Scripts/activation
cd client
npm install
ng serve

Your source command may end up pointing to a similar, but different filepath in the venv folder. Just look for activation.

wbdemo's People

Contributors

infiniteoo avatar

Watchers

 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.