Fun and Games with the Full-Stack Jamstack (KCDC 2022).pdf

Mike Cavaliere
Mike CavaliereFull-Stack Engineer / Manager / Presenter / Author / ADHD Brain Hacker. at Echobind
β€’β€’
Mike Cavaliere
mikecavaliere.com / @mcavaliere
Fun and

games
with the full-stack

Jamstack
πŸ‘πŸ» thank you, !!!
πŸ‘‹πŸΌ Hi, I'm Mike.
Full-Stack web/mobile
❀️
JS, React
Writes words
Gives talks
@mcavaliere
mcavaliere
mikecavaliere.com
πŸ§‘πŸΌβ€πŸ’»
what is this talk

about?
➑ Engineering requires lots of learning.
➑ Fun helps us learn.
πŸ’‘ Therefore: have fun while learning and practicing.
work on fun things.
TL;DR:
πŸŽ‰ Fun πŸŽ‰ πŸ”Ί Mood
πŸ”Ί Attention
πŸ”Ί Memory
FUN helps you learn
Source: science
Learn better,
faster,
& longer
this talk
Source: science
How I built a simple game in a day
Real-world skills practiced in v1
How this led to v2
Real-world learnings from v2
Fun and Games with the Full-Stack Jamstack
Mike Cavaliere πŸ”— mikecavaliere.com πŸ”— @mcavaliere
In case you haven't heard of it...
what is was the ?
JavaScript APIs Markup
+ + = "JAM"
Term coined by
Fun and Games with the Full-Stack Jamstack
Mike Cavaliere πŸ”— mikecavaliere.com πŸ”— @mcavaliere
In case you haven't heard of it...
what is was the ?
Build things in JS
Compile to HTML
Fetch data w/APIs
In case you haven't heard of it...
what is the ?
πŸš€ FAST
πŸ”Ž SEO
πŸ” Secure
πŸ“ˆ Scalable
πŸ’° Saves $$$
πŸ’» **Developer Experience (DX)**
Benefits:
πŸ”— Jamstack.org
Fun and Games with the Full-Stack Jamstack
Mike Cavaliere πŸ”— mikecavaliere.com πŸ”— @mcavaliere
what is the Jamstack now?
Build things in anything
Compile to HTML
Fetch data w/APIs
Spoiler: it's the same thing.
πŸ”— Netlify blog: The Jamstack definition evolved
Fun and Games with the Full-Stack Jamstack
Mike Cavaliere πŸ”— mikecavaliere.com πŸ”— @mcavaliere
Jamstack frameworks
https://jamstack.org/generators
& many more
Fun and Games with the Full-Stack Jamstack
Mike Cavaliere πŸ”— mikecavaliere.com πŸ”— @mcavaliere
Enter the
Full-Stack Jamstack
Frameworks that give you full control over the server-side.
Coined by fsjam.org
Part #1: Backstory
How this project got started.
Backstory
Have 8 hours investment time weekly
Demo on Friday
Wanted fun and interactive
Me: πŸ’‘ "I'm gonna build a game!"
(πŸ™ŒπŸΌ TY, Echobind)
What's the simplest "game" I can build in < 1 day?
What's the simplest "game" I can build in < 1 day?
Everybody

logs in
Click things
Update list of things
on screen.


Highest #clicks on
top.
v1 Goals
Ship in <8 hours
(use investment time)
Fun & interactive
Don't spend money
Use websockets (maybe)
Building the MVP
"Minimum Viable Product."
aka, the simplest version I can ship.
The tools I started the stack
with, which are (mostly) part of
my own standard boilerplate.
🧰 Toolbox πŸ› 
JS Framework
Database
Data fetching
UI/layout/design
Authentication
v1.0! πŸŽ‰
Fun and Games with the Full-Stack Jamstack
Mike Cavaliere πŸ”— mikecavaliere.com πŸ”— @mcavaliere
building v1
Planning
Gen. scaffold / add

dependencies
GitHub Auth +
DB schema
Feature: emoji

picker
Feature: emoji

