Coder Social home page Coder Social logo

arge01 / gatsby-ts-apollo-starter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from eduard-kirilov/gatsby-ts-apollo-starter

1.0 0.0 0.0 12.3 MB

React (Gatsby), GraphQL, Apollo, Redux, Material-UI, Styled-Components, Jest, TypeScript.

Home Page: https://ph0en1x.ru/

License: MIT License

JavaScript 7.33% TypeScript 92.67%

gatsby-ts-apollo-starter's Introduction

React Gatsby Jest TypeScript Styled-components Material-UI


React, Gatsby, Jest, TypeScript, Apollo - Starter

This starter is a ready-made configuration that includes Gatsby, React, Redux, Apollo, GraphQL, TypeScript, Styled-Components, Material-UI, Jest, Enzyme.

demo

Demo:

⭐️ Advantage

  • This starter is configured to interact with GraphQL of your backend through Apollo.
  • Strong typing with TypeScript.
  • Typescript, Apollo, Mongo - backend.
  • Unit tests based on jest and enzyme.
  • In this starter, Styled-components and Material-UI can be used simultaneously.
  • This starter has tuned redux with reselect on board

🚀 Quick start

  1. You need to install dependencies.

    You can use yarn or npm.

    # install dependencies
    yarn
    # or
    npm install
  2. Create the .env.development and .env.production

    Create the .env.development and .env.production file from the .env.example file. Description of environment variables:

    • GATSBY_API_URL - your URL for GraphQL;
    • GATSBY_MEDIA_URL - your URL for media resources.
  3. Start the project.

    You can start a project using yarn or npm.

    # install dependencies
    yarn start
    # or
    npm run start

    Once launched, the app will be available on http://localhost:8000!

    _You will also see a second link: http://localhost:8000/__graphql. This is a tool that you can use to experiment with requesting your data if you export it to Gatsby, but since this project uses a separate server, you can access it at <Your backend / graphql>https://ph0en1x.herokuapp.com/graphql.

🧐 What's inside?

A quick look at the top-level files and directories you'll see in a Gatsby project.

.
├── __mocks __
├── jest
├── plugins
├── src
├──/──components
├──/──compose
├──/──gql
├──/──images
├──/──pages
├──/──stores
├──/──styles
├──/──utils
├── .env
├── .gitignore
├── .prettierrc
├── configureStore.ts
├── custom.d.ts
├── gatsby-browser.js
├── gatsby-config.js
├── gatsby-node.js
├── gatsby-ssr.js
├── gatsby-top-layout.js
├── jest.config.js
├── LICENSE
├── loadershim.js
├── package.json
├── tempPolyfills.js
├── tsconfig.json
└── README.md
  1. /__mocks __: __mocks __ - necessary for jest tests to work correctly You can read more here.

  2. /jest: - the configuration referenced by jest.config.js.

  3. /plugins: - a plugin that is needed to build material-ui styles.

  4. /src: This directory will contain all of the code related to what you will see on the front-end of your site (what you see in the browser) such as your site header or a page template. src is a convention for “source code”.

  5. .gitignore: This file tells git which files it should not track / not maintain a version history for.

  6. .prettierrc: This is a configuration file for Prettier. Prettier is a tool to help keep the formatting of your code consistent.

  7. configureStore.ts: Redux reducers are connected in this file.

  8. custom.d.ts: This file is necessary for proper svg processing with TepeScript.

  9. gatsby-browser.js: This file is where Gatsby expects to find any usage of the Gatsby browser APIs (if any). These allow customization/extension of default Gatsby settings affecting the browser.

  10. gatsby-config.js: This is the main configuration file for a Gatsby site. This is where you can specify information about your site (metadata) like the site title and description, which Gatsby plugins you’d like to include, etc. (Check out the config docs for more detail).

  11. gatsby-node.js: This file is where Gatsby expects to find any usage of the Gatsby Node APIs (if any). These allow customization/extension of default Gatsby settings affecting pieces of the site build process.

  12. gatsby-ssr.js: This file is where Gatsby expects to find any usage of the Gatsby server-side rendering APIs (if any). These allow customization of default Gatsby settings affecting server-side rendering.

  13. gatsby-top-layout.js: gatsby-top-layout.js - In this file happens:

  • Providing store in react-redux;
  • prefetching and data provider in @ apollo / client;
  • Providing topics in material-ui, styled-components and authorization;
  • Providing authorization data through AuthProvider.
  1. LICENSE: React, Gatsby, Jest, TypeScript, Apollo - Starter is licensed under the MIT license.

  2. jest.config.js: Here is the unit test configuration.

  3. package-lock.json or yarn.lock (See package.json below, first). This is an automatically generated file based on the exact versions of your npm dependencies that were installed for your project. (You won’t change this file directly).

  4. package.json: A manifest file for Node.js projects, which includes things like metadata (the project’s name, author, etc). This manifest is how npm knows which packages to install for your project.

  5. README.md: A text file containing useful reference information about your project.

This starter is based on Gatsby starter default

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.