Giter VIP home page Giter VIP logo

django-demo-app-unicodex's Introduction

unicodex

Unicodex is a demo database-backed serverless Django application, that uses:

Deployment

This demo can be deployed by multiple different methods: via the Cloud Run button, through Terraform, or manually via a guided tutorial.

Automated

Run on Google Cloud

See app.json and the .gcloud/ folder for implementation details.

Terraform

See terraform/ for configuration details.

Manual

Don't forget to cleanup your project resources when you're done!

Application Design

Unicodex itself

Emojipedia curates information about emoji and how they are represented on different platforms. E.g. the Sparkles emoji (✨) is mostly represented by three golden stars in a cluster, but this has changed over the years (click the sparkle image marked "Google" and you'll see how Sparkles has appeared in every version of Android over the years. It used to look very different!)

In Unicodex, these relations are represented by a codepoint (Sparkles) having multiple designs (images). Each image represents a version from a vendor (e.g. Google Android 9.0, Twitter Twemoji 1.0, ...). These relations are represented by four models: Codepoint, Design, VendorVersion and Vendor, respectively. Designs have a FileField which stores the image.

In the Django admin, an admin action has been setup so that you can select a Codepoint, and run the "Generate designs" actions. This will -- for all configured vendors and vendor versions -- scrape Emojipedia for the information, including uploading images. Alternatively, you can enter this information manually from the django admin.

Service design - one deployment per Google Cloud project

Unicodex runs as a Cloud Run service. Using the Python package django-storages, it's been configured to take a GS_BUCKET_NAME as a storage place for its media. Using the Python package django-environ it takes a complex DATABASE_URL, which will point to a Cloud SQL PostgreSQL database. The settings.py is also designed to pull a specific secret into the environment. These are all designed to live in the same Google Cloud Project.

In this way, Unicodex runs 1:1:1 -- one Cloud Run Service, one Cloud SQL Database, one Google Storage bucket. It also assumes that there is only one service/database/bucket.

This implementation is live at https://unicodex.gl.asnt.app/

Other service designs

It is possible to host multiple instances of Unicodex on the one project (where the service name, bucket name, and database name, and django database username have different appended 'slugs', and all share one instance), but this configuration is out of scope for this project.

You can host multiple versions of Unicodex using project isolation (one Google Cloud account can have multiple projects) without any code editing, but this may not work for your own project. Read more about project organisation considerations

Contributions

Please see the contributing guidelines

License

This library is licensed under Apache 2.0. Full license text is available in LICENSE.

django-demo-app-unicodex's People

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.