DEV Community

Cover image for Part 4: DigitalOcean App Platform Hackathon Submission
Jonathan Harrison
Jonathan Harrison

Posted on

2 2

Part 4: DigitalOcean App Platform Hackathon Submission

This post is part of a series detailing my journey with golang from learning the language to entering the DigitalOcean App Platform Hackathon.

The app I built can be found on GitHub.

Part 4 details the DigitalOcean App Platform Hackathon submission and how it is deployed.

What I built

Category Submission

Random Roulette

App Link

N/A

Screenshots

Alt Text

Description

stock-checker is a golang app that spawns a task every hour to check whether any of the following UK retailers have an Xbox Series X console in stock:

This is done using a web automation library that navigates each site in a headless chromium browser.

If the app determines stock is available, a text message is sent using Twilio to the configured mobile number.

This is deployed to a DigitalOcean App Platform Worker using a Dockerfile.

Link to Source Code

GitHub

Permissive License

MIT

Background

See Part 1 of this series.

How I built it

See Part 3 of this series.

Hosting and deployment

This golang app is deployed using docker to a Worker component on DigitalOcean's App Platform.

The DO App is defined using an Application Reference specification which is shown below:

name: stock-checker-app
region: fra
workers:
- name: bg-worker-stock-checker
  github:
    branch: main
    deploy_on_push: true
    repo: JonJam/stock-checker
  dockerfile_path: Dockerfile
  instance_count: 1
  instance_size_slug: basic-xs
  envs:
  - key: SC_TWILIO_ENABLED
    scope: RUN_AND_BUILD_TIME
    value: "true"
  - key: SC_TWILIO_ACCOUNTSID
    scope: RUN_AND_BUILD_TIME
    type: SECRET
    value: ""
  - key: SC_TWILIO_AUTHTOKEN
    scope: RUN_AND_BUILD_TIME
    type: SECRET
    value: ""
  - key: SC_TWILIO_NUMBERTO
    scope: RUN_AND_BUILD_TIME
    type: SECRET
    value: ""
  - key: SC_TWILIO_NUMBERFROM
    scope: RUN_AND_BUILD_TIME
    type: SECRET
    value: ""
Enter fullscreen mode Exit fullscreen mode

This App was then deployed using doctl.

Originally I was going to use a Deploy to DigitalOcean button, however worker components are not currently supported.

Prior to this project, I wasn't familiar with Digital Ocean so using the App Platform was new to me. The resources I found useful are listed below:

Additional Resources / Info

-

Speedy emails, satisfied customers

Postmark Image

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay