Tailwind CSS
·
TypeScript
·
SASS
·
ESLint
·
Style Lint
·
Font Awesome
·
React i18next
·
React Testing Library
·
Cypress
A fully loaded starter kit for Gatsby development to get your website up and running in minutes.
Code quality & Testing tools are also already configured for your ease.
Demo |
---|
The generated project have dependencies that require
node
,npm
andGatsby CLI
.
Make sure you have Node version >= 8.0, npm >= 5 & GatsbyCLI
# create a new Gatsby site using this template.
gatsby new my-gatsby-starter https://github.com/brionmario/gatsby-starter
# change the directory
cd my-gatsby-starter/
# start the development server. Site will run on http://localhost:8000
npm start
gatsby-starter/
├── coverage/ * unit test coverage reports.
├── cypress/ * cypress tests folder.
├── docs/ * contains documents and document resources.
├── i18n/ * contains i18n translations and config.
├── node_modules/ * contains dependencies pulled from npm.
├── public/ * generated public folder for distribution.
├── src/ * source folder
│ ├── assets/
│ │ ├── images/ * images and icons.
│ │ └── styles * SASS stylesheets.
│ ├── components * shared reusable components.
│ ├── layouts * app layouts.
│ ├── models * typescript schemas.
│ ├── pages * app pages.
│ └── types * custom typings.
├── static * contains static assets that needs to be copied to public folder.
├── .eslintignore * files and folders that need to be ignored from linter.
├── .eslintrc.js * es-lint configuration file.
├── .gitignore * contains files that are ignored from git
├── gatsby-browser.js * where Gatsby expects to find any usage of the Gatsby browser APIs.
├── gatsby-config.js * main configuration file for a Gatsby site.
├── gatsby-node.js * where Gatsby expects to find any usage of the Gatsby Node APIs
├── gatsby-ssr.js * where Gatsby expects to find any usage of the Gatsby server-side rendering APIs.
├── CONTRIBUTING.md * project contributing guidelines
├── cypress.json * cypress configuration file.
├── LICENSE.md * licensing information.
├── package.json * contains all the npm scripts for building, running, deploying etc. and contains all the dependencies
├── package.lock.json * lock file for npm.
├── postcss.config.js * post-css configurations.
├── README.md * Readme file for the repository
├── tailwind.config.js * tailwind CSS configuration file.
├── stylelint.config.js * style lint configuration file.
└── tsconfig.json * typescript configuration file.
What you need to run this app:
Make sure you have
Node.js
andnpm
installed by running the following simple commands on the command line and see if you're running the latest stable versions.
- Node.js - Type
node -v
on the terminal. - npm - Type
npm -v
on the terminal.
If you do not have them installed, click here and grab the latest stable version of node
and npm
will be automatically installed along with it. Or if you have brew
already installed in your local machine, execute brew install node
command to get node
.
Follow the Gasby CLI install instructions and get it installed on your environment.
This will enable the usage of gatsby
command.
Use the Gatsby CLI to create a new site, specifying the default starter.
# create a new Gatsby site using this template.
gatsby new my-gatsby-starter https://github.com/brionmario/gatsby-starter
Navigate into your new site’s directory and start customizing.
# change the directory
cd my-gatsby-starter/
You can execute the below command to fire up the server.
npm start
Your site is now running at http://localhost:8000
!
Note: You'll also see a second link: http://localhost:8000/___graphql
. This is a tool you can use to experiment with querying your data. Learn more about using this tool in the Gatsby tutorial.
The index.scss
file inside the src/assets/styles
directory is the main stylesheet for the project and will be compiled by Gatsby's build.
If you want to add your own stylesheet, you can place it under the src/assets/styles/partials
folder and import it in the index.scss
file.
For example if you want to include the styles for a slider:
- Create a
_slider.scss
partial file in thesrc/assets/styles/partials
directory. - In
index.scss
add@import 'partials/slider.scss';
Execute the following commands to generate linting for styles and scripts.
# all
npm run lint
# JavaScript & Typescript files.
npm run lint:es
# Style files.
npm run lint:styles
Execute the following command to run both unit test suite and e2e test suite.
npm run test
Execute the following command to run your unit tests.
npm run test:unit
The following command will run the unit tests in watch mode.
npm run test:unit:watch
If you want to generate the code coverage for the project, use the following command.
npm run test:unit:coverage
We have used React Testing Library for unit testing.
Execute the following command to run your unit tests.
npm run test:e2e
We have used Cypress for E2E testing.
Execute the following command to build your app in production mode.
npm run build
Deploy this starter with one click on Gatsby Cloud:
Please read CONTRIBUTING.md for contributing guidelines and to learn about our code of conduct.
Thanks goes to these wonderful people (emoji key):
Brion Mario 💻 📖 🚇 🚧 |
This project follows the all-contributors specification. Contributions of any kind welcome!
This project is licensed under the BSD Zero Clause License(0BSD) License - see the LICENSE.md file for details.