list
Tweak details Deploy
v1 "Architecture"
Boilerplate NextAuth
GitHub login/signup
Single-page app
building v1
Building the database
building v1
GitHub auth
Create GitHub OAuth app / API keys
Add next-auth + prisma adapter
Done - boilerplate screens
<EmojiPicker /> <Leaderboard /> <UserList />
building v1
<EmojiPicker /> <Leaderboard /> <UserList />
missive/emoji-mart
click
POST /api/emoji/create
INSERT emoji into DB
Record a single vote
<EmojiPicker /> <Leaderboard /> <UserList />
GET /api/emoji/list
every 200ms
query emoji, JOIN on votes
aggregate & sort by vote count
<span style={{ fontSize: 15 + e._count.votes * 5 }}>
{e.native}
</span>
<EmojiPicker /> <Leaderboard /> <UserList />
GET /api/users/list
every 200ms
V1 (MVP) Takeaways
Lessons & practiced skills.
UI
Page layout / styling
Data fetching
tech skills practiced
Frontend Backend
Data modeling
Database CRUD
API development
General
Type modeling (TypeScript)
Authentication
Product development (!)
Library proficiency
Shipping fast
"Good enough" iteration
other SkillS Improved
How to ship fast
Learning time accumulates
Being selective increases focus
Limit new learning


Start with tools you already know.
Don't reinvent the ☸️


Search before building.
Aim for "good enough."


Add TODOs for later.
making it better
Upgrades.
v1 areas for

improvement
UX: Emoji get tooooo big
UX: Updates slowly
UX: No animation
UX: How do we "win"?
Tech: Code is a mess; can't add

features easily
v2.0! πŸŽ‰
Let's πŸ€ͺ play!
https://emoji-battle.vercel.app
(and maybe break the app)
Websockets / optimistic rendering
15-second rounds w/countdown
End-of-round stats
building v2
Rearchitected
Design additions, animations
building v2
Animation
building v2
πŸ™Shout out to
Adding Websockets
πŸš€ Real-time!
πŸ™ Shout out to
Note: there are different

ways to achieve this.
building v2
Rounds architecture
building v2
How countdown works
currentStep == 13
building v2
React rearchitecting
Take state out of components
Move into React contexts
<RoundProvider>
<EmojisProvider>
Drop SWR, add react-query
Add useEffectReducer()
Move websockets, effects to custom hooks
Separate side effects
πŸ‘πŸΌDecouple all the things.πŸ‘πŸΌ
Unnecessary details:
V2 Takeaways
Lessons & practiced skills.
Code reuse patterns
State management
Refactoring patterns
learnings
Optimistic rendering
Layout animations
Declarative/imperative

animations
React architectural patterns
Nested contexts
Side effect management
React
UI Dev
Software architecture
Also
Microservices
Websockets / realtime

events
What's next?
Battling on
πŸ’₯ Sound effects
πŸ’» Game mechanics
πŸ—‘ Weapons (take away votes)
πŸ“± Mobile friendliness
⏱ Longer rounds
πŸ€ͺ Random animations
? Who knows.
Suggestions welcome!
What's next?
Open for contributions
mcavaliere/emoji-battle
mcavaliere/emoji-battle-api
➑ Engineering requires lots of learning.
➑ Fun helps us learn.
πŸ’‘ Therefore: have fun while learning and practicing.
work on fun things.
Recap:
mcavaliere/emoji-battle
thank you for watching!
mikecavaliere.com
@mcavaliere
πŸ§‘πŸΌβ€πŸ’»
Feedback

appreciated
πŸ™
1 of 50

Recommended

Adding the Awesomesauce Flavor with IE9 Pinned Sites by
Adding the Awesomesauce Flavor with IE9 Pinned SitesAdding the Awesomesauce Flavor with IE9 Pinned Sites
Adding the Awesomesauce Flavor with IE9 Pinned SitesJohn Bristowe
687 viewsβ€’34 slides
Fast Track to Adobe Captivate by
Fast Track to Adobe CaptivateFast Track to Adobe Captivate
Fast Track to Adobe Captivateeaselsolutions
813 viewsβ€’31 slides
Full stack development in Go by
Full stack development in GoFull stack development in Go
Full stack development in GoYves Junqueira
1.2K viewsβ€’60 slides
Where's the Play in Programming? by
Where's the Play in Programming?Where's the Play in Programming?
Where's the Play in Programming?Aaron VonderHaar
683 viewsβ€’106 slides
HTML5 & JavaScript Games by
HTML5 & JavaScript GamesHTML5 & JavaScript Games
HTML5 & JavaScript GamesRobin Hawkes
7.5K viewsβ€’80 slides
How I learned to stop worrying and love embedding JavaScript by
How I learned to stop worrying and love embedding JavaScriptHow I learned to stop worrying and love embedding JavaScript
How I learned to stop worrying and love embedding JavaScriptKevin Read
1.4K viewsβ€’33 slides

