Project Structure

Get familiar with the files and folder structure of a newly created Gatsby project.

Introduction to the project structure

So far, we’ve generated a new project named Lark. Let’s now look into the important generated project folders and files, and see what each does.

You can explore this folder structure below. It shows all project files except the /.cache, /node-modules, /public folders, and the contents of /src/images folder.

import * as React from "react"
import PropTypes from "prop-types"
import { Link } from "gatsby"

const Header = ({ siteTitle }) => (
  <header
    style={{
      background: `rebeccapurple`,
      marginBottom: `1.45rem`,
    }}
  >
    <div
      style={{
        margin: `0 auto`,
        maxWidth: 960,
        padding: `1.45rem 1.0875rem`,
      }}
    >
      <h1 style={{ margin: 0 }}>
        <Link
          to="/"
          style={{
            color: `white`,
            textDecoration: `none`,
          }}
        >
          {siteTitle}
        </Link>
      </h1>
    </div>
  </header>
)

Header.propTypes = {
  siteTitle: PropTypes.string,
}

Header.defaultProps = {
  siteTitle: ``,
}

export default Header
Project structure

Folders structure

...