SlideShare a Scribd company logo
@stadolf @coding_earth
Hack it like it’s hot 😅
a 1 year hackathon wrap up
2
Stefan Adolf
Developer Ambassador
#javascript #mongodb #serverless
#blockchain #codingberlin #elastic
#aws #php #symfony #react
#digitalization #agile #b2b #marketplaces
#spryker #php #k8s #largescale
#turbinejetzt #iot #ux #vuejs
@stadolf
elmariachi111
@stadolf @coding_earth
Hackathons. They’re all the same.
1. You pitch an idea
2. you find friendly team mates
3. you hack 40 hours
4. you present what you’ve done.
5. you do a team selfie
@stadolf @coding_earth
Buy By ID
Self sovereign identity meets eCommerce
T-Labs Blockchain Group - “Decentralizing the Enterprise” - Jan 2019
@stadolf @coding_earth
Challenge: Self Sovereign Identity
•authenticate / SSO by using an
identity under your control
•enabled by self signed DID
documents on Ethereum
•support verifiable claims
• “my government claims that
I’m Stefan and over 21”
1. You pitch an idea
@stadolf @coding_earth
Buy By ID: Idea
•add a “login with your identity” button to an headless shop system
•integrate with Vue Storefront (headless adapter for Magento e.a.)
•use Jolocom’s Smart Wallet for claim exchange
2. you find friendly team mates
3. you hack 24 hours
@stadolf @coding_earth
Tools / APIs
•Jolocom: Typescript
•Vue Storefront: ECMAScript / Vue
•node / express, Redis & socket.io
@stadolf @coding_earth
Brainkillers / pitfalls
•Both projects rely on Redis (VSF: cache, Jolocom: wallet storage)
•Jolo’s samples rely on socket.io to detect phone activities (QR scanned)
•socket.io can’t be bound to express apps (only to a http.Server inst)
• socket.io relies on https
•had to activate body parser on VSF
•conflicting build setup (Jolocom / VSF) - had to align start scripts / ts-node
•asynchronous calls conflicts with express route wiring
@stadolf @coding_earth
bind Jolocom backend to VSF
const { getAsync, setAsync, delAsync } = configureRedisClient()
const registry = JolocomLib.registries.jolocom.create()
const vaultedKeyProvider = new JolocomLib.KeyProvider(seed, password)
module.exports = async (expressApp: Express, server: http.Server) => {
const identityWallet = await registry.authenticate(vaultedKeyProvider, {derivationPath:
JolocomLib.KeyTypes.jolocomIdentityKey, encryptionPass: password})
configureRoutes(expressApp, {setAsync, getAsync, delAsync}, identityWallet, password)
configureSockets(server, identityWallet, password, new DbWatcher(getAsync), {getAsync, setAsync, delAsync})
return identityWallet
}
const configureRoutes = (app: Express, redisApi: RedisApi, iw: IdentityWallet, password: string) => {
/**
* An authentication endpoint route for deep linking for demo-sso-mobile;
*/
app.get('/mobile/credentialRequest', async (req, res, next) => {
…
@stadolf @coding_earth
listen to smart wallet events in Vue
continueWithJolo () {


const randomId = randomString(8);
this.getQrCode(randomId).then(image => {
this.$bus.$emit('modal-show', 'modal-jolo-user', null, 

{image: image})
this.awaitUserData(randomId).then(data => {
const parsed = JSON.parse(data)
const userData = parsed.data
this.personalDetails = {
firstName: userData.givenName,
lastName: userData.familyName,
}
this.$bus.$emit('modal-hide', 'modal-jolo-user')
this.sendDataToCheckout()
})
}).catch(err => {
console.log(err)
})
},
awaitUserData(randomId: string): Promise<string> {
const socket = io(`/sso-status`, {
query: { userId: randomId }
})
return new Promise<string>(resolve => {
socket.on(randomId, (data: string) => resolve(data))
})
}
/* server: http.Server */
const baseSocket = io(server).origins('*:*')


baseSocket.of('/sso-status').on('connection', async socket => {
const { userId } = socket.handshake.query
console.log(`sockets.ts: waiting until ${userId} logs in`)
dbWatcher.addSubscription(userId)
dbWatcher.on(userId, async () => {
const userData = await getAsync(userId)
await delAsync(userId)
socket.emit(userId, userData)
})
})
getQrCode (randomId: string) {
const socket = io('/qr-code', {query: { userId: randomId } })
return new Promise<string>(resolve => {
socket.on(randomId, (qrCode: string) => resolve(qrCode))
})
},
Wait for auth Redis
Checkout form
4. you present what you’ve done.
@stadolf @coding_earth
Demo
5. you do a team selfie
@stadolf @coding_earth
💡team building
•find your team ahead of the event if possible
•be very careful of people who
• consider themselves “very senior” (they’re not pragmatic)
• are “designers” without knowing CSS (“Photoshoppers”)
• talk about everything but the hackathon (just want to hire you)
•first thing you do: agree on a messenger protocol (Slack) / channel
@stadolf @coding_earth
Tech Tinder
Customize your Tech radar
Schwarz Group - “CodeCamp Heilbronn” - Nov 2018
@stadolf @coding_earth
Challenge
•“Schwarz group”: 2nd largest grocery / supermarket in Germany / LIDL
• ~500 developers over the world
• no one knows all requirements
•Build a tool that helps their dev teams to keep track of their tech stack
1. You pitch an idea
@stadolf @coding_earth
Idea: Tech-Tinder
•a tech radar controlled by employees
•everyone can add new technologies
•vote on technologies using a “tinder” interface
2. you find friendly team mates
3. you hack 36 hours
@stadolf @coding_earth
Tools / APIs
•Backend: MongoDB Atlas / Stitch (FaaS)
•Frontend: Vue.js / Bueify
•integrate “swing” swiping library (vue-swing2)
•copy / paste and adjust Zalando’s TechRadar project
@stadolf @coding_earth
stitch FaaS editor
@stadolf @coding_earth
technology_aggregate.js (stitch)
exports = function(technologyId){
const colTech = context.services.get("mongodb-atlas").db("tech-
tinder").collection("technology");
const colVotes = context.services.get("mongodb-atlas").db("tech-
tinder").collection("votes");
const aggregationPipeline = [
{"$group": {
"_id": { tech: "$ref", opinion: "$op" },
"total": { "$sum": 1 }
}
},
{"$group": {
"_id": "$_id.tech",
"count": {"$sum": "$total"},
"stats": {
"$push": {
op: "$_id.opinion",
total: "$total"
}
}
}
}
];
var pipeline;
if (technologyId) {
pipeline = [{$match:{ref: BSON.ObjectId(technologyId)} }]
.concat(aggregationPipeline);
} else {
pipeline = aggregationPipeline;
}
return new Promise( (resolve, reject) => {
//let technology = colTech.findOne({_id: techId});
colVotes.aggregate(pipeline).toArray().then(ag => {
const techIds = ag.map(agg => agg._id); //stitch doesnt
support $lookup
colTech.find({_id: {"$in":
techIds} }).toArray().then(technologies => {
const combined = ag.map(agg => {
let base = technologies.filter(tt => {
return tt._id.toString() == agg._id.toString();
})[0];
if (!base) {
return null;
}
base.votes = {
total: agg.count,
results: {}
};
agg.stats.forEach(s => base.votes.results[s.op] =
s.total );
return base;
});
resolve(combined.filter(c => c != null));
});
});
});
};
@stadolf @coding_earth
vote.js (“tinder”)
<div class="container" v-if="technologies.length > 0">
<span class="tag is-info is-large tag-hint tag-top" :style="{ opacity: opacity.top }">interested</span>
<span class="tag is-info is-large tag-hint tag-left" :style="{ opacity: opacity.left }">discouraged</span>
<span class="tag is-info is-large tag-hint tag-right" :style="{ opacity: opacity.right }">using</span>
<span class="tag is-info is-large tag-hint tag-bottom" :style="{ opacity: opacity.bottom }">evaluating</span>
<div class="card-viewport">
<div class="card-stack">
<vue-swing
v-for="technology in technologies"
:key="technology._id"
:config="cardConfig"
@throwout="throwout"
@throwin="throwin"
>
<div class="card card-item" :data-key="technology._id" >
<div class="card-image">
<figure class="image">
<h1 class="title is-3">{{ technology.name }}</h1>
</figure>
</div>
<div class="card-content">
<p class="is-5" v-html="technology.description"/>
</div>
</div>
</vue-swing>
</div>
</div>
</div>
4. you present what you’ve done.
@stadolf @coding_earth
Demo
5. you do a team selfie
@stadolf @coding_earth
👍 hackers’ rules of thumb
•you can’t learn a new language during a hackathon
•use as much SaaS and PaaS services as possible
• Contentful, Heroku, AWS Lambda / RDS, Firebase, now.sh, netlify
•never do “microservices”
•use DX-friendly frontend tech stacks
• vue-cli, create-react-app, Gatsby, ionic
•don’t to TDD!
@stadolf @coding_earth
Green Fee
let drivers pay for their air pollution in real time
“Blockchain Hackathon Stuttgart 2” - Feb 2019
@stadolf @coding_earth
Challenge
•sponsored by huge German banks, Daimler, blockchain agencies
•improve “mobility” with ledger tech
• other challenges were “Industry 4.0 / IoT”, “Finance”
•they expect a “business” presentation 🙄
1. You pitch an idea
@stadolf @coding_earth
Idea: Green Fee
•track vehicles’ motion
•track environmental conditions (current air pollution ratio)
•price = constant * (your pollution / environmental pollution)
•track your pollution cost in “real time”
•compensate “the planet” in near realtime
2. you find friendly team mates
3. you hack 40 hours
@stadolf @coding_earth
Tools / APIs
•IOTA MAM (Masked Authenticated Messaging)
• write pollution costs onto an IOTA DAG ledger MAM
• every message contains an due amount of IOTA
• asnychronous process polls MAM stream and triggers payments
•open air pollution data service
• public.opendatasoft.com
•Leaflet / OSM / plain jQuery, Webpack Encore for fast asset building
•expressjs as backend
@stadolf @coding_earth
– The official IOTA project
It is possible to publish transactions to the Tangle that contain only messages, with no value. This
introduces many possibilities for data integrity and communication, but comes with the caveat that
message-only signatures are not checked. What we introduce is a method of symmetric-key
encrypted, signed data that takes advantage of merkle-tree winternitz signatures for extended
public key usability, that can be found trivially by those who know to look for it.
@stadolf @coding_earth
– Alexey Sobolev, Oct 2017
“The ID published to the tangle is the hash
of the hash of the message key seed.”
🤔
@stadolf @coding_earth
publish.js
const Mam = require('@iota/mam/lib/mam.client.js')
const { asciiToTrytes } = require('@iota/converter')
const fs = require("fs");
const mamState = Mam.init(config.provider, config.seed);
const lastState = fs.existsSync(LAST_STATE_FILENAME) ? fs.readFileSync(LAST_STATE_FILENAME).toString() : null;
if (lastState) {
mamState.channel = JSON.parse(lastState);
}
app.post('/msg', async function (req, response) {
var t = new Date()
const payload = {
d: t.toLocaleDateString() + " " + t.toLocaleTimeString(),
data: req.body
};
const trytes = asciiToTrytes(JSON.stringify(payload))
const message = Mam.create(mamState, trytes)
await Mam.attach(message.payload, message.address, 3, 9)
if (!mamState.channel.currentRoot) {
mamState.channel.currentRoot = message.root;
}
mamState.channel.lastRoot = message.root
fs.writeFileSync(LAST_STATE_FILENAME, JSON.stringify(mamState.channel))
response.json(mamState)
})
4. you present what you’ve done.
@stadolf @coding_earth
Demo
5. you do a team selfie
@stadolf @coding_earth
💡ideation
•if there are “sponsors”, select 1 with an API you can relate with
•don’t put all the sponsors’ APIs in one app
•do a design thinking session
• plan your idea for 2-3 hours!
•remove everything that’s not absolutely necessary
•do a “good looking” UI that’s responsive and usable on mobile
• vuetify, MUI, ionic, Bueify, Reactstrap
@stadolf @coding_earth
Blockstagram
Instagram on the blockchain
“Blockstack Hackathon Berlin” - Mar 2018
@stadolf @coding_earth
Challenge
•build something meaningful with “Blockstack”
•self sovereign “blockstack.id": a socially / stake backed identity (BTC)
•use their “Gaia” hub: file storage decentralization concept (~IPFS / Storj)
• P2P synced decentralized storage. 

Bring your own cloud or trust Blockstack
1. You pitch an idea
@stadolf @coding_earth
Idea: Blockstagram
•“Instagram” on Blockstack
•Upload your pictures to Gaia hub (controlled by you)
•acknowledge “friend” identities for read access
•provide a symmetric key for them to decrypt your images
•to unfriend (hide) someone, reencrypt all the images with a new key
2. you find friendly team mates
3. you hack 36 hours
@stadolf @coding_earth
Tools / APIs
•Blockstack
• Identity & Gaia Hub
•ReactJS / CRA (ejected)
•Netlify deployment
@stadolf @coding_earth
read your friend’s instagram data
async readSingleSubscribersImages(username) {
const indexData = await blockstack.getFile('index.json', {
username: username,
decrypt: false
})
const data = JSON.parse(indexData);
console.log('Subscribers indexData is', indexData);
data.images.forEach(async indexEntry => {
if (!this.subscriberImageLoaded({ ...indexEntry, username })) {
const imageData = await blockstack.getFile(indexEntry.path, { username,
decrypt: false })
this.updateFeed({ path: indexEntry.path, username: username, image:
imageData, created: indexEntry.created });
}
})
}
4. you present what you’ve done.
@stadolf @coding_earth
Demo
5. you do a team selfie
@stadolf @coding_earth
💡task distribution
•is very hard since you don’t know / trust each other
•one (experienced) guy must control the repo
• everyone must commit to the same repo!
•mock it till you make it
• https://www.mockbin.org
• use postman shared collections
•“I’m done, what can I do next?” -> “I’m done. I’d like to add xyz”
@stadolf @coding_earth
Survival Guides
Bonus
@stadolf @coding_earth
2pm: the idea wasteland
•talk to others and listen closely
•you may steal and reiterate their ideas!
• Most likely you’ll build sth else anyway!
•google the APIs and find related Stackoverflow questions
•try to come up with a real problem that you personally could have
😩
@stadolf @coding_earth
8pm: the desperation zone
•you will not get done anything until 8pm. That’s normal!
•Pair! Sitting next to each other always helps.
•look at the other teams. You’ll note that they’re also struggling *very* hard
•don’t argue or overthink! Do!
• you usually will never look back at the code!
•if you want to win: get rid of people who disturb the team. (Just ignore them)
•if you want to learn / earn karma points: discuss it out with them
🤯
@stadolf @coding_earth
4am: the blue hour of devastation
•things will start to work when you’re most desperate and expect it least
•stay awake!
• Fresh air, do a break every 10m if necessary. But stay on it!
• Bananas and cold pizza work better than coffee and Red Bull.
•tiredness goes away around ~8am (and punches you out by 1pm)
•do some simple tasks (e.g. frontend polish) for success feelings
☠
@stadolf @coding_earth
10am: prepare your presentation
•select one dedicated presentation guy
•usually your presentation will win the game, not your code
•build a story
• “my friend Dyrk called me yesterday and we’re solving his problem here”
•fake the demo if necessary but make it run!
•have 1 WOW effect
•skip “market research”, “business model” and “rollout strategy”
💁
@stadolf @coding_earth
too long, didn’t listen.
•Hackathons are for pragmatic developers, not clean coders
•solve as much as possible on the frontend (learn React or Vue & node!)
•it’s really a “thon”: you need to suffer to take away the grand prize
•it’s incredibly rewarding when your demo starts working at 4am
•the more tools and services you use, the better.
•people will remember you. Everything happens for a reason.
•never give up, never surrender.
6. not winning makes you weirder!
@stadolf @coding_earth
That’s all, folks
Stefan Adolf

https://www.facebook.com/stadolf

https://twitter.com/stadolf

https://github.com/elmariachi111

https://www.linkedin.com/in/stadolf/

More Related Content

PPT
Fiware IoT Proposal & Community
PPTX
Developing your first application using FI-WARE
PPTX
Context Information Management in IoT enabled smart systems - the basics
PPTX
Fiware IoT_IDAS_intro_ul20_v2
PPT
Fiware io t_ul20_cpbr8
PPTX
Azure Digital Twins
PDF
FIWARE Developers Week_BootcampWeBUI_presentation1
PPT
Io t idas_intro_ul20_nobkg
Fiware IoT Proposal & Community
Developing your first application using FI-WARE
Context Information Management in IoT enabled smart systems - the basics
Fiware IoT_IDAS_intro_ul20_v2
Fiware io t_ul20_cpbr8
Azure Digital Twins
FIWARE Developers Week_BootcampWeBUI_presentation1
Io t idas_intro_ul20_nobkg

Similar to Hack it like its hot! (20)

PPTX
Expanding APIs beyond the Web
PDF
Testing API platform with Behat BDD tests
PPSX
Automated malware analysis
PDF
Flare - tech-intro-for-paris-hackathon
PDF
IstSec'14 - İbrahim BALİÇ - Automated Malware Analysis
PDF
Scaffold your dApp with ink!athon
PDF
BigchainDB: Blockchains for Artificial Intelligence by Trent McConaghy
PDF
OWASP SF - Reviewing Modern JavaScript Applications
PDF
Dev fest 2020 taiwan how to debug microservices on kubernetes as a pros (ht...
PDF
A tech writer, a map, and an app
PDF
Playing with parse.com
PDF
Building a dApp on Tezos
PPTX
Getting started with Appcelerator Titanium
PPTX
Getting started with titanium
PPTX
Building AR and VR Experiences for Web Apps with JavaScript
PDF
Demystifying Apple 'Pie' & TouchID
PDF
Algorand Educate: Intro to Algorand
PDF
NativeScript: Cross-Platform Mobile Apps with JavaScript and Angular
PDF
Hacking your Droid (Aditya Gupta)
PDF
Swift on Raspberry Pi
Expanding APIs beyond the Web
Testing API platform with Behat BDD tests
Automated malware analysis
Flare - tech-intro-for-paris-hackathon
IstSec'14 - İbrahim BALİÇ - Automated Malware Analysis
Scaffold your dApp with ink!athon
BigchainDB: Blockchains for Artificial Intelligence by Trent McConaghy
OWASP SF - Reviewing Modern JavaScript Applications
Dev fest 2020 taiwan how to debug microservices on kubernetes as a pros (ht...
A tech writer, a map, and an app
Playing with parse.com
Building a dApp on Tezos
Getting started with Appcelerator Titanium
Getting started with titanium
Building AR and VR Experiences for Web Apps with JavaScript
Demystifying Apple 'Pie' & TouchID
Algorand Educate: Intro to Algorand
NativeScript: Cross-Platform Mobile Apps with JavaScript and Angular
Hacking your Droid (Aditya Gupta)
Swift on Raspberry Pi

More from Stefan Adolf (20)

PDF
Blockchains - Technical foundations
PDF
HOW TO SURVIVE A 2DAY HACKATHON?
PDF
Digitale Selbstbestimmung mit Hilfe dezentraler Technologien
PDF
Digitale Selbstbestimmung | Anwendungsfälle der Dezentralität
PDF
Decentralized technology: a (short) survey
PDF
Productive web applications that run only on the frontend
PDF
DePA - die dezentrale Patientenakte (29.1. FU Berlin)
PDF
DePA - die dezentrale Patientenakte
PDF
Was ist eine Datenbank - und was hat Blockchain damit zu tun?
PDF
Never Code Alone: Von Symfony Forms zu einer SPA auf APIs
PDF
Decentralize all the things
PDF
Indexing Decentralized Data with Ethereum, IPFS & The Graph
PDF
Gatsby (Code.Talks) 2019
PDF
A micro service story
PDF
Api Platform: the ultimate API Platform
PDF
Pump up the JAM with Gatsby (2019)
PDF
api-platform: the ultimate API platform
PDF
Webpack Encore - Asset Management for the rest of us
PDF
(2018) Webpack Encore - Asset Management for the rest of us
PDF
Pump up the JAM with Gatsby
Blockchains - Technical foundations
HOW TO SURVIVE A 2DAY HACKATHON?
Digitale Selbstbestimmung mit Hilfe dezentraler Technologien
Digitale Selbstbestimmung | Anwendungsfälle der Dezentralität
Decentralized technology: a (short) survey
Productive web applications that run only on the frontend
DePA - die dezentrale Patientenakte (29.1. FU Berlin)
DePA - die dezentrale Patientenakte
Was ist eine Datenbank - und was hat Blockchain damit zu tun?
Never Code Alone: Von Symfony Forms zu einer SPA auf APIs
Decentralize all the things
Indexing Decentralized Data with Ethereum, IPFS & The Graph
Gatsby (Code.Talks) 2019
A micro service story
Api Platform: the ultimate API Platform
Pump up the JAM with Gatsby (2019)
api-platform: the ultimate API platform
Webpack Encore - Asset Management for the rest of us
(2018) Webpack Encore - Asset Management for the rest of us
Pump up the JAM with Gatsby

Recently uploaded (20)

PDF
AI in Product Development-omnex systems
PPTX
ManageIQ - Sprint 268 Review - Slide Deck
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PPTX
Transform Your Business with a Software ERP System
PPTX
ISO 45001 Occupational Health and Safety Management System
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
System and Network Administraation Chapter 3
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PPTX
Odoo POS Development Services by CandidRoot Solutions
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
System and Network Administration Chapter 2
PDF
medical staffing services at VALiNTRY
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
AI in Product Development-omnex systems
ManageIQ - Sprint 268 Review - Slide Deck
Which alternative to Crystal Reports is best for small or large businesses.pdf
Transform Your Business with a Software ERP System
ISO 45001 Occupational Health and Safety Management System
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Internet Downloader Manager (IDM) Crack 6.42 Build 41
System and Network Administraation Chapter 3
Odoo Companies in India – Driving Business Transformation.pdf
Odoo POS Development Services by CandidRoot Solutions
VVF-Customer-Presentation2025-Ver1.9.pptx
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
System and Network Administration Chapter 2
medical staffing services at VALiNTRY
How to Choose the Right IT Partner for Your Business in Malaysia
Design an Analysis of Algorithms II-SECS-1021-03
Lecture 3: Operating Systems Introduction to Computer Hardware Systems

Hack it like its hot!

  • 1. @stadolf @coding_earth Hack it like it’s hot 😅 a 1 year hackathon wrap up
  • 2. 2 Stefan Adolf Developer Ambassador #javascript #mongodb #serverless #blockchain #codingberlin #elastic #aws #php #symfony #react #digitalization #agile #b2b #marketplaces #spryker #php #k8s #largescale #turbinejetzt #iot #ux #vuejs @stadolf elmariachi111
  • 4. 1. You pitch an idea
  • 5. 2. you find friendly team mates
  • 6. 3. you hack 40 hours
  • 7. 4. you present what you’ve done.
  • 8. 5. you do a team selfie
  • 9. @stadolf @coding_earth Buy By ID Self sovereign identity meets eCommerce T-Labs Blockchain Group - “Decentralizing the Enterprise” - Jan 2019
  • 10. @stadolf @coding_earth Challenge: Self Sovereign Identity •authenticate / SSO by using an identity under your control •enabled by self signed DID documents on Ethereum •support verifiable claims • “my government claims that I’m Stefan and over 21”
  • 11. 1. You pitch an idea
  • 12. @stadolf @coding_earth Buy By ID: Idea •add a “login with your identity” button to an headless shop system •integrate with Vue Storefront (headless adapter for Magento e.a.) •use Jolocom’s Smart Wallet for claim exchange
  • 13. 2. you find friendly team mates
  • 14. 3. you hack 24 hours
  • 15. @stadolf @coding_earth Tools / APIs •Jolocom: Typescript •Vue Storefront: ECMAScript / Vue •node / express, Redis & socket.io
  • 16. @stadolf @coding_earth Brainkillers / pitfalls •Both projects rely on Redis (VSF: cache, Jolocom: wallet storage) •Jolo’s samples rely on socket.io to detect phone activities (QR scanned) •socket.io can’t be bound to express apps (only to a http.Server inst) • socket.io relies on https •had to activate body parser on VSF •conflicting build setup (Jolocom / VSF) - had to align start scripts / ts-node •asynchronous calls conflicts with express route wiring
  • 17. @stadolf @coding_earth bind Jolocom backend to VSF const { getAsync, setAsync, delAsync } = configureRedisClient() const registry = JolocomLib.registries.jolocom.create() const vaultedKeyProvider = new JolocomLib.KeyProvider(seed, password) module.exports = async (expressApp: Express, server: http.Server) => { const identityWallet = await registry.authenticate(vaultedKeyProvider, {derivationPath: JolocomLib.KeyTypes.jolocomIdentityKey, encryptionPass: password}) configureRoutes(expressApp, {setAsync, getAsync, delAsync}, identityWallet, password) configureSockets(server, identityWallet, password, new DbWatcher(getAsync), {getAsync, setAsync, delAsync}) return identityWallet } const configureRoutes = (app: Express, redisApi: RedisApi, iw: IdentityWallet, password: string) => { /** * An authentication endpoint route for deep linking for demo-sso-mobile; */ app.get('/mobile/credentialRequest', async (req, res, next) => { …
  • 18. @stadolf @coding_earth listen to smart wallet events in Vue continueWithJolo () { 
 const randomId = randomString(8); this.getQrCode(randomId).then(image => { this.$bus.$emit('modal-show', 'modal-jolo-user', null, 
 {image: image}) this.awaitUserData(randomId).then(data => { const parsed = JSON.parse(data) const userData = parsed.data this.personalDetails = { firstName: userData.givenName, lastName: userData.familyName, } this.$bus.$emit('modal-hide', 'modal-jolo-user') this.sendDataToCheckout() }) }).catch(err => { console.log(err) }) }, awaitUserData(randomId: string): Promise<string> { const socket = io(`/sso-status`, { query: { userId: randomId } }) return new Promise<string>(resolve => { socket.on(randomId, (data: string) => resolve(data)) }) } /* server: http.Server */ const baseSocket = io(server).origins('*:*') 
 baseSocket.of('/sso-status').on('connection', async socket => { const { userId } = socket.handshake.query console.log(`sockets.ts: waiting until ${userId} logs in`) dbWatcher.addSubscription(userId) dbWatcher.on(userId, async () => { const userData = await getAsync(userId) await delAsync(userId) socket.emit(userId, userData) }) }) getQrCode (randomId: string) { const socket = io('/qr-code', {query: { userId: randomId } }) return new Promise<string>(resolve => { socket.on(randomId, (qrCode: string) => resolve(qrCode)) }) }, Wait for auth Redis Checkout form
  • 19. 4. you present what you’ve done.
  • 21. 5. you do a team selfie
  • 22. @stadolf @coding_earth 💡team building •find your team ahead of the event if possible •be very careful of people who • consider themselves “very senior” (they’re not pragmatic) • are “designers” without knowing CSS (“Photoshoppers”) • talk about everything but the hackathon (just want to hire you) •first thing you do: agree on a messenger protocol (Slack) / channel
  • 23. @stadolf @coding_earth Tech Tinder Customize your Tech radar Schwarz Group - “CodeCamp Heilbronn” - Nov 2018
  • 24. @stadolf @coding_earth Challenge •“Schwarz group”: 2nd largest grocery / supermarket in Germany / LIDL • ~500 developers over the world • no one knows all requirements •Build a tool that helps their dev teams to keep track of their tech stack
  • 25. 1. You pitch an idea
  • 26. @stadolf @coding_earth Idea: Tech-Tinder •a tech radar controlled by employees •everyone can add new technologies •vote on technologies using a “tinder” interface
  • 27. 2. you find friendly team mates
  • 28. 3. you hack 36 hours
  • 29. @stadolf @coding_earth Tools / APIs •Backend: MongoDB Atlas / Stitch (FaaS) •Frontend: Vue.js / Bueify •integrate “swing” swiping library (vue-swing2) •copy / paste and adjust Zalando’s TechRadar project
  • 31. @stadolf @coding_earth technology_aggregate.js (stitch) exports = function(technologyId){ const colTech = context.services.get("mongodb-atlas").db("tech- tinder").collection("technology"); const colVotes = context.services.get("mongodb-atlas").db("tech- tinder").collection("votes"); const aggregationPipeline = [ {"$group": { "_id": { tech: "$ref", opinion: "$op" }, "total": { "$sum": 1 } } }, {"$group": { "_id": "$_id.tech", "count": {"$sum": "$total"}, "stats": { "$push": { op: "$_id.opinion", total: "$total" } } } } ]; var pipeline; if (technologyId) { pipeline = [{$match:{ref: BSON.ObjectId(technologyId)} }] .concat(aggregationPipeline); } else { pipeline = aggregationPipeline; } return new Promise( (resolve, reject) => { //let technology = colTech.findOne({_id: techId}); colVotes.aggregate(pipeline).toArray().then(ag => { const techIds = ag.map(agg => agg._id); //stitch doesnt support $lookup colTech.find({_id: {"$in": techIds} }).toArray().then(technologies => { const combined = ag.map(agg => { let base = technologies.filter(tt => { return tt._id.toString() == agg._id.toString(); })[0]; if (!base) { return null; } base.votes = { total: agg.count, results: {} }; agg.stats.forEach(s => base.votes.results[s.op] = s.total ); return base; }); resolve(combined.filter(c => c != null)); }); }); }); };
  • 32. @stadolf @coding_earth vote.js (“tinder”) <div class="container" v-if="technologies.length > 0"> <span class="tag is-info is-large tag-hint tag-top" :style="{ opacity: opacity.top }">interested</span> <span class="tag is-info is-large tag-hint tag-left" :style="{ opacity: opacity.left }">discouraged</span> <span class="tag is-info is-large tag-hint tag-right" :style="{ opacity: opacity.right }">using</span> <span class="tag is-info is-large tag-hint tag-bottom" :style="{ opacity: opacity.bottom }">evaluating</span> <div class="card-viewport"> <div class="card-stack"> <vue-swing v-for="technology in technologies" :key="technology._id" :config="cardConfig" @throwout="throwout" @throwin="throwin" > <div class="card card-item" :data-key="technology._id" > <div class="card-image"> <figure class="image"> <h1 class="title is-3">{{ technology.name }}</h1> </figure> </div> <div class="card-content"> <p class="is-5" v-html="technology.description"/> </div> </div> </vue-swing> </div> </div> </div>
  • 33. 4. you present what you’ve done.
  • 35. 5. you do a team selfie
  • 36. @stadolf @coding_earth 👍 hackers’ rules of thumb •you can’t learn a new language during a hackathon •use as much SaaS and PaaS services as possible • Contentful, Heroku, AWS Lambda / RDS, Firebase, now.sh, netlify •never do “microservices” •use DX-friendly frontend tech stacks • vue-cli, create-react-app, Gatsby, ionic •don’t to TDD!
  • 37. @stadolf @coding_earth Green Fee let drivers pay for their air pollution in real time “Blockchain Hackathon Stuttgart 2” - Feb 2019
  • 38. @stadolf @coding_earth Challenge •sponsored by huge German banks, Daimler, blockchain agencies •improve “mobility” with ledger tech • other challenges were “Industry 4.0 / IoT”, “Finance” •they expect a “business” presentation 🙄
  • 39. 1. You pitch an idea
  • 40. @stadolf @coding_earth Idea: Green Fee •track vehicles’ motion •track environmental conditions (current air pollution ratio) •price = constant * (your pollution / environmental pollution) •track your pollution cost in “real time” •compensate “the planet” in near realtime
  • 41. 2. you find friendly team mates
  • 42. 3. you hack 40 hours
  • 43. @stadolf @coding_earth Tools / APIs •IOTA MAM (Masked Authenticated Messaging) • write pollution costs onto an IOTA DAG ledger MAM • every message contains an due amount of IOTA • asnychronous process polls MAM stream and triggers payments •open air pollution data service • public.opendatasoft.com •Leaflet / OSM / plain jQuery, Webpack Encore for fast asset building •expressjs as backend
  • 44. @stadolf @coding_earth – The official IOTA project It is possible to publish transactions to the Tangle that contain only messages, with no value. This introduces many possibilities for data integrity and communication, but comes with the caveat that message-only signatures are not checked. What we introduce is a method of symmetric-key encrypted, signed data that takes advantage of merkle-tree winternitz signatures for extended public key usability, that can be found trivially by those who know to look for it.
  • 45. @stadolf @coding_earth – Alexey Sobolev, Oct 2017 “The ID published to the tangle is the hash of the hash of the message key seed.” 🤔
  • 46. @stadolf @coding_earth publish.js const Mam = require('@iota/mam/lib/mam.client.js') const { asciiToTrytes } = require('@iota/converter') const fs = require("fs"); const mamState = Mam.init(config.provider, config.seed); const lastState = fs.existsSync(LAST_STATE_FILENAME) ? fs.readFileSync(LAST_STATE_FILENAME).toString() : null; if (lastState) { mamState.channel = JSON.parse(lastState); } app.post('/msg', async function (req, response) { var t = new Date() const payload = { d: t.toLocaleDateString() + " " + t.toLocaleTimeString(), data: req.body }; const trytes = asciiToTrytes(JSON.stringify(payload)) const message = Mam.create(mamState, trytes) await Mam.attach(message.payload, message.address, 3, 9) if (!mamState.channel.currentRoot) { mamState.channel.currentRoot = message.root; } mamState.channel.lastRoot = message.root fs.writeFileSync(LAST_STATE_FILENAME, JSON.stringify(mamState.channel)) response.json(mamState) })
  • 47. 4. you present what you’ve done.
  • 49. 5. you do a team selfie
  • 50. @stadolf @coding_earth 💡ideation •if there are “sponsors”, select 1 with an API you can relate with •don’t put all the sponsors’ APIs in one app •do a design thinking session • plan your idea for 2-3 hours! •remove everything that’s not absolutely necessary •do a “good looking” UI that’s responsive and usable on mobile • vuetify, MUI, ionic, Bueify, Reactstrap
  • 51. @stadolf @coding_earth Blockstagram Instagram on the blockchain “Blockstack Hackathon Berlin” - Mar 2018
  • 52. @stadolf @coding_earth Challenge •build something meaningful with “Blockstack” •self sovereign “blockstack.id": a socially / stake backed identity (BTC) •use their “Gaia” hub: file storage decentralization concept (~IPFS / Storj) • P2P synced decentralized storage. 
 Bring your own cloud or trust Blockstack
  • 53. 1. You pitch an idea
  • 54. @stadolf @coding_earth Idea: Blockstagram •“Instagram” on Blockstack •Upload your pictures to Gaia hub (controlled by you) •acknowledge “friend” identities for read access •provide a symmetric key for them to decrypt your images •to unfriend (hide) someone, reencrypt all the images with a new key
  • 55. 2. you find friendly team mates
  • 56. 3. you hack 36 hours
  • 57. @stadolf @coding_earth Tools / APIs •Blockstack • Identity & Gaia Hub •ReactJS / CRA (ejected) •Netlify deployment
  • 58. @stadolf @coding_earth read your friend’s instagram data async readSingleSubscribersImages(username) { const indexData = await blockstack.getFile('index.json', { username: username, decrypt: false }) const data = JSON.parse(indexData); console.log('Subscribers indexData is', indexData); data.images.forEach(async indexEntry => { if (!this.subscriberImageLoaded({ ...indexEntry, username })) { const imageData = await blockstack.getFile(indexEntry.path, { username, decrypt: false }) this.updateFeed({ path: indexEntry.path, username: username, image: imageData, created: indexEntry.created }); } }) }
  • 59. 4. you present what you’ve done.
  • 61. 5. you do a team selfie
  • 62. @stadolf @coding_earth 💡task distribution •is very hard since you don’t know / trust each other •one (experienced) guy must control the repo • everyone must commit to the same repo! •mock it till you make it • https://www.mockbin.org • use postman shared collections •“I’m done, what can I do next?” -> “I’m done. I’d like to add xyz”
  • 64. @stadolf @coding_earth 2pm: the idea wasteland •talk to others and listen closely •you may steal and reiterate their ideas! • Most likely you’ll build sth else anyway! •google the APIs and find related Stackoverflow questions •try to come up with a real problem that you personally could have 😩
  • 65. @stadolf @coding_earth 8pm: the desperation zone •you will not get done anything until 8pm. That’s normal! •Pair! Sitting next to each other always helps. •look at the other teams. You’ll note that they’re also struggling *very* hard •don’t argue or overthink! Do! • you usually will never look back at the code! •if you want to win: get rid of people who disturb the team. (Just ignore them) •if you want to learn / earn karma points: discuss it out with them 🤯
  • 66. @stadolf @coding_earth 4am: the blue hour of devastation •things will start to work when you’re most desperate and expect it least •stay awake! • Fresh air, do a break every 10m if necessary. But stay on it! • Bananas and cold pizza work better than coffee and Red Bull. •tiredness goes away around ~8am (and punches you out by 1pm) •do some simple tasks (e.g. frontend polish) for success feelings ☠
  • 67. @stadolf @coding_earth 10am: prepare your presentation •select one dedicated presentation guy •usually your presentation will win the game, not your code •build a story • “my friend Dyrk called me yesterday and we’re solving his problem here” •fake the demo if necessary but make it run! •have 1 WOW effect •skip “market research”, “business model” and “rollout strategy” 💁
  • 68. @stadolf @coding_earth too long, didn’t listen. •Hackathons are for pragmatic developers, not clean coders •solve as much as possible on the frontend (learn React or Vue & node!) •it’s really a “thon”: you need to suffer to take away the grand prize •it’s incredibly rewarding when your demo starts working at 4am •the more tools and services you use, the better. •people will remember you. Everything happens for a reason. •never give up, never surrender.
  • 69. 6. not winning makes you weirder!
  • 70. @stadolf @coding_earth That’s all, folks Stefan Adolf
 https://www.facebook.com/stadolf
 https://twitter.com/stadolf
 https://github.com/elmariachi111
 https://www.linkedin.com/in/stadolf/