Skip to content

Repository files navigation

GraphQL Starter Kit  

Project template for authoring GraphQL server applications with Node.js 6+ and JavaScript (demo). You can use it either just as a playground or a base for your next API project.


🔥 Want to strengthen your core JavaScript skills and master ES6?
I would personally recommend this awesome ES6 course by Wes Bos.

---

Directory Layout

.
├── /build/                     # The compiled output (via Babel)
├── /node_modules/              # Project dependencies (npm modules)
├── /scripts/                   # Build automation scripts
├── /src/                       # Node.js application source files
│   ├──/types/                  # GraphQL types /w resolve functions
│   │   ├── /User.js            # User account (id, email, etc.)
│   │   ├── /Viewer.js          # The top-level GraphQL object type
│   │   └── /...                # etc.
│   ├── /app.js                 # Express application
│   ├── /config.js              # Application settings
│   ├── /schema.js              # GraphQL schema
│   └── /server.js              # Node.js server (entry point)
├── /test/                      # Unit and integration tests
└── package.json                # The list of project dependencies

Getting Started

Just clone the repo and start hacking:

git clone -o graphql-starter-kit -b master --single-branch \
   https://github.com/kriasoft/graphql-starter-kit.git api.example.com
cd api.example.com
npm install
npm start                       # Alternatively, node scripts/start.js

The GraphQL server should become available at http://localhost:5000/ (live demo)

How to Build

If you need to build the project without launching a dev server:

node scripts/build.js           # Compiles the app into the /build folder
node scripts/build.js --watch   # Compiles the app and starts watching for changes

How to Test

npm run lint                    # Find problematic patterns in code
npm run test                    # Run unit tests once
npm run test:watch              # Run unit tests in watch mode

How to Debug

Pick one of the two ways of launching the Node.js app in a debug mode:

Option #1

node scripts/build.js --watch
node build/server.js --debug --nolazy

Option #2

node scripts/start.js --debug --nolazy

Then attach your debugger to the process listening on 127.0.0.1:5858 (learn more).

Contributing

Anyone and everyone is welcome to contribute. Start by checking out the list of open issues marked help wanted. However, if you decide to get involved, please take a moment to review the guidelines:

Related Projects

Support

License

Copyright © 2016-present Kriasoft, LLC. This source code is licensed under the MIT license found in the LICENSE.txt file. The documentation to the project is licensed under the CC BY-SA 4.0 license.


Made with ♥ by Konstantin Tarkus (@koistya) and contributors

About

Boilerplate and tooling for authoring data API backends with Node.js and GraphQL

Resources

Contributing

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages