Slide 1

Slide 1 text

Product Development with Vue.js @bermonpainter | #Confoo

Slide 2

Slide 2 text

JAMstack Concepts The Headless CMS Accelerating Development with Vue.js A Bit About Docker + Deployment 1 2 3 4 Product Development with Vue.js

Slide 3

Slide 3 text

JAMstack Concepts The Headless CMS Accelerating Development with Vue.js A Bit About Docker + Deployment 1 2 3 4 Product Development with Vue.js

Slide 4

Slide 4 text

Evolution Browser Server

Slide 5

Slide 5 text

Evolution Browser Server Database

Slide 6

Slide 6 text

Evolution Browser CDN Server Database

Slide 7

Slide 7 text

Evolution Browser CDN Server API Services Database

Slide 8

Slide 8 text

Evolution Browser CDN Build Tool API Services GIT Headless CMS Database

Slide 9

Slide 9 text

The JAMstack JavaScript Anything dynamic is handles by JavaScript. Framework agnostic. APIs Data is accessed over reusable APIs via HTTPs. Markup Served as static HTML, typically generated from a build tool.

Slide 10

Slide 10 text

But why? Performance You’re typically serving pre-built, optimized markup to a CDN as static content 1 2 Security CMS, server, database and other vulnerabilities are less of an issue (i.e. static site) 3 Tool Agnostic Choose whatever front-end framework, build tool, or data source you prefer 4 5 GIT Workflow Simplified build to deploy approach. Easier to contribute. Fewer dependencies (mostly) Dev Experience Focus on the front-end and worry less about databases, dev ops, or back-end dev 6 Separation of Concerns The front-end, backend, data, and devops can be completely decoupled

Slide 11

Slide 11 text

JAMstack Concepts The Headless CMS Accelerating Development with Vue.js A Bit About Docker + Deployment 1 2 3 4 Product Development with Vue.js

Slide 12

Slide 12 text

Headless CMS The HeadlessCMS A content management system decoupled from the end-user experience. Browser API Services Front-End Database Admin Interface

Slide 13

Slide 13 text

headlesscms.org

Slide 14

Slide 14 text

strapi.io

Slide 15

Slide 15 text

Why Strapi? It handles the bulk of the things I don’t enjoy doing manually Built-in API /w Docs You can generate an API from the admin interface or in your code editor 1 2 GraphQL or Restful Chose which API interface you prefer to integrate your front-end with 3 Built-in Auth Comes with decent auth and permission options to secure endpoints in the API 4 5 Built-in SMTP Set’s up an SMTP server by default Databases Choose a relational or on-relational database & Strapi will set it up for you 6 File uploads Handles file storage on the server or through 3rd parties (AWS, Cloudflare, etc).

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

Setting up relational data Companies

Slide 19

Slide 19 text

Setting up relational data People

Slide 20

Slide 20 text

Setting up relational data Videos

Slide 21

Slide 21 text

Setting up relational data Generated APIs

Slide 22

Slide 22 text

Setting up relational data Generated APIs

Slide 23

Slide 23 text

localhost:1340/videos

Slide 24

Slide 24 text

JAMstack Concepts The Headless CMS Accelerating Development with Vue.js A Bit About Docker + Deployment 1 2 3 4 Product Development with Vue.js

Slide 25

Slide 25 text

gridsome.org

Slide 26

Slide 26 text

Why Gridsome? It handles the bulk of the things I don’t enjoy doing manually (basically the Vue version of gatsbyjs.org Static Site Generator Provides a logical application structure with loosely held opinions on config vs customization 1 2 Fast Built in performance features like automatic code splitting, prefetching, & image optimization 3 Progressive Web App Automatically generates a single page web app with all of the built in optimization features 4 5 Easy Data Consumption Use any data source, from APIs to local JSON files. SEO Friendly by Default Loads as static HTML first with built in hydration for the SPA pieces 6 File driven Everything is based on client-side JavaScript, reusable APIs, and prebuilt Markup

Slide 27

Slide 27 text

The Workflow Browser Gridsome Layouts Templates Components Production Build Data Sources Local Files APIs CMSs GraphQL Data Layer

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

Setup Setup Files gridsome.config.js gridsome.server.js Source Files /assets (optional) – /fonts – /images – /js – /scss Output /dist /components /data (optional) /layouts /templates

Slide 30

Slide 30 text

TEMPLATE 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19.

Slide 31

Slide 31 text

TEMPLATE query {} import SiteSEO from '~/components/SiteSEO' export default { mixins: [SiteSEO], } 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19.

Slide 32

Slide 32 text

COMPONENT 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19.

Slide 33

Slide 33 text

COMPONENT export default { name: 'Modal', methods: { close() { this.$emit('close'); }, }, }; 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19.

Slide 34

Slide 34 text

COMPONENT .modal-fade-enter, .modal-fade-leave-active { opacity: 0; } .modal { position: fixed; top: 0; bottom: 0; left: 0; right: 0; background-color: rgba(0, 0, 0, 0.5); z-index: 1000; } 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19.

Slide 35

Slide 35 text

PAGE

{{title}}

{{innovatorName}} from {{innovatorCompany}}

{{description}}

Watch Video
1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19.

Slide 36

Slide 36 text

PAGE import videos from '@/data/videos.json' import Modal from '@/components/Modal.vue' import VideoPlayer from '@/components/Video.vue' export default { data() { return { videos, isModalVisible: false, } }, metaInfo: { title: 'A Powerful Merger' }, components: { Modal, VideoPlayer }, 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19.

Slide 37

Slide 37 text

PAGE methods: { showModal() { this.isModalVisible = true; }, closeModal() { this.isModalVisible = false; } } } 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19.

Slide 38

Slide 38 text

gridsome.server.js const axios = require('axios') module.exports = function (api) { api.loadSource(async ({ addCollection }) => { const { data } = await axios.get(‘https://localhost:1340/videos') const posts = addCollection('Videos') for (const video of data) { videos({ id: video.id, title: video.title, description: video.description, innovatorName: video.innovator.name, innovatorCompany: video.innovator.company }) } }) } 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19.

Slide 39

Slide 39 text

JAMstack Concepts The Headless CMS Accelerating Development with Vue.js A Bit About Docker + Deployment 1 2 3 4 Product Development with Vue.js

Slide 40

Slide 40 text

Why Docker? Ship Faster Makes it easier to deploy isolated environments with minimal setup 1 2 Standardized The container already has server info, dependencies, and the app set up 3 Portable Makes it easy to share instances with other devs and move to different environments Automates the deployment of applications as portable, self-sufficient containers that can run on the cloud, on your own servers, and on localhost

Slide 41

Slide 41 text

github.com/strapi/strapi-docker

Slide 42

Slide 42 text

Where to Deploy? Gridsome (front-end) Netlify (easiest) Github Pages Gitlab Pages Amazon S3 Your Server Strapi /w Docker (data) Azure Amazon AWS Digital Ocean Heroku (easiest)

Slide 43

Slide 43 text

Fin. Open Office Hours Friday mornings: 7:00am — 9:00am EST officehours.io/people/bermonpainter Twitter/LinkedIn @bermonpainter