Note: The project and descriptions are in english, but the CoderDojo is in Austria -> german language. So the Discord messages are all in german.
Hello person, who is slightly interested in programming. This is our CoderDojo Workshop Planer
.
What? You don't know what that is? You don't even know what the CoderDojo
is?
Well here's a short summary about the CoderDojo and this project.
The CoderDojo is a programming club for kids and teens between 6 - 17 years in Linz/Leonding.
We meet every two weeks for our Regular CoderDojo
and every other week for a Playground.
You can work on a project yourself, with our mentors or with friends.
You don't have the slightest idea about programming?
Well don't worry, our mentors will help you and beginners are usually going to start with Scratch (if you want).
Since quarantine, we weren't able to do our usual CoderDojo meetings, so we changed it to online meetings
every week.
Before this glorious project, all the meetings had to be organized manually. It was a lot of work, because to create workshops, the admin/ mentors had to follow these steps:
- Workshop info were written in markdowns in "date folders" (more info below)
- These info were manually transfered to a MongoDB database
- Zoom meetings had to be created/ updated
- The info had to be displayed at the CoderDojo website
- Newsletters had to be sent out -> the data had to be transfered manually
- Mentor got emails with their workshop info and Zoom meeting URL/user/hostkey -> the data had to be transfered manually
If one mentor wanted to change something about their workshop, all these steps had to be repeated. It costed a lot of hard work/time and nerves.
So, our program automates these steps above with some nice features.
Explanation down below
Note: We seperate the program with the input file, so in this repository is our program, which is deployed to Azure via a GitHub Action
on a push
request and heres the link for the other repository, where the yml
files are in
- Basically you create a date folder
YYYY-MM-DD
- In the folder is a
yml
file with all the data we need for processing the workshop - The data is sent via GitHub
Webhook
to our Azure function (the program) on a push request - We get the body and transform the
Json into C#
- This data is sent to a
ServiceBus Topic
- The data is written into a
MongoDB database
via a subsciption method of the topic
Now we have the data in the database.
From the database the data is displayed on the workshop schedule on the CoderDojo website.
This is done with the method events
.
The website send a HTTP Trigger to this function, which sends the data back.
For only listing future meetings, there is a parameter in the URL called past
. It can be set true
or false
If you set the status
flag in the yml file to Scheduled
, Zoom meetings are going to be created or updated.
How is that done?
Well, we have 4 Zoom user available, so we send a GET
request to Zoom to get our users.
Then we check if the meeting already exists, so that we won't have it double.
Then we send a PATCH
if it already exists and a POST
request if not.
How do we check if it already exists?
If the yml file we have a shortCode
flag, where we write a word, with specifies that workshop.
In Zoom we write that flag in the describtion, so that we can find it later.
After we created/updated a meeting we write/update the attendance URL and the Zoom user the into our database.
For every upcoming event, the CoderDojo admin sends a newsletter where the workshops are listed. To automate this task too, there is a nice feature.
Basically the program reads the workshops from the database with a specific date filter from the url and transforms this into a html template, which it sends back and displays it.
The admin uses that template to transforms it via MailChimp
into a newsletter.
Our mentors get emails about their workshops. In those emails is the basic info listed like
- Title
- Begintime
- Endtime
- Description
- Zoom user
- Zoom URL
- Hostkey
The hostkey is for hosting the meeting, so we only send the mail to the first listed mentor. Why? Because there'll b e a conflict, if there are two hosts in a Zoom meeting.
We also send a ics
file with the mail. (A calender entry), that we also build with the workshop data.
To send the email, we use SendGrid
.
As URL parameter there's the date again.
To get the mentor's info, we created an extra collection in the database with the mentor's
- nickname
- firstname
- lastname
The CoderDojo also has a Discord server where all info for workshops are being posted. There are also channels, where you can communicate with mentors or other coders.
So, we implemented a Discord bot, which sends a specific message each time, the workshop is being updated.
How does it work?
During going through all workshops in our WriteEventToDB
function, we call methods from the DiscordBot
class and build a message with the data, we get from the workshop. The function BuildBotMessage
tests if any data was changed and creates a message, which we send to Discord. To send it to the correct channel we created a Webhook
.
If the title was changed, we appended certain emotes to the message, so that it looks nicer. Same for the time.
- Folder format must be
YYYY-MM-DD
like2020-07-16
- Create for every date a new folder
- File must be named
PLAN.yml
orplan.yml
. - It must be a
.yml
or.yaml
file. - Insert your workshop data in that file.
Do not create a file for every single workshop! Only one big file!
workshops:
- begintime: your time
endtime: your time
status: Draft/Published/Scheduled
title: yourtitle
targetAudience: your audience
description: |
your describtion
prerequisites: |
- your prerequisites + links
mentors:
- you
shortcode: your-shortcode
Parameter | Description |
---|---|
begintime | Syntax: 00:00 e.g 13:45 |
endtime | Syntax: 00:00 e.g 15:45 |
status | If the workshop is not fixed, set Draft , if you only want send it to the database, but don't want the Zoom meetings yet, set Published , if everythings correct and you want to create Zoom meetings, set Scheduled |
title | e.g Scratch |
targetAudience | e.g kids above 6 years |
description | Describe your workshop in some sentences |
prerequisites | If they need to install software |
mentors | Probably you Note: It's an array, so there can be more mentors in a workshop |
shortCode | A word that describes your workshop e.g Elektronikbasteln . Note: Your are not allowed to change the shortCode once you commited the file |
Note: Create for each mentor a new document
{
"nickname": "Someone's nickname",
"email": "someone@something.at",
"firstname": "Someone's firstname",
"lastname": "Someone's lastname"
}
Setting Parameter | Description |
---|---|
MONGOUSER |
Your username, you need to have admin rights |
MONGOPASSWORD |
Your password |
MONGODB |
The database name e.g. member-management-test |
MONGOCONNECTION |
A connection string, where your workshops are, for more details check the link down below |
MONGOCOLLECTIONMEVENTS |
The collection name of your workshop collection e.g. events |
MONGOCOLLECTIONMENTORS |
The collection name of your mentors collection e.g. mentor-info |
ServiceBusConnection |
Your have to create a Service-Bus-Connection to communicate with certain functions, for more details check the link down below |
GITHUBUSER |
Name of the repository where you create the yaml files e.g. coderdojo-linz/coderdojo-online |
ZOOMTOKEN |
Token is required to connect our software with Zoom |
EMAILAPIKEY |
ApiKey for the email connection |
EMAILSENDER |
Name of the email sender e.g. info@linz.coderdojo.net |