Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
Gatsby starter for a Not Todo app that connects to a REST API via an environment variable, using React and GraphQL.
The Not Todo Gatsby App is a Gatsby starter template that builds a 'not-todo' front-end on Gatsby and React, connecting to a REST API through a simple environment variable.
This is a Gatsby starter template that creates the front-end for a Not Todo application—a variation on the classic todo app—where the data lives in a separate REST API. It accepts no direct data input; instead it reads an API environment variable that points to the REST API endpoint, and produces a static Gatsby site with React components and GraphQL queries. The template's companion REST API is available in the smakosh/not-todo-api repository, and the project itself is open source under the MIT License.
API, allowing the same front-end code to target different backends (development and production) without code changes..env.development and .env.production files where you define the API variable, e.g., API=http://localhost:5000/api for local development.yarn to install, yarn start to run the development server, and yarn reset to clear the .cache and public directories.smakosh/not-todo-api, contains the REST API implementation and its own documentation, so the full stack is available.yarn start..env.development with the API variable, run yarn to install dependencies, start the companion REST API, then run yarn start to launch the dev server..env.production with a live API endpoint, you can generate a static site that uses that API for production data.yarn reset to remove the .cache and public folders whenever you need a clean Gatsby build.The template expects the REST API to be running separately; it then reads the API URL from the environment file and uses that as the data source during Gatsby's build process. The README outlines a four-step workflow: install Yarn if needed, create the environment file, start the API, and run yarn start for development. The reset script is available to clear generated folders.
Yes, the project is open source under the MIT License, meaning you can use, modify, and share it freely, including in commercial projects.
You need to define API in your environment files. For local development, create a .env.development file with the value API=http://localhost:5000/api; for production, create .env.production with the appropriate API URL.
Run yarn to install dependencies, ensure your REST API is running, execute yarn start, and the Gatsby development server will start. The exact commands are listed in the README.
The REST API is in a separate public repository named smakosh/not-todo-api, and its documentation is linked from the README. You must start it locally (or point the API variable to a deployed instance) before the Gatsby app can fetch data.
yarn reset do?yarn reset deletes the .cache and public folders in the Gatsby project, which can clear any corrupted build cache and force a fresh build on the next yarn start or yarn build.