Giter Club home page Giter Club logo

25-days-of-serverless's Introduction

25-days-of-serverless's People

Contributors

dependabot[bot] avatar stuartleaver avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

setland34

25-days-of-serverless's Issues

CHALLENGE 3: WEBHOOKS

Secret Santa's Furry Friends

'Tis the season for gift giving! Here at Microsoft HQ in Redmond, we're excited for our annual Secret Santa gift swap! Each employee who chooses to participate is assigned another coworker to give a gift to. Rather than put a price limit on gifts, though, Satya has decided that this year everyone is just going to send their favorite cute animal picture. To make sure people can't easily figure out who their Secret Santa is, he wants to make sure that all of the photos are stored in the same format (png) and are made available from a single database.

For this challenge, create a web service that gets called everytime a commit or push is made to a Github repository. If the commit has a file ending with .png, your service should take the URL to the image from Github and store it in whatever database you like.

CHALLENGE 19: IOT HUB AND DURABLE ENTITIES

Let's head over to the South of France where Julie and her colleagues have decided to prepare a special gift for all patients where she is working: custom-shaped inflatable balloons for the holidays! In order to make them, she'll need to inflate a LOT of balloons with the help of an air compressor and one 12 litres air tank.

Julie has some IoT devices that tell her when the air compressor is starting and stopping to fill the tanks. Can we write her a service that will compute the amount of air available and let her know if she has enough air for her balloons?

Let's assume that our compressor is filling a 12 litres air tank, at the rate of 25 bar (around 360psi) per minute. The max pressure of the tank is 200 bar. You'll need to deduce the actual pressure of the tank and the number of balloons Julie can inflate at any point in time, knowing each balloon consumes 0,6 bar of the air tank pressure.

A great way to model this would be to use the Azure IoT Hub. You can create some Azure Functions Durable Entities to model a "tank" or "compressor" entity, as well as another Azure Function

If you like physics: we have assumed the compressor is working at a rate of 18 m3/hour, and that a balloon is 4 litres inflated at 2 bar. With Boyle-Mariotte law (or Van der Walls equations), you should be able to do more precise calculations.

CHALLENGE 2: TASK SCHEDULER

Lucy's Dilemma

Today we find ourselves in Stockholm, where a little girl named Lucy needs our help!
Every December 13th, Lucy is tasked with wearing a crown with six lit candles and delivering coffee to all of her family members — her mother, father, sister, and brother. Each candle only lasts ten minutes before burning out, and she needs to be careful to keep the candles lit during the delivery time!

Lucy is somewhat forgetful, though, and the stolen servers mean Lucy's usual reminder app isn't working! With only a few weeks to go before her big night, Lucy is worried how she'll remember everything she needs to do and keep her timing in order. She thought about using sticky notes with color codes to remind her of the things she needs to do, but what if they get mixed up? How can she optimize her tasks using serverless technology?

CHALLENGE 9: AUTOMATE YOUR GITHUB ISSUES WITH HOLIDAY MAGIC

Bah humbug! Ebenezer Scrooge is miserable this holiday season. He never says thank you and this makes everyone sad, even Scrooge. Let's lift his spirits by saying thank you to everyone who contributes to his OSS projects on GitHub.

Do you feel good when someone says "thank you" when you contribute to a GitHub project? Let's use some holiday magic and serverless to automate this! After all, the holiday season is a time for smiling more and taking the time to say thank you to those around us.

We challenge you to automate creating a holiday themed "thank you" with serverless that replies to all issues created in one or more of your GitHub repositories

CHALLENGE 13: THE YULE LADS

Here in Iceland, the holidays are full of tricksy traditions. For the thirteen days leading up to Christmas, it's said that children are visited each night by one of the thirteen Yule Lads (Jólasveinar), a motley crew of trolls with their own distinct personalities. Kertasníkir, the Candle-Stealer, follows children and steals their candles, whereas Þvörusleikir, the Spoon-Licker, loves to steal wooden spoons and lick the food off of them. And the big scary Christmas cat Jólakötturinn will devour any children who haven't gotten a new piece of clothing as a Christmas gift!

Each night, children put out their shoes by the window. When that night's visiting Yule Lad shows up, they leave gifts in the shoes of nice girls and boys, and rotting potatoes for the naughty ones.

This year, the thirteen tricksters are ready to get a bit more tech-savvy! They'd like to use machine learning to generate jokes they can say to children. They have a big book of jokes to train a machine learning model to generate a new joke for them every time they need one. Use this sample dataset extracted from icanhazdadjoke api as a blob trigger to create a troll joke generator for our tricksters.