More Related Content

Similar to Fun and Games with the Full-Stack Jamstack (KCDC 2022).pdf

Building a game engine with jQuery by
Building a game engine with jQueryBuilding a game engine with jQuery
Building a game engine with jQueryPaul Bakaus
14.8K viewsβ€’64 slides
Building Droids with JavaScript by
Building Droids with JavaScriptBuilding Droids with JavaScript
Building Droids with JavaScriptAndrew Fisher
916 viewsβ€’28 slides
Les animations sur WordPress - avec Damien by
Les animations sur WordPress - avec DamienLes animations sur WordPress - avec Damien
Les animations sur WordPress - avec DamienJulien Dereumaux
138 viewsβ€’45 slides
Maker Boot Camp by
Maker Boot CampMaker Boot Camp
Maker Boot CampSt. Petersburg College
957 viewsβ€’96 slides
Responsive web design & mobile web development - a technical and business app... by
Responsive web design & mobile web development - a technical and business app...Responsive web design & mobile web development - a technical and business app...
Responsive web design & mobile web development - a technical and business app...Atos_Worldline
2K viewsβ€’60 slides
Skill Session - Web Multi Device by
Skill Session - Web Multi DeviceSkill Session - Web Multi Device
Skill Session - Web Multi Devicefilirom1
412 viewsβ€’61 slides

Similar to Fun and Games with the Full-Stack Jamstack (KCDC 2022).pdf(20)

Building a game engine with jQuery by Paul Bakaus
Building a game engine with jQueryBuilding a game engine with jQuery
Building a game engine with jQuery
Paul Bakausβ€’14.8K views
Building Droids with JavaScript by Andrew Fisher
Building Droids with JavaScriptBuilding Droids with JavaScript
Building Droids with JavaScript
Andrew Fisherβ€’916 views
Les animations sur WordPress - avec Damien by Julien Dereumaux
Les animations sur WordPress - avec DamienLes animations sur WordPress - avec Damien
Les animations sur WordPress - avec Damien
Julien Dereumauxβ€’138 views
Responsive web design & mobile web development - a technical and business app... by Atos_Worldline
Responsive web design & mobile web development - a technical and business app...Responsive web design & mobile web development - a technical and business app...
Responsive web design & mobile web development - a technical and business app...
Atos_Worldlineβ€’2K views
Skill Session - Web Multi Device by filirom1
Skill Session - Web Multi DeviceSkill Session - Web Multi Device
Skill Session - Web Multi Device
filirom1β€’412 views
[DevRelCon Tokyo 2017] Creative Technical Content for Better Developer Experi... by Tomomi Imura
[DevRelCon Tokyo 2017] Creative Technical Content for Better Developer Experi...[DevRelCon Tokyo 2017] Creative Technical Content for Better Developer Experi...
[DevRelCon Tokyo 2017] Creative Technical Content for Better Developer Experi...
Tomomi Imuraβ€’788 views
RWD in the Wild by Rich Quick
RWD in the WildRWD in the Wild
RWD in the Wild
Rich Quickβ€’905 views
JAZOON'13 - Sven Peters - How to do Kick-Ass Software Development by jazoon13
JAZOON'13 - Sven Peters - How to do Kick-Ass Software DevelopmentJAZOON'13 - Sven Peters - How to do Kick-Ass Software Development
JAZOON'13 - Sven Peters - How to do Kick-Ass Software Development
jazoon13β€’890 views
Sutd Game Lab's prototyping tips by Phaedra Pang
Sutd Game Lab's prototyping tipsSutd Game Lab's prototyping tips
Sutd Game Lab's prototyping tips
Phaedra Pangβ€’415 views
Prototyping user interactions in web apps by Patrick NDJIENTCHEU
Prototyping user interactions in web appsPrototyping user interactions in web apps
Prototyping user interactions in web apps
Patrick NDJIENTCHEUβ€’701 views
Leveling up your JavaScipt - DrupalJam 2017 by Christian Heilmann
Leveling up your JavaScipt - DrupalJam 2017Leveling up your JavaScipt - DrupalJam 2017
Leveling up your JavaScipt - DrupalJam 2017
Christian Heilmannβ€’581 views
Hacking to be performant by Apoorv Saxena
Hacking to be performantHacking to be performant
Hacking to be performant
Apoorv Saxenaβ€’1.4K views
Unleashing WebGL & WebAudio with babylon.js by davrous
Unleashing WebGL & WebAudio with babylon.jsUnleashing WebGL & WebAudio with babylon.js
Unleashing WebGL & WebAudio with babylon.js
davrousβ€’2.7K views
Build a better(reactive) word press by Bhushan Jawle
Build a better(reactive) word pressBuild a better(reactive) word press
Build a better(reactive) word press
Bhushan Jawleβ€’90 views
SharePoint Development 101 by Greg Hurlman
SharePoint Development 101SharePoint Development 101
SharePoint Development 101
Greg Hurlmanβ€’4.7K views
Don't let your Service be speechless – Clive K. Lavery by Service Experience Camp
Don't let your Service be speechless – Clive K. LaveryDon't let your Service be speechless – Clive K. Lavery
Don't let your Service be speechless – Clive K. Lavery
Nebraska Trainer's Institute eLearning Presentaiotn by easelsolutions
Nebraska Trainer's Institute eLearning PresentaiotnNebraska Trainer's Institute eLearning Presentaiotn
Nebraska Trainer's Institute eLearning Presentaiotn
easelsolutionsβ€’561 views
Game development project by Gogikar Dhanraj
Game development projectGame development project
Game development project
Gogikar Dhanrajβ€’35 views

