Just because this makes experimenting with graphql easier for me :)
Build upon create-react-app and apollo-client. Text Linting via editorconfig-checker and eslint
Server with node, typescript and babel including nodemon for easy development. Linting via editorconfig-checker and tslint.
Githook provides linting on every commit. Makefile for easy usage, see below.
For a new project do something like this (and replace MY_PROJECT_NAME with your actual project name):
git clone [email protected]:mstruebing/graphql-react-node-boilderplate.git MY_PROJECT_NAME && \
cd MY_PROJECT_NAME && \
rm -Rf .git && \
git init && \
git add . && \
git commit -m 'initial commit' && \
make install && \
make build
You will need to create an .env
file in the root of the directory where you
can store your secrets.
At the moment only JWT_SECRET
is needed to sign the jwt-tokens.
export JWT_SECRET='hallowelt'
Important commands:
make start-client
: starts the client for development purpose.
make start-server
: starts the server for development purpose.
make start-database
: starts the database via docker.
The Graphl-Playground is reachable via 'http://localhost:4000/playground'
Makefile: In the root of the project is a Makefile:
There is an info target which is the default target and lists all targets:
$ make
lint: lint-server lint-client
install: setup install-server install-client
build: build-client build-server
test: test-client test-server
start-client
build-client
lint-client
install-client
test-client
start-server
start-database
build-server
lint-server
install-server
test-server
setup