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.