Recently uploaded

Marketing and Community Building in Web3 by
Marketing and Community Building in Web3Marketing and Community Building in Web3
Marketing and Community Building in Web3Federico Ast
12 viewsβ€’64 slides
PORTFOLIO 1 (Bret Michael Pepito).pdf by
PORTFOLIO 1 (Bret Michael Pepito).pdfPORTFOLIO 1 (Bret Michael Pepito).pdf
PORTFOLIO 1 (Bret Michael Pepito).pdfbrejess0410
8 viewsβ€’6 slides
UiPath Document Understanding_Day 3.pptx by
UiPath Document Understanding_Day 3.pptxUiPath Document Understanding_Day 3.pptx
UiPath Document Understanding_Day 3.pptxUiPathCommunity
105 viewsβ€’25 slides
WEB 2.O TOOLS: Empowering education.pptx by
WEB 2.O TOOLS: Empowering education.pptxWEB 2.O TOOLS: Empowering education.pptx
WEB 2.O TOOLS: Empowering education.pptxnarmadhamanohar21
16 viewsβ€’16 slides
Building trust in our information ecosystem: who do we trust in an emergency by
Building trust in our information ecosystem: who do we trust in an emergencyBuilding trust in our information ecosystem: who do we trust in an emergency
Building trust in our information ecosystem: who do we trust in an emergencyTina Purnat
100 viewsβ€’18 slides
IETF 118: Starlink Protocol Performance by
IETF 118: Starlink Protocol PerformanceIETF 118: Starlink Protocol Performance
IETF 118: Starlink Protocol PerformanceAPNIC
297 viewsβ€’22 slides

Recently uploaded(10)

