Skip to content

beniceberg/portfolio

Repository files navigation

Ben

Ben Eisenberg portfolio

🛠 Setup

This project is set up using TypeScript as a programming language in a Gatsby framework with Sanity as a content management system.

  1. Clone the repo to your local system.

First fork the repo to your own github account, then hit clone or download and copy the HTTPS url. Then go to your terminal and clone the repository.

$ git clone https://github.com/<your-github-account>/beneisenberg.git
  1. Setup Sanity

Sanity.io is a platform for structured content that comes with an open source editor that you can customize with React.js. It's a fully customizable, headless CMS that uses GraphQL as aquery language for your API.

You'll have to install Sanity globally and create an account or log in.

In the terminal run

  $ npm install -g @sanity/cli && sanity login

Get your token to connect your Gatsby app to the Sanity backend In the terminal run

  $ sanity bedug --secrets

Copy the Authentication Auth token, api projectId and dataset and add them to your .env file in the root directory of this project.

  SANITY_PROJECT_ID=<api-projectid>
  SANITY_DATASET=<api-dataset>
  SANITY_TOKEN=<auth-token>

Navigate into the sanity directory and start it up.

  $ cd beneisenberg/sanity/
  $ sanity start

Now you'll find and create content using the GUI at http://localhost:3333/desk

  1. Setup Gatsby

Gatsby is a free and open source framework based on React that helps developers build blazing fast websites and apps

Navigate into your new site’s directory and download node_modules.

  $ cd beneisenberg/
  $ yarn

Once node modules are installed, start up the app.

  $ gatsby develop

Open the source code and start editing!

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.

Open the beneisenberg directory in your code editor of choice and edit src/pages/index.js. Save your changes and the browser will update in real time!

🧐 What's inside?

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

.
├── node_modules/
├── sanity/
├── src/
├── .env
├── .eslintrc.json
├── .gitignore
├── .prettierignore
├── .prettierrc
├── gatsby-browser.js
├── gatsby-config.js
├── gatsby-node.js
├── gatsby-ssr.js
├── LICENSE
├── package.json
├── README.md
├── tsconfig.json
└── yarn.lock
  1. /node_modules: This directory contains all of the modules of code that your project depends on (npm packages) are automatically installed.

  2. /sanity: This directory contains all the configuration for your sanity project.

  3. /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”.

  4. .env: This file contains environment variables. This file does not get pushed to github, so you have to create it if it doesn't exist.

  5. .eslintc.json: This file contains eslint configuration.

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

  7. .prettierignore: This is a file for Prettier. (see below prettierrc) Tells prettier which files to ignore.

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

  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. LICENSE: Gatsby is licensed under the MIT license.

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

  15. README.md: A text file containing documentation and information about the project.

  16. tsconfig.json: This is a configuration file for TypeScript.

  17. yarn.lock This is an automatically generated file based on the exact versions of your yarn dependencies that were installed for your project. (You won’t change this file directly).

💫 Deploy

Sanity

Run sanity graphql deploy to use new config for graphQL.

  $ cd beneisenberg/sanity/
  $ sanity graphql deploy

Gatsby

Gatsby’s build command should be run when you’ve added the finishing touches to your site and everything looks great. gatsby build creates a version of your site with production-ready optimizations like packaging up your site’s config, data, and code, and creating all the static HTML pages that eventually get rehydrated into a React application.

In the terminal run gatsby build.

  $ cd beneisenberg/sanity/
  $ sanity graphql deploy

Deploy to Netlify

Extra Information

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published