Skip to content

connorads/happy-birthday-world

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

19 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Happy Birthday World

Get a personalised birthday countdown and happy birthday message ๐ŸŽ‚

  • Save/update name and date of birth
    • PUT /hello/Connor { "dateOfBirth" : "1997-08-04" }
    • 204 No Content
  • Return birthday related message
    • GET /hello/Connor
      • When Connor's Birthday is in 7 days:
        • { "message" : "Hello, Connor! Your birthday is in 7 days" }
      • When Connor's Birthday is today:
        • { "message" : "Hello, Connor! Happy Birthday!" }

Swagger UI

Environments

Happy Birthday World is deployed on Google Cloud Platform*
It's got the Swagger UI running so you can test it quite easily ๐Ÿ‘

Environment GitOps Repo Storage Status
Local ยฏ\_(ใƒ„)_/ยฏ PostgreSQL or in-memory mode
Staging razorbow-staging Connected to Staging Cloud SQL instance
Production razorbow-production Using in-memory mode (ephemeral)

* for as long as my credits last ... please don't hammer it ๐Ÿ˜…

Technologies

A non-exhaustive list of technologies used.

  • ASP.NET Core 2.1
  • Swagger / Swashbuckle.AspNetCore
  • xUnit
  • PostgreSQL / Google Cloud SQL
  • Kubernetes / GKE
  • NGINX
  • ChartMuseum (Helm)
  • Docker Registry
  • Jenkins
  • Monocular
  • Nexus
  • Fabric8

Jenkins-X

Jenkins X is a CI/CD solution for modern cloud applications on Kubernetes.
Push to master and the Jenkins-X platform will build, version, tag, and release the app to Staging.

If you want to promote a version of your app to production:
jx promote --version 0.0.9 --env production

Assumptions

Here are some assumptions that need to be validated by the "Product Owner" ๐Ÿ‘€

  • Leap-year babies are born on February 29th. We currently assume a birthday of February 28th on non-leap years for leap-year babies. But some "leapers" celebrate on March 1st [Wikipedia]
  • Dates of Birth in the future are invalid. We perform validation to ensure that the Date of Births entered on the API are not in the future because otherwise it's difficult to define the expected behaviour.
  • Name can be a maximum of 50 characters.

Todo

  • Deploy Cloud SQL proxy sidecar in Staging
  • Tidy up secrets: got a mix/repeat of DB secrets with env and volumes
  • Upgrade Swagger page to show example date format using C# XML comments
  • Connect Cloud SQL in "Production" (perhaps use PodPreset to define Cloud SQL Instances in deployment yaml command argument)
  • Automatically run tests as part of the build (dotnet docker best practices)
  • Add Database Health check
  • Return validation error message for when a DOB that is in the future is submitted (it already returns a bad request but without a reason)
  • Fix JX Pull request preview environment deployments
  • Many more ...