Marketing and Community Building in Web3 by Federico Ast
Marketing and Community Building in Web3Marketing and Community Building in Web3
Marketing and Community Building in Web3
Federico Astβ€’12 views
PORTFOLIO 1 (Bret Michael Pepito).pdf by brejess0410
PORTFOLIO 1 (Bret Michael Pepito).pdfPORTFOLIO 1 (Bret Michael Pepito).pdf
PORTFOLIO 1 (Bret Michael Pepito).pdf
brejess0410β€’8 views
UiPath Document Understanding_Day 3.pptx by UiPathCommunity
UiPath Document Understanding_Day 3.pptxUiPath Document Understanding_Day 3.pptx
UiPath Document Understanding_Day 3.pptx
UiPathCommunityβ€’105 views
WEB 2.O TOOLS: Empowering education.pptx by narmadhamanohar21
WEB 2.O TOOLS: Empowering education.pptxWEB 2.O TOOLS: Empowering education.pptx
WEB 2.O TOOLS: Empowering education.pptx
narmadhamanohar21β€’16 views
Building trust in our information ecosystem: who do we trust in an emergency by Tina Purnat
Building trust in our information ecosystem: who do we trust in an emergencyBuilding trust in our information ecosystem: who do we trust in an emergency
Building trust in our information ecosystem: who do we trust in an emergency
Tina Purnatβ€’100 views
IETF 118: Starlink Protocol Performance by APNIC
IETF 118: Starlink Protocol PerformanceIETF 118: Starlink Protocol Performance
IETF 118: Starlink Protocol Performance
APNICβ€’297 views
DU Series - Day 4.pptx by UiPathCommunity
DU Series - Day 4.pptxDU Series - Day 4.pptx
DU Series - Day 4.pptx
UiPathCommunityβ€’106 views
How to think like a threat actor for Kubernetes.pptx by LibbySchulze1
How to think like a threat actor for Kubernetes.pptxHow to think like a threat actor for Kubernetes.pptx
How to think like a threat actor for Kubernetes.pptx
LibbySchulze1β€’5 views