CHALLENGE 10: TIMER TRIGGER

Daily Aggregated Deals

In Italy, children hang stockings on their fireplace so that an older woman named Befana can place their gifts inside of them. Along with the gifts, Befana also places candy or coal in each stocking based on how good they were that year.

This year has been really busy for Befana so she hired you as an assistant to help move things along faster. While Befana was shopping for candy, she lost her glasses. Her replacement glasses will arrive before the night of Epiphany, when children will be expecting their gifts. This is very unfortunate for Befana because she hasn't finished her gift shopping yet!

Befana is relying on you to finish shopping for the remaining gifts. Befana is really particular about getting a good deal on her shopping and expects you to be the same. Luckily, this is a major time of year for shoppers and deal seekers! But how do you keep track of all of these deals?Let's make a daily digest of current deals of interest!

In today's challenge, you'll create a tool that finds deals of the day from Twitter and adds them to a static web page. A Logic App is great serverless solution for this!

CHALLENGE 12: CACHING

Today in London, Simona wants to send beautiful holiday cards to all her friends But since she's worried they won't arrive in time, she doesn't want to hand-write and mail each individual letter!

Instead, she wants to make each of her friends a personalized website containing a holiday letter for them! She plans on writing each letter as its own Markdown file, and needs a way to turn those into websites.

Create a service that reads Markdown text from GitHub (perhaps using the Gist API), parses the Markdown to HTML, and returns the HTML to the client.

As a bonus challenge: reading and parsing Markdown is a lot of work! To optimize, cache your responses and send cached versions of the processed Markdown.

CHALLENGE 21: SERVERLESS WORKFLOWS WITH DURABLE FUNCTIO

Last Minute Gift Registry

Oh no! The 🧝‍♀️🧝‍♂️ elves are upset. It's almost time to deliver gifts, but a glitch in the North Pole 💈 data center destroyed Santa's master registry list (should have backed it up to the cloud!). As a last minute effort to modernize North Pole operations, the lead developer elf decided to create a set of REST APIs to track gift registries. To create a sense of urgency and ensure the orders can be fulfilled, registries are only available for 5 minutes before they are automatically closed and sent for processing.

For this challenge, create a set of of WebHooks for managing registries. The WebHooks should support the following operations:

  • Open to create a new registry and return a unique identifier for that registry
  • Add to add an entry to the registry based on id (any text)
  • Finish to close a registry based on id
  • Stats to get the following stats: total registries (open or closed) and total items in the registry list (an aggregate across all registries)

If Finish is not called within 5 minutes after the registry is opened, it should automatically close regardless of whether any items have been added.

Bonus: Although not required for this challenge, it would be great to have a Peek WebHook to look at a registry and show if it is open or closed and what the contents are.

CHALLENGE 23: INSTRUMENTING FUNCTIONS

Ages ago, workers of a remote timber camp in Quebec wanted to meet their wives for the night of Christmas. The problem was that they needed to work the next day and their homes were hundreds of leagues away. They made a pact with the devil to run the Chasse-Galerie so that their canoe could fly through the air.

A flying canoe would surely allow them to get home and back before the night was over! However, as part of the deal, the workers are not allowed to curse or their soul would be claimed by the devil.

On their trip to their home, and back, we need to make sure that their canoe is still operational. Their worried wives will be monitoring if everything is okay. They will need to receive an alert if something happens.

For this scenario, the canoe will need an Health Check endpoint that will return a 200 if everything is okay or throw an exception if a worker has cursed on their voyage. The worker curses 10% of the time.

After that endpoint is up and running, you'll need to build something that can notify the flying lumberjacks' wives if things have gone horribly wrong. One choice might be to use Azure Application Insights.

CHALLENGE 24: SECURITY AND INTEGRITY

Today, we're heading to Gävle, Sweden. Though its purpose has changed over the years, current tradition has the Yule Goat pulling Father Christmas' sled to deliver presents. Every year since 1966, the Gävle Goat representing the Yule Goat has been set up at the Castle Square in Gävle. Every year, other folks follow a tradition of trying to destroy the Yule goat. It has had tremendous difficulty making it through the Yuletide unscathed, so Father Christmas wants to increase awareness through a marketing campaign. He wants you to create a social media bot that will surface content tagged with #gävlebocken, or that is shared directly through the campaign.

The only problem is that just as with the naughty elves who try to destroy the physical Yule goat, there are malicious actors trying to hijack and manipulate this campaign of good will. Implement some security precautions to make sure that those naughty elves aren't successful with the campaign and protect the bot's integrity. Azure Functions and Cognitive Services might be helpful to you.

