- Create database from api-test.sql file
- Edit knexfile.js to match your connections details
- Start API server
- Enjoy!
Whenever you start a server, it will automatically execute updateSchema.js script in order to compile the schema definitions, defined in schema.js, to schema.json and schema.graphqls. This is required by Relay framework. However, you could also run the script manually:
$ npm run update├── server - All of the server side code resides in this folder
│ ├── config - Configuration
│ │ └── environment - Separate configuration for each environment
│ │ ├── development.js - Development configuration
│ │ ├── index.js - Common configuration used in any environment
│ │ ├── production.js - Production configuration
│ │ └── test.js - Test configuration
│ ├── data - Data and APIs
│ │ ├── models - Model classes that encapsulate query logic
│ │ ├── mutations - GraphQL mutations
│ │ ├── types - GraphQL types
│ │ ├── database.js - Shared instance of query builder
│ │ ├── schema.graphqls - Compiled schema in a readable form
│ │ ├── schema.js - Schema definitions
│ │ └── schema.json - Compiled schema to be used by Relay
│ ├── utils - Utilities
│ │ ├── babelRelayPlugin.js - Babel-relay-plugin provided by Relay
│ │ ├── logger.js - Logging utility
│ │ └── updateSchema.js - Code for compiling the defined schema to schema.json and schema.graphqls
│ └── index.js - Server entry point
└── package.json - List of dependencies
GraphQL - GraphQL is a query language and execution engine tied to any backend service.
Express - Express is a minimal and flexible Node.js web application framework that provides a robust set of features for web and mobile applications.
Webpack - Webpack is a module bundler that takes modules with dependencies and generates static assets representing those modules.
Babel - Babel is a JavaScript compiler which allows you to use next generation, ES6/ES7, JavaScript, today.
ES6/ES7 - ECMAScript 6, also known as ECMAScript 2015, is the latest version of the ECMAScript standard. ES6 is a significant update to the language.
Eslint - The pluggable linting utility for JavaScript and JSX.
Nodemon - Monitor for any changes in your node.js application and automatically restart the server.