All Projects → dabit3 → jamstack-nyc

dabit3 / jamstack-nyc

Licence: MIT license
Gatsby + GraphQL Static Queries + Basic authentication

Programming Languages

CSS
56736 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to jamstack-nyc

Gatsby Starter Foundation
A starter to launch your blazing fast personal website and a blog, Built with Gatsby and Netlify CMS. Made with ❤ by Stackrole
Stars: ✭ 135 (+575%)
Mutual labels:  gatsby, jamstack
Jamstack Serverless
Learn JAMstack Serverless Modern App Development in Baby Steps using Gatsby.js, React, TypeScript, GraphQL, Contentful, Netlify, FaunaDB, MongoDB, Apollo, Github Actions, Project Fugu, and CSS Houdini.
Stars: ✭ 178 (+790%)
Mutual labels:  gatsby, jamstack
Gatsby Starter Netlify Cms
Example gatsby + netlify cms project
Stars: ✭ 1,932 (+9560%)
Mutual labels:  gatsby, jamstack
Gatsby Universal
🔮 An opinionated Gatsby v2 starter for state-of-the-art marketing sites.
Stars: ✭ 617 (+2985%)
Mutual labels:  gatsby, jamstack
gatsby-starter-glass
A Minimal & Beautiful Gatsby Personal Blog Starter With Nice Glassmorphism UI
Stars: ✭ 134 (+570%)
Mutual labels:  gatsby, jamstack
Jamstack Cms
Modern full stack CMS. Built with Gatsby, GraphQL, AWS Amplify, and Serverless technologies.
Stars: ✭ 702 (+3410%)
Mutual labels:  gatsby, jamstack
Meli
Platform for deploying static sites and frontend applications easily. Automatic SSL, deploy previews, reverse proxy, and more.
Stars: ✭ 2,125 (+10525%)
Mutual labels:  gatsby, jamstack
Discord Fork
An open source Discord Bot List made with GatsbyJS
Stars: ✭ 60 (+200%)
Mutual labels:  gatsby, jamstack
testimonial
Jamstack app using Gatsby, Netlify, and FaunaDB.
Stars: ✭ 23 (+15%)
Mutual labels:  gatsby, jamstack
gatsby-typescript-emotion-storybook
Gatsby Starter: TypeScript + Emotion + Storybook + React Intl + SVGR + Jest
Stars: ✭ 63 (+215%)
Mutual labels:  gatsby, jamstack
Jamstackthemes
A list of themes and starters for JAMstack sites.
Stars: ✭ 298 (+1390%)
Mutual labels:  gatsby, jamstack
snipcart-gatsby-grav
Grav as Headless CMS Tied to Gatsby with GraphQL Schema
Stars: ✭ 27 (+35%)
Mutual labels:  gatsby, jamstack
plasmic
Visual page builder and web design tool for any website or web app tech stack
Stars: ✭ 1,475 (+7275%)
Mutual labels:  gatsby, jamstack
Gatsby Starter Lumen
A constantly evolving and thoughtful architecture for creating static blogs.
Stars: ✭ 1,797 (+8885%)
Mutual labels:  gatsby, jamstack
gatsby-netlifycms-starter-template
All the technologies used are free and open-source. You are free to use this template for a personal hobby blog, a commercial news agency or professional journalist website etc. Don't forget to star the repo if you like this template.
Stars: ✭ 33 (+65%)
Mutual labels:  gatsby, jamstack
Gine Blog
Blog = Gatsby + React + Material-UI + Notion + Netlify
Stars: ✭ 156 (+680%)
Mutual labels:  gatsby, jamstack
gatsby-plugin-lunr
Gatsby plugin for full text search implementation based on lunr client-side index. Supports multilanguage search.
Stars: ✭ 69 (+245%)
Mutual labels:  gatsby, jamstack
Example Company Website Gatsby Sanity Combo
This is an example company website using Gatsby and Sanity in combination.
Stars: ✭ 242 (+1110%)
Mutual labels:  gatsby, jamstack
trailing-slash-guide
Understand and fix your static website trailing slash issues!
Stars: ✭ 255 (+1175%)
Mutual labels:  gatsby, jamstack
gatsby-starter-developer-diary
An official Gatsby blog template designed for web developers. Blazing fast, it includes beautful web developer topic tags and social-media links
Stars: ✭ 76 (+280%)
Mutual labels:  gatsby, jamstack

JAMstack with Gatsby & AWS Amplify

Deploy to the Amplify console

Click the button to deploy a fullstack app in your AWS account:

amplifybutton

You can now continuously deploy changes to your frontend or backend and Amplify Console will automatically deploy those changes.

Build from scratch

To get started, first initialize an Amplify project:

amplify init

To rebuild from scratch

First create the Gatsby project

gatsby new jamstack-project

GraphQL Static Queries

  1. Install dependencies
npm install gatsby-source-graphql aws-amplify aws-amplify-react
  1. Add the GraphQL API
amplify add api
  1. Set the GraphQL Schema
type Talk @model {
  id: ID!
  name: String!
  description: String!
  speakerName: String!
}
  1. Deploy the API
amplify push
  1. Set the plugin configuration in the plugins array of gatsby-config.js
plugins: [
  {
    resolve: 'gatsby-source-graphql',
    options: {
      typeName: 'Talk',
      fieldName: 'talks',
      url: '<APPSYNC_URL>',
      headers: {
        'x-api-key': '<APPSYNC_API_KEY>'
      }
    }
  }
  // ...
]
  1. Query from the client
/* import graphql */
import { Link, graphql } from "gatsby"

/* define query */
export const query = graphql`
  query list {
    talks {
      listTalks {
        items {
          id
          name
          description
          speakerName
        }
      }
    }
  }
`

/* data is available in the app */
const IndexPage = ({ data }) => {}

Authentication

  1. Add authentication
amplify add auth

? Do you want to use the default authentication and security configuration? Default configuration
? How do you want users to be able to sign in? Username
? Do you want to configure advanced settings? No, I am done.
  1. Configure Amplify
import Amplify from '@aws-amplify/core'
import config from '../aws-exports'
Amplify.configure(config)
  1. Create new protected route with basic component. Here, add the withAuthenticator HOC to render auth flow:
import React, { useEffect, useState } from "react"
import { Link } from 'gatsby'

import Layout from "../components/layout"

import { withAuthenticator } from 'aws-amplify-react'
import { Auth } from 'aws-amplify'

const Protected = () => {
  const [user, setUser] = useState({})
  useEffect(() => {
    Auth.currentAuthenticatedUser()
      .then(user => console.log({ user }))
      .catch(err => console.log('user not signed in!: ', err))
  }, [])
  return (
    <Layout>
      <h1>Hi people</h1>
      <p>Welcome to your new Gatsby site.</p>
      <p>Now go build something great.</p>
      <Link to="/">Go back to the homepage</Link>
    </Layout>
  )
}

export default withAuthenticator(Protected, {
  includeGreetings: true
})
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].