Skip to content
No description, website, or topics provided.
Python HTML Shell CSS Dockerfile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.cloudbuild Configure tutorial to be script deployable Oct 17, 2019
.util Update based on fresh-project testing Oct 17, 2019
docs Update note on trigger variables Oct 17, 2019
unicodex Cleanup import_from_vendor Oct 9, 2019
.dockerignore init Sep 10, 2019
.gcloudignore Configure tutorial to be script deployable Oct 17, 2019
.gitignore init Sep 10, 2019
CONTRIBUTING.md init Sep 10, 2019
Dockerfile init Sep 10, 2019
LICENSE init Sep 10, 2019
README.md Configure tutorial to be script deployable Oct 17, 2019
docker-compose.yml
manage.py init Sep 10, 2019
requirements.txt
settings.py Cleanup configuration requirements for deployment Oct 14, 2019

README.md

Unicodex

Let's build a demo application, using a whole bunch o' Google Cloud components. Let's make it just like emojipedia, but let's call it...

unicodex

Unicodex uses:

This repo serves as a proof of concept of showing how you can piece all the above technolgies together into a working project.

Steps

  1. Try the application locally optional
  2. Setup Google Cloud Platform environment
  3. Create a Cloud SQL Instance
  4. Create a Cloud Storage Bucket
  5. Create some Berglas Secrets
  6. First Deployment
  7. Ongoing Deployments
  8. Setup a Cloud Build trigger

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. Alternatively, you can enter this information manually from the django admin.

Service design - 1:1:1

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 postgres database. 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

With a few find/replace of some critical values, this setup can be converted to have multiple versions of the service each having their own database in a shared instance. More information for this can be found in the .util directory.

TODO

  • implement custom database name (as well as instance)
  • allow multiple CURRENT_HOST values (useful when handling custom domains)

Contributions

Please see the contributing guidelines

License

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

You can’t perform that action at this time.