Fun and Games with the Full-Stack Jamstack (KCDC 2022).pdf

  • 1. Mike Cavaliere mikecavaliere.com / @mcavaliere Fun and games with the full-stack Jamstack
  • 3. πŸ‘‹πŸΌ Hi, I'm Mike. Full-Stack web/mobile ❀️ JS, React Writes words Gives talks @mcavaliere mcavaliere mikecavaliere.com πŸ§‘πŸΌβ€πŸ’»
  • 4. what is this talk about?
  • 5. ➑ Engineering requires lots of learning. ➑ Fun helps us learn. πŸ’‘ Therefore: have fun while learning and practicing. work on fun things. TL;DR:
  • 6. πŸŽ‰ Fun πŸŽ‰ πŸ”Ί Mood πŸ”Ί Attention πŸ”Ί Memory FUN helps you learn Source: science Learn better, faster, & longer
  • 7. this talk Source: science How I built a simple game in a day Real-world skills practiced in v1 How this led to v2 Real-world learnings from v2
  • 8. Fun and Games with the Full-Stack Jamstack Mike Cavaliere πŸ”— mikecavaliere.com πŸ”— @mcavaliere In case you haven't heard of it... what is was the ? JavaScript APIs Markup + + = "JAM" Term coined by
  • 9. Fun and Games with the Full-Stack Jamstack Mike Cavaliere πŸ”— mikecavaliere.com πŸ”— @mcavaliere In case you haven't heard of it... what is was the ? Build things in JS Compile to HTML Fetch data w/APIs
  • 10. In case you haven't heard of it... what is the ? πŸš€ FAST πŸ”Ž SEO πŸ” Secure πŸ“ˆ Scalable πŸ’° Saves $$$ πŸ’» **Developer Experience (DX)** Benefits: πŸ”— Jamstack.org
  • 11. Fun and Games with the Full-Stack Jamstack Mike Cavaliere πŸ”— mikecavaliere.com πŸ”— @mcavaliere what is the Jamstack now? Build things in anything Compile to HTML Fetch data w/APIs Spoiler: it's the same thing. πŸ”— Netlify blog: The Jamstack definition evolved
  • 12. Fun and Games with the Full-Stack Jamstack Mike Cavaliere πŸ”— mikecavaliere.com πŸ”— @mcavaliere Jamstack frameworks https://jamstack.org/generators & many more
  • 13. Fun and Games with the Full-Stack Jamstack Mike Cavaliere πŸ”— mikecavaliere.com πŸ”— @mcavaliere Enter the Full-Stack Jamstack Frameworks that give you full control over the server-side. Coined by fsjam.org
  • 14. Part #1: Backstory How this project got started.
  • 15. Backstory Have 8 hours investment time weekly Demo on Friday Wanted fun and interactive Me: πŸ’‘ "I'm gonna build a game!" (πŸ™ŒπŸΌ TY, Echobind)
  • 16. What's the simplest "game" I can build in < 1 day?
  • 17. What's the simplest "game" I can build in < 1 day? Everybody logs in Click things Update list of things on screen. Highest #clicks on top.
  • 18. v1 Goals Ship in <8 hours (use investment time) Fun & interactive Don't spend money Use websockets (maybe)
  • 19. Building the MVP "Minimum Viable Product." aka, the simplest version I can ship.
  • 20. The tools I started the stack with, which are (mostly) part of my own standard boilerplate. 🧰 Toolbox πŸ›  JS Framework Database Data fetching UI/layout/design Authentication
  • 22. Fun and Games with the Full-Stack Jamstack Mike Cavaliere πŸ”— mikecavaliere.com πŸ”— @mcavaliere building v1 Planning Gen. scaffold / add dependencies GitHub Auth + DB schema Feature: emoji picker Feature: emoji list Tweak details Deploy
  • 23. v1 "Architecture" Boilerplate NextAuth GitHub login/signup Single-page app
  • 25. building v1 GitHub auth Create GitHub OAuth app / API keys Add next-auth + prisma adapter Done - boilerplate screens
  • 26. <EmojiPicker /> <Leaderboard /> <UserList /> building v1
  • 27. <EmojiPicker /> <Leaderboard /> <UserList /> missive/emoji-mart click POST /api/emoji/create INSERT emoji into DB Record a single vote
  • 28. <EmojiPicker /> <Leaderboard /> <UserList /> GET /api/emoji/list every 200ms query emoji, JOIN on votes aggregate & sort by vote count <span style={{ fontSize: 15 + e._count.votes * 5 }}> {e.native} </span>
  • 29. <EmojiPicker /> <Leaderboard /> <UserList /> GET /api/users/list every 200ms
  • 30. V1 (MVP) Takeaways Lessons & practiced skills.
  • 31. UI Page layout / styling Data fetching tech skills practiced Frontend Backend Data modeling Database CRUD API development General Type modeling (TypeScript) Authentication Product development (!)
  • 32. Library proficiency Shipping fast "Good enough" iteration other SkillS Improved
  • 33. How to ship fast Learning time accumulates Being selective increases focus Limit new learning Start with tools you already know. Don't reinvent the ☸️ Search before building. Aim for "good enough." Add TODOs for later.
  • 35. v1 areas for improvement UX: Emoji get tooooo big UX: Updates slowly UX: No animation UX: How do we "win"? Tech: Code is a mess; can't add features easily
  • 38. Websockets / optimistic rendering 15-second rounds w/countdown End-of-round stats building v2 Rearchitected Design additions, animations
  • 40. building v2 πŸ™Shout out to Adding Websockets πŸš€ Real-time!
  • 42. Note: there are different ways to achieve this. building v2 Rounds architecture
  • 43. building v2 How countdown works currentStep == 13
  • 44. building v2 React rearchitecting Take state out of components Move into React contexts <RoundProvider> <EmojisProvider> Drop SWR, add react-query Add useEffectReducer() Move websockets, effects to custom hooks Separate side effects πŸ‘πŸΌDecouple all the things.πŸ‘πŸΌ Unnecessary details:
  • 45. V2 Takeaways Lessons & practiced skills.
  • 46. Code reuse patterns State management Refactoring patterns learnings Optimistic rendering Layout animations Declarative/imperative animations React architectural patterns Nested contexts Side effect management React UI Dev Software architecture Also Microservices Websockets / realtime events
  • 48. πŸ’₯ Sound effects πŸ’» Game mechanics πŸ—‘ Weapons (take away votes) πŸ“± Mobile friendliness ⏱ Longer rounds πŸ€ͺ Random animations ? Who knows. Suggestions welcome! What's next? Open for contributions mcavaliere/emoji-battle mcavaliere/emoji-battle-api
  • 49. ➑ Engineering requires lots of learning. ➑ Fun helps us learn. πŸ’‘ Therefore: have fun while learning and practicing. work on fun things. Recap:
  • 50. mcavaliere/emoji-battle thank you for watching! mikecavaliere.com @mcavaliere πŸ§‘πŸΌβ€πŸ’» Feedback appreciated πŸ™