/todo

Primary LanguageRuby

todo app

Intro

This is the code for a sample todo application written in ruby which uses either a mysql or postgres db.

Steps to deploy

The resources can be deployed either manually or using github actions. Prior to the deployment you need to be prepared.

Preparations

Make sure the values in values-prod.yaml and github worflow are appropriate before proceeding to deployment. Use this guide to set appropriate values.

Using github actions

This app can be deployed on kubernetes cluster using this github workflow.

Manually

You can manually deploy this app on kubernetes cluster using helm tool or you can locally run this app on your workstation as mentioned below.

Run with mysql

docker run --rm -p 3306:3306 -e MYSQL_ROOT_HOST=% -e MYSQL_ROOT_PASSWORD=123456 mysql/mysql-server
export DATABASE_URL=mysql2://root:123456@127.0.0.1:3306/todo_app

bundle install
bundle exec rake db:setup
rails s

Run with postgresql

docker run --rm -p 5432:5432 -e POSTGRES_PASSWORD=123456 postgres
export DATABASE_URL=postgresql://postgres:123456@127.0.0.1:5432/todo_app

bundle install
bundle exec rake db:setup
rails s

Post Deployment

Once you deploy the app, create AWS WAF rule for DDoS protection (rate limit rule) by following this guide and attach this WAF to Application load balancer created by your application's ingress resource.