Depending on how you choose to implement the necessary functionality revisiting previous challenges may help:

  • Challenge 11: Database Trigger
  • Challenge 15: Cognitive Services
  • Challenge 16: Continuous Integration and Continuous Delivery
  • Challenge 21: Orchestrating stateful serverless functions
  • Challenge 22: Separation of secret configuration from code with Azure Key Vault

CHALLENGE 7: API ENDPOINT - PICTURE CHALLENGE

December 7 marks the first day of the official Christmas season in Guatemala. Everybody is scrambling to get ready for the big la quema del diablo (burning of the devil) tonight — at 6pm sharp, everyone will start a bonfire to burn rubbish and items they don't need to cleanse their homes of evil

Here in Guatemala City, our friend Miguel is concerned about the environmental impact! The past few years, people have been burning a lot of rubber and plastic that makes the air dirty. Some places are switching to burning paper piñatas of the devil, but Miguel still wants to let people metaphorically cleanse their houses of specific items they don't want.

Let's help Miguel by building a web API that lets his neighbors search for images of things they want to get rid of. Build an application (e.g. a cloud function with a single endpoint) that takes text as an input and returns an image found on unsplash or another image platform.

CHALLENGE 1: A BASIC FUNCTION

Serverless Dreidel!

🎶 "I had a little dreidel

I made it out of sand

And when I tried to spin it

It crumbled in my hand!" 🎶

Your first stop is Tel Aviv, Israel, where everybody is concerned about Hanukkah! Not only have all the dreidels been stolen, but so have all of the servers that could replicate spinning a top!

Have no fear, though: you have the capability to spin not only dreidels, but to spin up serverless applications that can spin a dreidel just as well as you can!

Your task for today: create a REST API endpoint that spins a dreidel and randomly returns נ (Nun), ג (Gimmel), ה (Hay), or ש (Shin). This sounds like a great opportunity to use a serverless function to create an endpoint that any application can call!

https://25daysofserverless.com/calendar/1

CHALLENGE 18: WRAPPING THE PERFECT GIFT

Santa's Elves are wrapping all of this year's gifts and they're looking for an automated way to confirm that each has been wrapped properly. According to Santa, each present must be wrapped according to the following rules:

  1. Placed in a box
  2. Box is wrapped
  3. A bow / ribbon placed on top

Luckily Azure Cognitive Services offers an easy way to do this using the Computer Vision API!

Using Santa's example of a perfectly wrapped gift, the Computer Vision API confirms the following Tags:
[x] Box
[x] Gift Wrapping
[x] Ribbon
[x] Present

CHALLENGE 11: DATABASE TRIGGER

It's that time of the year when all children start wishing for something amazing to end up in their stocking!

After last week's challenge, Santa's servers are completely overwhelmed with requests from children!

To help him handle the load, your challenge today is to build him a system that takes in childrens' requests and stores them for later processing. Additionally, he wants his elves to be notified every time a new gift wish arrives. If each new wish was published to something like Slack or Microsoft Teams, that would be super helpful in keeping his elves on top of all the requests!

Santa needs an endpoint that receives data in this format:

  • a description of the wish
  • who it's from
  • address
  • type of present (e.g toy, clothes, animal etc..)

Santa should be able to query that database on his own (he's a bit of a micromanager — this helps keep him off the elves' back!), as well as having a message get posted to Slack or another chat service whenever data is added to the database.

As a bonus challenge: kids would love a nice UI to input their wishes. Help them by building a webpage with a form that submits data in the previous format!

CHALLENGE 4: API ENDPOINT

Here in Brooklyn, NY, Ezra wants to have a big holiday potluck before everyone travels home for the holidays! His tiny apartment can barely fit everyone in, but it's a cozy way to celebrate with friends. He usually uses an online spreadsheet to coordinate who's bringing what, to make sure there's varieties of food to meet all dietary needs.

But the grinch stole all the servers! So Ezra can't do that this year.

Build an HTTP API that lets Ezra's friends add food dishes they want to bring to the potluck, change or remove them if they need to (plans change!), and see a list of what everybody's committed to bring.

CHALLENGE 8: BUILD AN INCIDENT STATUS PAGE

It's December 8th and Santa and his team are hard at work preparing for the big night, including replacing many of the servers and applications that run the reindeer guidance and delivery systems.

If something goes wrong with any part of that critical system, they need a way to report the status of disruptions to everyone involved in a successful Christmas morning.
They need a basic version of what you can find at status.azure.com.

