We're running the starter at:
https://graphile-starter.herokuapp.com
Feel free to register an account and have a poke around as you see fit.
NOTE: emails are sent from Graphile Starter, so please only enter email addresses you control.
NOTE: every time we merge to master, we ship a new version of Graphile Starter to Heroku and entirely wipe the database, so your data may not persist. If you wish to delete your data before this time you can do so via the delete account feature baked into the starter.
We do not advise that you build your own projects on top of this project until you're comfortable with the various tools it uses (Node.js, Express, PostgreSQL, GraphQL, PostGraphile, Graphile Worker, Graphile Migrate, TypeScript, React, Apollo Client for React, GraphQL Code Generator, ESLint, Prettier, Jest, Cypress, etc).
This is an advanced project with deeply integrated tooling across the full stack. The project is called "Starter" because it helps you to start new projects with all these technologies, tools and techniques already in place. If you're not already familiar with these things then you'll probably find the project overwhelming, it is not intended to be your first experience of any of these tools.
If you're just getting started with PostGraphile, before you dive into this project make sure you check out the PostGraphile required knowledge and especially the schema design tutorial. This repository takes a slightly different approach to schema design than the aforementioned tutorial, but it's still an incredibly valuable resource.
Graphile Starter is an opinionated quick-start project for full-stack application development in React, Node.js, GraphQL and PostgreSQL. It includes the foundations of a modern web application, with a full user registration system, organizations (e.g. teams/companies/etc), session management, optimized job queue, a significant amount of pre-configured tooling, tests (both end-to-end and more granular) and much more.
It is suitable for building projects both large and small, with a focus on productivity. You might use it:
However you use it, the project can be deployed to many platforms, and can be scaled to larger audiences both horizontally and vertically with very few changes.
Please note that this software is not "complete," free of software defects, or free of security issues — it is not a "finished" solution, but rather the seed of a solution which you should review, customize, fix, and develop further.
It is intended that you use a "point in time" version of this software ─ it is not intended that you can merge updates to this software into your own derivative in an automated fashion.
PLEASE DONATE.
Take this software and use it as the starting point to build your project. Go make some money, and give something back to support us building more tools and kits for the Node, GraphQL and PostgreSQL ecosystems. We have made this project available under the simple and liberal MIT license to give you to a huge amount of freedom in how you use it, but this isn't possible without the help of our wonderful sponsors.
We need more people to join our sponsors so we can continue to bring about awesome projects like this. We'd love to spend more time on open source, building tools that will save you and others even more time and money ─ please sponsor our open source efforts:
And please give some love to our featured sponsors 🤩:
Chad Furman * |
Storyscript * |
Postlight * |
Surge.io * |
* Sponsors the entire Graphile suite
Graphile Starter is a full-stack GraphQL and React project, with server-side rendering (SSR) and routing thanks to Next.js. The backend is a beautiful pairing of Node.js and PostgreSQL running on Express.js, enabled by PostGraphile in library mode. The frontend uses the AntD design framework to accelerate development. The entire stack is written in TypeScript, with auto-generated GraphQL types and operations thanks to graphql-code-generator.
There are four tenets to Graphile Starter:
Graphile Starter is easy to start and everything is pre-configured as much as possible.
Speedy development: hot reloading, easy debugging, Graphile's idempotent migration system, job queue and server middleware ready to use; not to mention deep integration with VSCode should you use that editor: plugin recommendations, pre-configured settings, ESLint and Prettier integration and debugging profiles
Batteries included: full user system and OAuth, AntD design framework, Jest and Cypress end-to-end testing, security, email templating and transport, pre-configured linting and code formatting, deployment instructions, and more
Type safety: pre-configured type checking, strongly typed throughout with TypeScript
Best practices: React, GraphQL, PostGraphile, Node, Jest and Cypress best practices
See TECHNICAL_DECISIONS.md for a more detailed list of features included and the technical decisions behind them.
Since this is a highly opinionated starter; community members may have slightly different opinions and may choose to maintain forks of this project that apply their own opinions. A few of these are listed below; if you maintain a fork of this project please make a note at the top of your own README, and add it to this list:
VARIANTS ARE NOT OFFICIALLY SUPPORTED and may become out of date or unmaintained over time. If you have issues with variants, please submit issues or PRs to the projects in question, not to this project.
You can either work with this project locally (directly on your machine) or use a pre-configured Docker environment. We'll differentiate this in the README with a table like this one:
| Local mode | OR | Docker mode |
|---|---|---|
| command for local development | or | command for docker-compose development |
Be careful not to mix and match Docker-mode vs local-mode for development.
You should make a choice and stick to it. (Developing locally but deploying with
production.Docker is absolutely fine.)
IMPORTANT: If you choose the Docker mode, be sure to read docker/README.md.
For users of Visual Studio Code (VSCode), a .vscode folder is included with
editor settings and debugger settings provided, plus a list of recommended
extensions. Should you need it, there is also a .devcontainer folder which
enables you to use
VSCode's remote containers
giving you a local-like development experience whilst still using docker
containers.
Requires:
pg_dump command must be available (or you can remove this functionality)This software has been developed under Mac and Linux, and should work in a
bash environment.
Windows users: making a project like Graphile Starter run smoothly on
Windows can be a challenge; @JoeSchr and @hips on the
Graphile Discord have been working in improving
this and they're pretty pleased with the result, but you may still get some
teething problems. PRs to fix Windows compatibility issues are welcome (please
keep them small!) Failing that, try the Docker mode :)
Requires:
dockerdocker-composeHas been tested on Windows and Linux (Ubuntu 18.04LTS).
This project is designed to work with yarn. If you don't have yarn
installed, you can install it with npm install -g yarn. The Docker setup
already has yarn & npm installed and configured.
To get started, please run:
| Local mode | OR | Docker mode |
|---|---|---|
yarn setup |
or | export UID; yarn docker setup |
This command will lead you through the necessary steps, and create a .env file
for you containing your secrets.
NOTE: export UID is really important on Linux Docker hosts, otherwise the
files and folders created by Docker will end up owned by root, which is
non-optimal. We recommend adding export UID to your ~/.profile or
~/.bashrc or similar so you don't have to remember it.
Do not commit .env to version control!
You can bring up the stack with:
| Local mode | OR | Docker mode |
|---|---|---|
yarn start |
or | export UID; yarn docker start |
After a short period you should be able to load the application at http://localhost:5678
This main command runs a number of tasks:
graphile-migrate to watch
themigrations/current.sql file for changes, and automatically runs it
against your database when it changes@app/*/src to @app/*/dist so node/graphile-worker/etc. can run the
compiled code directlygraphile-worker to execute your tasks (e.g. sending emails)jest tests in watch mode, automatically re-running as the database
or test files changeNOTE: docker-compose up server also runs the PostgreSQL server that the
system connects to.
You may also choose to develop locally, but use the PostgreSQL server via
docker-compose up -d db.
Then for development you may need a console; you can open one with:
| Local mode | OR | Docker
$ claude mcp add starter \
-- python -m otcore.mcp_server <graph>