Giter Site home page Giter Site logo

wooodhead / sls-saving-early Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tpschmidt/sls-saving-early

0.0 1.0 0.0 860 KB

Get up early... or burn some money ๐Ÿ”ฅ

Home Page: https://saving-early.tpschmidt.com

Shell 14.69% TypeScript 54.91% HTML 12.40% HCL 11.85% SCSS 6.14%

sls-saving-early's Introduction

Get up early... or burn some money ๐Ÿ”ฅ

Switching from working 100% on-site to fully remote really does not help to get up early. This project will help... or make me homeless. ๐Ÿคทโ€โ™‚๏ธ

What this?

This is some small weekend project build with Terraform & Serverless Framework around AWS Lambda with a Twitter API integration.

Main purpose was besides having some coding fun is to punish me regularly if I miss to get up early in the morning, which I do basically every day since march 2020.

  • each day I have to check in before the judgement time is reached, else a tweet will be send with a link to the subdomain
  • the price is rolled randomly each day and will be between min_price & max_price (for me it's $1 & $25).
  • if I miss to check in, the first one to visit the subdomain & submitting his PayPal address will receive the price (this step is manual! ๐Ÿ™ƒ)

How to set up โ›ด

Create a config.json file on root and fill out the needed details (have a look on the sample.config.json):

  • domain_name - certificate name in ACM (us-west-1), add the certificate name here.
  • app_name - the name of the app, which will also be your subdomain
  • aws_account_id - your AWS account id. this is just to make sure not to apply your infra to some work account ๐Ÿคทโ€โ™‚๏ธ
  • api_secret - common secret between client & API
  • judgement_time_utc - UTC timestamp as hh:mm at which you want to be ready for work
  • min_price - minimum suffering for your PayPal account
  • max_price - max suffering
  • twitter_consumer_api_key - your consumer API key which you'll find in your Developer Dashboard @ Twitter
  • twitter_consumer_api_key_secret - API key Secret for Consumer Key
  • twitter_api_access_token - Access Token of your Twitter App
  • twitter_api_access_secret - Secret Token of your Twitter App
  • twitter_api_bearer_token - Bearer Token for your Twitter App

Also you need to add your environment.prod.ts / environment.ts to app/src/environments with apiSecret (secret from config) as well as backend (URL to backend)

After setting up the details you can do

  1. ./go apply-account prod to create the needed infra for the frontend
  2. ./go deploy-app to deploy the static frontend
  3. ./go deploy-sls to deploy the CloudFormation stack for the API
  4. sls create_domain to create the backend custom domain name in API Gateway

With ./go confirm you can check in each day before judgement time is over, so you don't have to pay your friends anything! ๐Ÿ™‹โ€โ™‚๏ธ

Side Notes ๐Ÿ’ซ

Weekend project most probably containing a lot of bugs and nasty code. Also, I'm no frontend expert, so this is really rudimentary. Be kind ๐Ÿ™€๐Ÿค—

sls-saving-early's People

Contributors

tpschmidt avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.