During these tense disruptions, elves are actively diagnosing and working as quickly as possible to bring important systems back online. While response and remediation efforts are underway, it's important everyone who has a stake in the successful delivery of gifts stay "in the know".
We are tasked with building a method for Santa and his team to communicate the current status of service disruptions to a global audience. A "Status Page" solution.

Challenge
Your challenge is to create a simple solution that helps inform elves and helpers all over the world when there is a problem with Santa's Reindeer Guidance & Delivery System - a "Status Page" to inform everyone what is known, what is being done, and when to expect additional information.

CHALLENGE 16: CONTINUOUS INTEGRATION AND CONTINUOUS DELIVERY FOR AZURE FUNCTIONS

We are only nine days away from Xmas... let the posadas begin!

It's the 16th of December, which can only mean one thing: Posadas are finally starting in Mexico! Everyone is already preparing for the following nine days of posadas and deciding on venues all across Mexico City for this festive tradition.

A couple of months back, Xanath offered to put together a list of hosts and locations so that all her friends and family had the details for each posada. With all the servers missing and so little time to collect the sites and inform everyone Xanath has asked some friends for help. They will all be working together to make a solution to help folks to find the location of the next posada.

The challenge

Your challenge is to create a simple solution for Xanath's friends and family to find the locations of the upcoming posadas as well as the name of the person hosting. Since there will be several people working on the project and adding locations at the same time, you need to make sure that the solution is accordingly updated and deploy to reflect these changes.

CHALLENGE 20: IOT WITH COGNITIVE SERVICES

Holiday traditions vary so much from place to place. But one unifying theme is that, in so many places, the holidays are about giving and receiving presents! For example, in Catalonia and in the Marshall Islands, children prepare pinata-like figurines stuffed with small presents. So for today's challenge, let's answer together one of the biggest questions children (and adults) will have in a few days: have the presents been delivered yet?

Your challenge today is to build a system the children can use to let them know when their gifts have arrived! Build a serverless system that can detect when gifts are present, and then sends a notification to the recipient letting them know their gift has arrived.

There are many different way to do this! If you have an IoT device like a Raspberry Pi, there are all sorts of sensors you can use to detect the presence of gifts: proximity sensors, weight sensors, or laser beams like in Hollywood movies!

If you don't have any IoT hardware, you can use something else you'll have easily available: a camera! You can build a web app that uses the HTML5 camera API, or a native mobile phone app, to take in computer vision input, and then build an AI to detect if a picture has a present in it or not. There are a lot of ways to build systems like this; if you haven't done anything like this before, you may want to take inspiration from challenge 18.

However you detect the presence of presents, you also have a number of choices for alerting when gifts have been delivered. Depending on your choice of devices, you may want to explore different services: web socket, mobile push notifications, or something else! One particularly interesting approach might be to use an IoT architecture (with tools like Azure IoT Hub) to signal the event across any "edge" device.

CHALLENGE 22: WINTER SOLSTICE – PROTECT SECRETS FROM GRIM REAPER!

Welcome to Korea in this festive season! Today is Winter Solstice, which means grim reapers are wandering around in search of young kids' souls to steal. But there's a way to keep the children safe: the reapers can't find any child who eats red-bean porridge before going to sleep!

porridge

Oh no! Cheol-soo missed the porridge tonight, and is in danger to get caught by the grim reaper! His best friend Young-hee locked him in a safe place until sunrise, and stored the digital key to the smart lock in Azure Key Vault.

memo

The grim reaper is annoyed that they're thwarted, though, and is trying to destroy the Key Vault to trap Cheol-soo in the safe room! Young-hee needs to figure out how to back up and restore the Key Vault before the Grim Reaper destroys it, or else Cheol-soo will be stuck in there forever!

Build a system that can back up and restore a secure key vault. If you're using Azure Key Vault, you may want to investigate Blob Storage restoration via Managed Identity.

CHALLENGE 14: STREAM PROCESSING

YULE BOOK FLOOD

It's that time of the year here in Reykjavík, Iceland: Jólabókaflóð!

For the "Yule Book Flood", instead of just giving gifts to each other, most Icelanders give each other books on Christmas Eve and then spend the evening reading!

Joon is too much of a social butterfly to read by himself all alone, though. While he and his friends are all sitting in their own homes reading, he wants to be able to talk to them about the various books they're enjoying!

Your challenge for today is to build Joon a real-time online chat service. It needs to be able to scale: if Joon's friends invite their friends, and they invite their friends, that could be a whole lot of people chatting about books! He and his friends should be able to log onto a web app where they can pick a username (and maybe even an avatar) and send chat messages that get sent in real-time to everyone else who's in the chat room.

