Skip to content

UpCloudLtd/example-todo-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

To-Do Demo App on UpCloud Starter Kit

A simple To-Do List app demonstrating how to build cloud applications on UpCloud's managed services.

Overview

This demo shows how to use UpCloud's managed services to create a small, scalable development environment.

Tech Stack

  • Runtime: Node.js on UpCloud Managed Kubernetes (UKS)
  • Database: UpCloud Managed PostgreSQL
  • File Storage: UpCloud Managed Object Storage for task attachments

Architecture:

UpCloud To-Do App Architecture

Prerequisites

  • UpCloud CLI upctl installed and provisioned with your UpCloud API Token
  • Kubernetes CLI kubectl installed

Installation

Deploy the app in two steps:

  1. Deploy the managed infrastructure
  2. Deploy the demo app

1. Deploy the Managed Infrastructure

Provision the infrastructure with upctl:

  upctl stack deploy starter-kit --name=mystack --zone fi-hel1

Note: Wait for about 7-8 to minutes for the resources to be provisioned — then save the credentials and configuration settings from the output:

KUBERNETES CLUSTER
  Set env:     export KUBECONFIG=/path/to/generated/kubeconfig.yaml
  ...

NETWORKING
  ...

MANAGED DATABASE
  ServiceURI:  postgres://<db-user>:<db-password>@<db-host>:<db-port>/<db-name>?sslmode=require
  ...

OBJECT STORAGE
  DomainName:  <bucket-domain>.upcloudobjects.com
  Bucket:      <bucket-name>
  AccessKey:   <access-key>
  SecretKey:   <secret-key>
  Region:      <region>
  ...

2. Deploy the Demo App

Clone this repository:

git clone https://github.com/UpCloudLtd/example-todo-app.git

Edit ./deploy/resources/secrets.yaml to add your configuration settings.

Your deploy/resources/secrets.yaml file should look like this:

apiVersion: v1
kind: Secret
metadata:
  name: dotfile-secret
stringData:
  # Database credentials. Use the connection URI format, and
  # (important) make sure to remove `?sslmode=require` from the end.
  DB_CONNECTION_URI: "postgres://user:****@host:****/dbname"

  # Object Storage credentials
  S3_BUCKET: "my-bucket-****"
  S3_ENDPOINT: "https://****.upcloudobjects.com"
  S3_ACCESS_KEY: "AKIA****C9K"
  S3_SECRET_KEY: "pDckl****JVN2FYV2YwUw"
  S3_REGION: "eu-****-1"

Configure kubectl for your cluster:

  export KUBECONFIG=/path/to/generated/kubeconfig.yaml

Deploy the app:

  kubectl apply -k ./deploy

This deploys the application and exposes it to the internet. Check the deployment status:

  kubectl get svc frontend-app-loadbalancer

Once ready, navigate to the URL shown in the output to access the app.