- Notifications
You must be signed in to change notification settings - Fork24
License
GoogleCloudPlatform/django-demo-app-unicodex
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
✨unicodex ✨
Unicodex is a demo database-backed serverless Django application, that uses:
- Django as the web framework,
- Google Cloud Run as the hosting platform,
- Google Cloud SQL as the managed database (viadjango-environ),
- Google Cloud Storage as the media storage platform (viadjango-storages),
- Google Cloud Build for build and deployment automation, and
- Google Secret Manager for managing encrypted values.
This demo can be deployed by multiple different methods: via the Cloud Run button, through Terraform, or manually via a guided tutorial.
Seeapp.json and the.gcloud/ folder for implementation details.
- InstallTerraform and setupauthentication
- Use Terraform toprovision infrastructure
- Use Cloud Build to perform the initialdatabase migration
Seeterraform/ for configuration details.
- Try the application locally (optional)
- Setup yourGoogle Cloud environment, then provision backing services:
- aCloud SQL Instance,
- aCloud Storage Bucket, and
- someSecrets, then
- Run yourfirst deployment
- Automateongoing deployments (optional)
Don't forget tocleanup your project resources when you're done!
There are no current live deployments of this demo.
Emojipedia curates information about emoji and how they are represented on different platforms. E.g. theSparkles 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 lookvery different!)
In Unicodex, these relations are represented by acodepoint (Sparkles) having multipledesigns (images). Each image represents aversion from avendor (e.g. Google Android 9.0, Twitter Twemoji 1.0, ...). These relations are represented by four models:Codepoint,Design,VendorVersion andVendor, 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.
Unicodex runs as a Cloud Run service. Using the Python packagedjango-storages, it's been configured to take aGS_BUCKET_NAME as a storage place for its media. Using the Python packagedjango-environ it takes a complexDATABASE_URL, which will point to a Cloud SQL PostgreSQL database. Thesettings.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 isonly one service/database/bucket.
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
This repo was configured to automaticallybuild, migrate, and deploy unicodex via Cloud Build in different demo projects.
The different deployment methods (Terraform, Cloud Run Button, and manual) were tested weekly by creatingephemeral projects, deploying the application, testing it, then deleting the project. If the tests or deployment fails, the deletion doesn't happen and the issue can be investigated.
Feel free to use these implementations as a basis for your own processes, as with all other code in this repo.
Please see thecontributing guidelines
This library is licensed under Apache 2.0. Full license text is available inLICENSE.
About
Topics
Resources
License
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.
Contributors3
Uh oh!
There was an error while loading.Please reload this page.