From 8a5825d52271d712ec7c8348447d433067e13ef2 Mon Sep 17 00:00:00 2001 From: Wes Bos Date: Thu, 13 Sep 2018 14:18:56 -0400 Subject: DONE --- finished-application/frontend/pages/_app.js | 36 ---- finished-application/frontend/pages/_document.js | 25 --- finished-application/frontend/pages/add.js | 10 - finished-application/frontend/pages/diagram.js | 202 --------------------- finished-application/frontend/pages/index.js | 7 - finished-application/frontend/pages/item.js | 7 - finished-application/frontend/pages/items.js | 3 - finished-application/frontend/pages/me.js | 13 -- finished-application/frontend/pages/order.js | 7 - finished-application/frontend/pages/orders.js | 10 - finished-application/frontend/pages/permissions.js | 10 - finished-application/frontend/pages/reset.js | 10 - finished-application/frontend/pages/sell.js | 10 - finished-application/frontend/pages/signup.js | 20 -- finished-application/frontend/pages/update.js | 15 -- 15 files changed, 385 deletions(-) delete mode 100644 finished-application/frontend/pages/_app.js delete mode 100644 finished-application/frontend/pages/_document.js delete mode 100644 finished-application/frontend/pages/add.js delete mode 100644 finished-application/frontend/pages/diagram.js delete mode 100644 finished-application/frontend/pages/index.js delete mode 100644 finished-application/frontend/pages/item.js delete mode 100644 finished-application/frontend/pages/items.js delete mode 100644 finished-application/frontend/pages/me.js delete mode 100644 finished-application/frontend/pages/order.js delete mode 100644 finished-application/frontend/pages/orders.js delete mode 100644 finished-application/frontend/pages/permissions.js delete mode 100644 finished-application/frontend/pages/reset.js delete mode 100644 finished-application/frontend/pages/sell.js delete mode 100644 finished-application/frontend/pages/signup.js delete mode 100644 finished-application/frontend/pages/update.js (limited to 'finished-application/frontend/pages') diff --git a/finished-application/frontend/pages/_app.js b/finished-application/frontend/pages/_app.js deleted file mode 100644 index 4e9af74..0000000 --- a/finished-application/frontend/pages/_app.js +++ /dev/null @@ -1,36 +0,0 @@ -import App, { Container } from 'next/app'; -import { ApolloProvider } from 'react-apollo'; -import withData from '../lib/withData'; -import Page from '../components/Page'; - -// Next.js wraps each Page in an component. This is handy for when you want to persist anything from page to page, or just access a component that is 1 level higher than each page. - -// here we use App from next/app and wrap it with withData so we can get Apollo and SSR - -class MyApp extends App { - static async getInitialProps({ Component, ctx }) { - let pageProps = {}; - if (Component.getInitialProps) { - pageProps = await Component.getInitialProps(ctx); - } - - pageProps.query = ctx.query; - - return { pageProps }; - } - render() { - const { Component, pageProps, apollo } = this.props; - - return ( - - - - - - - - ); - } -} - -export default withData(MyApp); diff --git a/finished-application/frontend/pages/_document.js b/finished-application/frontend/pages/_document.js deleted file mode 100644 index a5a28cc..0000000 --- a/finished-application/frontend/pages/_document.js +++ /dev/null @@ -1,25 +0,0 @@ -import Document, { Head, Main, NextScript } from 'next/document'; -import { ServerStyleSheet } from 'styled-components'; - -class MyDocument extends Document { - static getInitialProps({ renderPage }) { - const sheet = new ServerStyleSheet(); - const page = renderPage(App => props => sheet.collectStyles()); - const styleTags = sheet.getStyleElement(); - return { ...page, styleTags }; - } - - render() { - return ( - - {this.props.styleTags} - -
- - - - ); - } -} - -export default MyDocument; diff --git a/finished-application/frontend/pages/add.js b/finished-application/frontend/pages/add.js deleted file mode 100644 index 57a327d..0000000 --- a/finished-application/frontend/pages/add.js +++ /dev/null @@ -1,10 +0,0 @@ -import CreateItem from '../components/CreateItem'; -import PleaseSignIn from '../components/PleaseSignIn'; - -const Sell = () => ( - - - -); - -export default Sell; diff --git a/finished-application/frontend/pages/diagram.js b/finished-application/frontend/pages/diagram.js deleted file mode 100644 index a505089..0000000 --- a/finished-application/frontend/pages/diagram.js +++ /dev/null @@ -1,202 +0,0 @@ -import styled from 'styled-components'; - -const DiagramStyles = styled.div` - display: grid; - grid-template-columns: repeat(8, 1fr); - grid-column-gap: 20px; - h1 { - grid-column: 1 / -1; - grid-row: 1; - } - ul { - margin: 0; - padding: 0; - list-style: none; - li { - border-bottom: 1px solid rgba(0, 0, 0, 0.2); - padding: 5px 0; - } - } - h2 { - text-align: center; - margin: 0; - background: black; - color: white; - width: calc(40px + 100%); - transform: translateX(-20px); - } - span.for { - font-size: 12px; - text-align: center; - margin-top: 1rem; - margin-bottom: 1rem; - display: block; - } - .slat { - background: #f7f7f7; - padding: 20px; - min-height: 500px; - grid-column: span 2; - grid-row: 4; - line-height: 1.7; - } - - .location { - grid-column: span 4; - background: red; - padding: 5px; - grid-row: 2; - text-align: center; - color: white; - text-transform: uppercase; - } - - .arrow { - font-size: 30px; - line-height: 1; - transform: translateX(-10px) translateX(-50%); - text-align: center; - grid-row: 3; - margin-bottom: -100%; - background: white; - height: 40px; - } - .arrow1 { - grid-column: 3; - } - .arrow2 { - grid-column: 5; - } - .arrow3 { - grid-column: 7; - } - img { - width: 100%; - height: 125px; - object-fit: contain; - } - .slat2 img { - filter: invert(100%); - } - .slat4 img { - mix-blend-mode: multiply; - } -`; - -const Diagram = () => ( - -

The Pieces of our Application

- Frontend - Backend -
- React.js -

React.js

- For Building The Interface along with: -
    -
  • - Next.js for server side rendering, routing and tooling -
  • -
  • - Styled Components for styling -
  • -
  • - React-Apollo for interfacing with Apollo Client -
  • -
-
-
- React.js -

Apollo Client

- For Data Management - -
    -
  • - Performing GraphQL Mutations -
  • -
  • - Fetching GraphQL Queries -
  • -
  • - Caching GraphQL Data -
  • -
  • - Managing Local State -
  • -
  • - Error and Loading UI States -
  • -
  • - Apollo Client replaces the need for redux + data fetching/caching libraries -
  • -
-
-
- React.js -

GraphQL Yoga

- - An Express GraphQL Server For: -
    -
  • - Implementing Query and Mutation{' '} - Resolvers -
  • -
  • - Custom Server Side Logic -
  • -
  • - Charging Credit Cards -
  • -
  • - Sending Email -
  • -
  • - Performing JWT Authentication -
  • -
  • - Checking Permissions -
  • -
-
-
- React.js -

Prisma

- - A GraphQL Database Interface -
    -
  • - Provides a set of GraphQL CRUD APIs for MySQL or Postgres{' '} - Database -
  • -
  • - Schema Definition -
  • -
  • - Data Relationships -
  • -
  • - Queried Directly from our Yoga Server -
  • -
  • - Self-hosted or as-a-service -
  • -
-
- - - -
-); - -export default Diagram; diff --git a/finished-application/frontend/pages/index.js b/finished-application/frontend/pages/index.js deleted file mode 100644 index d316108..0000000 --- a/finished-application/frontend/pages/index.js +++ /dev/null @@ -1,7 +0,0 @@ -import Items from '../components/Items'; - -const Home = props => ( - -) - -export default Home; diff --git a/finished-application/frontend/pages/item.js b/finished-application/frontend/pages/item.js deleted file mode 100644 index ae1e086..0000000 --- a/finished-application/frontend/pages/item.js +++ /dev/null @@ -1,7 +0,0 @@ -import SingleItem from '../components/SingleItem'; - -const ItemPage = ({ query }) => ( - -); - -export default ItemPage; diff --git a/finished-application/frontend/pages/items.js b/finished-application/frontend/pages/items.js deleted file mode 100644 index 3426f4b..0000000 --- a/finished-application/frontend/pages/items.js +++ /dev/null @@ -1,3 +0,0 @@ -import Index from './index'; - -export default Index; diff --git a/finished-application/frontend/pages/me.js b/finished-application/frontend/pages/me.js deleted file mode 100644 index b0c2c25..0000000 --- a/finished-application/frontend/pages/me.js +++ /dev/null @@ -1,13 +0,0 @@ -import EditUser from '../components/EditUser'; -import PleaseSignIn from '../components/PleaseSignIn'; - -const MyAccount = () => ( - <> -

My Account

- - - - -); - -export default MyAccount; diff --git a/finished-application/frontend/pages/order.js b/finished-application/frontend/pages/order.js deleted file mode 100644 index 5298202..0000000 --- a/finished-application/frontend/pages/order.js +++ /dev/null @@ -1,7 +0,0 @@ -import Order from '../components/Order'; - -const OrderPage = props => ( - -); - -export default OrderPage; diff --git a/finished-application/frontend/pages/orders.js b/finished-application/frontend/pages/orders.js deleted file mode 100644 index 4c7c76d..0000000 --- a/finished-application/frontend/pages/orders.js +++ /dev/null @@ -1,10 +0,0 @@ -import OrderList from '../components/OrderList'; -import PleaseSignIn from '../components/PleaseSignIn'; - -const Orders = () => ( - - - -); - -export default Orders; diff --git a/finished-application/frontend/pages/permissions.js b/finished-application/frontend/pages/permissions.js deleted file mode 100644 index ad6b446..0000000 --- a/finished-application/frontend/pages/permissions.js +++ /dev/null @@ -1,10 +0,0 @@ -import Permissions from '../components/Permissions'; -import PleaseSignIn from '../components/PleaseSignIn'; - -const ItemPage = () => ( - - - -); - -export default ItemPage; diff --git a/finished-application/frontend/pages/reset.js b/finished-application/frontend/pages/reset.js deleted file mode 100644 index bc6e377..0000000 --- a/finished-application/frontend/pages/reset.js +++ /dev/null @@ -1,10 +0,0 @@ -import Reset from '../components/Reset'; - -const ResetPage = props => ( - <> -

So you wanna reset your password?

- - -); - -export default ResetPage; diff --git a/finished-application/frontend/pages/sell.js b/finished-application/frontend/pages/sell.js deleted file mode 100644 index 155f3b7..0000000 --- a/finished-application/frontend/pages/sell.js +++ /dev/null @@ -1,10 +0,0 @@ -import CreateItem from '../components/CreateItem'; -import PleaseSignIn from '../components/PleaseSignIn'; - -const Add = () => ( - - - -); - -export default Add; diff --git a/finished-application/frontend/pages/signup.js b/finished-application/frontend/pages/signup.js deleted file mode 100644 index cd522f8..0000000 --- a/finished-application/frontend/pages/signup.js +++ /dev/null @@ -1,20 +0,0 @@ -import styled from 'styled-components'; -import Signup from '../components/Signup'; -import Signin from '../components/Signin'; -import ResetRequest from '../components/ResetRequest'; - -const Columns = styled.div` - display: grid; - grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); - grid-gap: 20px; -`; - -const SignUpPage = () => ( - - - - - -); - -export default SignUpPage; diff --git a/finished-application/frontend/pages/update.js b/finished-application/frontend/pages/update.js deleted file mode 100644 index 7a8630d..0000000 --- a/finished-application/frontend/pages/update.js +++ /dev/null @@ -1,15 +0,0 @@ -import { Component } from 'react'; -import UpdateItem from '../components/UpdateItem'; -import PleaseSignIn from '../components/PleaseSignIn'; - -class Home extends Component { - render() { - return ( - - - - ); - } -} - -export default Home; -- cgit v1.3