Giter VIP home page Giter VIP logo

cloudcomputing-180702039's Introduction

Which Pokemon are you?

About

A python-flask based web app leveraging on google cloud and kubernetes engine. The app is implements user based policies and hence requires users to sign up before using the same as the user based content management is implemented. It randomly chooses a pokemon and queries the cassandra database set up in the Google Cloud to collect the details of the pokemon and displays it dynamically. It also compliments the functionality by using an external pokemon api pokeapi to show the image of the pokemon.

Due to the recent increased prevelance of powerful hardware, such as modern GPUs, hashes have become increasingly easy to crack. A proactive solution to this is to use a hash that was designed to be "de-optimized".

The user access system uses flask-hashing for hashing of user passwords in a local database using SHA256 algorithm. It can also be extended to md5, sha1, sha224, sha256, sha384, and sha512. By default, HASHING_METHOD defaults to sha256 and HASHING_ROUNDS defaults to 1. The user credentials and info are stored in a local scalable SQLITE3.

If you are using anything less than Python 2.7.9 you will only have the guaranteed functions provided by hashlib. Python 2.7.9 or higher allows access to OpenSSL hash functions. The name you supply to HASHING_METHOD must be valid to hashlib. To get a list of valid names, supply a random string to HASHING_METHOD and check the output when initializing your application (it raises and exception), or check hashlib.algorithms for Python 2.7.8 or less, or hashlib.algorithms_available if using Python 2.7.9+.

Requirements:

  • python
  • pip
  • peewee
  • Flask
  • Flask==0.11.1
  • Flask-Login==0.3.2
  • Flask-SQLAlchemy==2.1
  • Flask-WTF==0.12
  • Jinja2==2.8
  • peewee==2.8.1
  • WTForms==2.1
  • pokepy
  • Flask-hashing
  • cassandra-driver

How To Install and Run the Project :

  • Install the Dependencies using pip install -r requirements.txt.

  • Run the project using python app.py.

  • App can be viewed at http://0.0.0.0:8080/

Setting up the hash before you run the application

  1. Create a file called config.py in the same directory as your app.py.
  2. Create a variable with a strong secret hashing password for example
token = `jabdadbhA4576GJLKDSHHOAUI.3KSDFH_75`

HATEOAS (Hypermedia as the Engine of Application State)

It is a constraint of the REST application architecture that keeps the RESTful style architecture unique from most other network application architectures. The term “hypermedia” refers to any content that contains links to other forms of media such as images, movies, and text.

This architectural style lets you use hypermedia links in the response contents so that the client can dynamically navigate to the appropriate resource by traversing the hypermedia links. This is conceptually the same as a web user navigating through web pages by clicking the appropriate hyperlinks in order to achieve a final goal.

When you try to make a get request like Based on the id, It queries the database and creates a dynamic JSON.

http://35.242.189.172/pokemon/36

It will return JSON in the form

{ POKEMON : Pikeachu Attack : 56 Defence : 78 Speed : 78 }

Docker image is available and you can run using the following command on gcloud:

kubectl run pokemon-app --image=gcr.io/pivotal-trail-229309/app11 --port 8080

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

cloudcomputing-180702039's People

Contributors

surendersampath 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.