|
| 1 | +--- |
| 2 | +slug: readme |
| 3 | +title: "Readme.md" |
| 4 | +date: "2017-08-10" |
| 5 | +--- |
1 | 6 | # gatsby-starter-redux-saas
|
2 | 7 |
|
3 | 8 | The GatsbyJS Starter to build your next Saas product on gatsby! See [demo](https://gatsby-redux.zauberware.com)
|
4 | 9 |
|
5 | 10 | 
|
6 | 11 |
|
7 |
| - |
8 | 12 | ## Quick start
|
9 | 13 |
|
10 |
| -1. **Create a Gatsby site.** |
11 |
| - |
12 |
| -Use the Gatsby CLI to create a new site, specifying the default starter. |
| 14 | +Use the Gatsby CLI to create a new site, specifying the default starter: |
13 | 15 |
|
14 | 16 | ```sh
|
15 | 17 | gatsby new my-saas-product https://github.com/zauberware/gatsby-starter-redux-saas
|
16 | 18 | cd my-saas-product
|
17 |
| -cp env_sample .env.development |
| 19 | +``` |
| 20 | + |
| 21 | +Clone `env_sample` file: |
| 22 | + |
| 23 | +```sh |
| 24 | +cp env_sample .env.development && cp env_sample .env.production |
| 25 | +``` |
| 26 | + |
| 27 | +Install packages and run the server: |
| 28 | + |
| 29 | +```sh |
18 | 30 | yarn && npm start
|
19 | 31 | ```
|
20 | 32 |
|
21 |
| -**Backend:** Make sure that you have a GraphQL Backend with a working JSON Web Token authentication running on http://0.0.0.0:3000/. You don't have a backend? Clone this repo [this](https://github.com/zauberware/rails-devise-graphql). |
| 33 | + |
| 34 | +**Backend:** Make sure that the `.env.development` file is included in the root of your project with an GraphQL endpoint defined with `APOLLO_API_URL=https://...` We connected our demo backend as a sample. You can bring your own backend and when it works with JSON Web Token the changes will be trivial. You don't have a backend? Clone this repo [this](https://github.com/zauberware/rails-devise-graphql). |
22 | 35 |
|
23 | 36 |
|
24 | 37 | ## What's included?
|
25 | 38 |
|
26 |
| -1. **Handle business logic**: This starter uses [react-redux](https://github.com/reduxjs/react-redux) to hold data and fire actions in the application. |
| 39 | +### 1. **Redux** |
| 40 | +This starter uses [react-redux](https://github.com/reduxjs/react-redux) to hold business data and fire actions in the application. Read more abour [redux](https://redux.js.org/basics/usage-with-react) and [combinedReducers](https://redux.js.org/api/combinereducers). |
27 | 41 |
|
28 |
| -2. **Apollo Client**: To communicate with the application server the starter uses [apollo-client](https://github.com/apollographql/apollo-client). Set the GraphQL endpoint in `.env.development` and `.env.production`. |
| 42 | +### 2. Apollo Client |
| 43 | +To communicate with the application server this starter uses [apollo-client](https://github.com/apollographql/apollo-client). Set the GraphQL endpoint with `APOLLO_API_URL` in `.env.development` and `.env.production`. |
29 | 44 |
|
30 |
| -3. **Authentication**: Ready to go authentication with [JSON Web Tokens](https://jwt.io/introduction/). The starter saves the current user in the redux store. We have implemented a demo backend with RubyOnRails, but you can connect any other graphQL backend. If the backend uses JWT the changes in the code will be trivial. |
| 45 | +### 3. Authentication: |
| 46 | +Ready to go authentication with [JSON Web Tokens](https://jwt.io/introduction/). The starter saves the current user in the redux store. We have implemented a demo backend with RubyOnRails, but you can connect any other graphQL backend. If the backend uses JWT the changes in the code will be trivial. |
31 | 47 |
|
32 |
| -4. **Optimized Images**: No more large, unoptimized images which dramatically slow down your site. The starter uses [gatsby-image](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-image) for optimized image loading. |
| 48 | +### 4. Optimized Images |
| 49 | +No more large, unoptimized images which dramatically slow down your site. The starter uses [gatsby-image](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-image) for optimized image loading. |
33 | 50 |
|
34 |
| -5. **SEO friendly**: The starter uses [react-helmet](https://github.com/nfl/react-helmet) and [gatsby-plugin-sitemap](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-sitemap) to make search engines happy. |
| 51 | +### 5. SEO friendly |
| 52 | + The starter uses [react-helmet](https://github.com/nfl/react-helmet) and [gatsby-plugin-sitemap](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-sitemap) to make search engines happy. |
35 | 53 |
|
36 |
| -6. **Google Wemaster Tools**: Define your google *webmaster key* to confirm the ownership in Google Webmaster Tools. Choose *Meta-Tag* when the Google asks you for the confirmation method. Set the key here in `gatsby-config.js`. The starter **does not** integrate Google Analytics so if you need it [install it by yourself](https://www.gatsbyjs.org/packages/gatsby-plugin-google-analytics/). |
| 54 | +### 6. Google Wemaster Tools |
| 55 | +Define your google *webmaster key* to confirm the ownership in Google Webmaster Tools. Choose *Meta-Tag* when the Google asks you for the confirmation method. Set the key here in `gatsby-config.js`. The starter **does not** integrate Google Analytics so if you need it [install it by yourself](https://www.gatsbyjs.org/packages/gatsby-plugin-google-analytics/). |
37 | 56 |
|
38 |
| -7. **Responsive UIs**: This starter uses the base component library [magicsoup.io/stock](https://github.com/magicsoup-io/magicsoup-stock). magicsoup.io gives you are rapid start to create wonderful UIs with [styled-components](https://github.com/styled-components/styled-components) and [styled-system](https://github.com/jxnblk/styled-system). |
| 57 | +### 7. Responsive UIs |
| 58 | +This starter uses the base component library [magicsoup.io/stock](https://github.com/magicsoup-io/magicsoup-stock). magicsoup.io gives you are rapid start to create wonderful UIs with [styled-components](https://github.com/styled-components/styled-components) and [styled-system](https://github.com/jxnblk/styled-system). |
39 | 59 |
|
40 |
| -8. **Static content with JSON and Markdown**: |
| 60 | +### 8. Static content with JSON and Markdown |
41 | 61 | This starter is combining those benefits with GatsbyJS' automatic slug and page creation via [gatsby-transform-remark](https://www.styled-components.com/) or setting static page data with [gatsby-transform-json](https://www.styled-components.com/).
|
42 | 62 |
|
43 |
| -9. **Markdown to StyledComponents**: When you love `styled-components` you will come to the point where you have to define styling for Markdown or other HTML output from a CMS. The starter uses `marksy` to map the generated HTML to custom defined `styled-components`. Not all are set, so do it by yourself under `src/templates/default-page.js`. |
| 63 | +### 9. Convert Markdown to StyledComponents |
| 64 | +When you love `styled-components` and `styled-system` we have good news: Map your styled-components to markdown or other HTML output from a file system or any other external API. The starter uses `marksy` to map the generated HTML to custom defined `styled-components`. Not all are set, so do it by yourself under `src/templates/default-page.js`. |
44 | 65 |
|
45 |
| -10. **Web-Fonts**: Every modern website or web app has a custom font. The starter uses [gatsby-plugin-web-font-loader](https://github.com/escaladesports/gatsby-plugin-web-font-loader) to load fonts from any server: Custom, Fontdeck, Fonts.com, Google, Typekit. Read more about the [webfontloader](https://github.com/typekit/webfontloader). |
| 66 | +### 10. Web-Fonts |
| 67 | +Every modern website or web app has a custom font. The starter uses [gatsby-plugin-web-font-loader](https://github.com/escaladesports/gatsby-plugin-web-font-loader) to load fonts from any server: Custom, Fontdeck, Fonts.com, Google, Typekit. Read more about the [webfontloader](https://github.com/typekit/webfontloader). |
46 | 68 |
|
47 |
| -11. **SSR**: The starter is SSR ready. Make `npm run build` to create the production resources. Choose your favorite deploment method. |
| 69 | +### 11. SSR |
| 70 | +The starter is SSR ready. Make `npm run build` to create the production resources. Choose your favorite [deployment method](https://www.gatsbyjs.org/docs/deploying-and-hosting/) and prepare your app for production. |
48 | 71 |
|
49 |
| -12. **Testing**: The starter includes everything you need to test your components with [jest](https://jestjs.io/docs/en/getting-started). Run `npm test` and see the run the first tests we have implemented. |
| 72 | +### 12. Testing |
| 73 | +The starter includes everything you need to test your components with [jest](https://jestjs.io/docs/en/getting-started). Run `npm test` and see the run the first tests we have implemented. |
50 | 74 |
|
51 |
| -13. **Backend**: If you need a demo backend than have a look at this basic [RubyOnRails boilerplate](https://github.com/zauberware/rails-devise-graphql). It implements authentication with [devise](https://github.com/plataformatec/devise) + [graphql-ruby](https://graphql-ruby.org/getting_started). |
| 75 | +### 13. Backend |
| 76 | +If you need a demo backend than have a look at this basic [RubyOnRails boilerplate](https://github.com/zauberware/rails-devise-graphql). It implements authentication with [devise](https://github.com/plataformatec/devise) + [graphql-ruby](https://graphql-ruby.org/getting_started). |
52 | 77 |
|
53 | 78 |
|
54 | 79 | ## Author
|
|
0 commit comments