Hint: you might want to look into Azure SignalR Service!

CHALLENGE 5: SMART APPS

Naughty or Nice

It's freezing cold up here on the North Pole, which normally makes it the ideal place to host a server farm. But today Santa's elves are freaking out!

Children all over the world write Santa letters to say what they want for Christmas. The elves had scripts running locally on the server farm to process the letters but without the missing servers this is no longer possible. Santa could translate manually, but he won't be able to get through all the letters in time!

Write a serverless application that helps Santa figure out if a given child is being naughty or nice based on what they've said. You'll likely need to detect the language of the correspondence, translate it, and then perform sentiment analysis to determine whether it's naughty or nice.
Have a look at the API https://aka.ms/holiday-wishes to find a sample of messages to validate whether your solution will work for Santa and his elves.

CHALLENGE 15: COGNITIVE SERVICES WITH COMPUTER VISION

Here in Munich, Germany, Felix is excited to go to a traditional Weihnachtsmarkt, a holiday market! He keeps texting photos to his friend Anna about all the fun things he's doing: drinking hot mulled Glühwein, going ice skating, shopping for presents. But Anna can't find her glasses, and can't clearly see what's in the pictures!

For today's challenge, Anna needs a service that, given an image, describe the image and gives some keywords about what it contains.

CHALLENGE 25: AUDIO TRANSCRIPTION

India is home to multiple religions and cultures, with everyone celebrating "Bada Din" (the big day) with flowers (poinsettias), lights (paper lanterns) and, most importantly, a family feast! The center of attraction is kheer, the traditional rice pudding with nuts, spices, milk and sugar.

Aarti is particularly excited this year because her entire family is coming over to her new place to celebrate with her. But she needs a good kheer recipe. And the best ones come from ajjis (grandmas) - but they don't like tech and prefer to just talk on the phone. How can she find the right recipe in time? Aarti's friends are on the case: we'll just record our grandmas telling us her recipe they say!

For today's challenge, help Aarti out by setting up the Bada Din Kheer Hotline! Make a service where her friends can upload recordings, that are then automatically converted into text transcripts and stored somewhere on the cloud for Aarti to quickly scan for ideas. Azure Functions, Cognitive Services, and Azure Storage might be helpful to you!

If you're feeling particularly eager, there are a few ways you can make things even easier for Aarti:

  • Stretch goal 1: Using a Twilio integration, alert Aarti whenever a friend uploads a new recipe
  • Stretch goal 2: Integrate translations, so her friends' ajjis can provide recipes in any language
  • Stretch goal 3: Build a web app that publishes the transcribed recipes as a nicely-formatted website

CHALLENGE 6: DURABLE PATTERN

Happy St. Nicholas Day! Here in the Styrian region of Austria, it's said that today is the day that St. Nicholas goes around handing out presents, while his evil counterpart Krampus whips those who have been naughty. These days, that mostly results in people giving each other bundles of ruten, bundles of birch twigs that have been painted gold.

You're supposed to hang up these ruten year-round to remind children to be good, but of course today's children don't spend much more time in online chats than sitting in front of the fireplace. Let's write a reminder tool using serverless tech that lets Austrian children set reminders to do good deeds in their favorite chat app!

Build a chat integration for your favorite chat service (e.g. Discord or Slack) that lets you schedule tasks using natural language (e.g. /schedule volunteer at the senior citizens' center tomorrow at 11:00). You should be able to get a confirmation that your event has been scheduled, and then get a notification at the correct time.

CHALLENGE 17: AZURE IOT HUB

Time for an Australian Christmas day BBQ on the beach

Skippy the Kangaroo and his mates, Kenny the Koala and Willy the Wombat, were very excited and looking forward to Christmas.

"Only a week to go!" said Kenny the Koala, "and I've been very good all year!"

Skippy and Willy looked at each other and rolled their eyes. "You haven't been THAT good," they thought. Skippy reminded his mates, "it’s not all about presents! My favourite part of Christmas is going to the beach, firing up the BBQ, having a nice cold beer, and relaxing with my friends and family. Let’s hope it's a sunny day!".

Your challenge is to build Skippy and his friends an Internet of Things system that helps let them know if it's a warm day at the beach. They want someting that can send them a tweet if it's currently warmer than 31°C (88° Fahrenheit) so they know whether or not to head all the way out to the beach for a truly Australian Christmas Day!

A tip: if you don't want to pull out a physical IoT device, you may want to use the Raspberry Pi Simulator to connect to the Azure IoT Hub.

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.