/ExpressQL

A Ready-to-Go API Skeleton using Node.js + Express.js + GraphQL + MongoDB + JWT Authentication

Primary LanguageJavaScriptMIT LicenseMIT

Express GraphQL API Start Kit (In Development)

Node.js + Express.js + GraphQL + MongoDB + JWT Auth

1. What is ExpressQL?

ExpressQL is a API Start Kit that bundles a bunch of features that almost every API needs. ExpressQL is written in Javascript following the ES6 convention.

ExpressQL uses the most popular Node.js web framework to deal with HTTP Requests: Express.js. The data flux is given by GraphQL, the default database is MongoDB and authentication uses JSON Web Token (JWT).

With ExpressQL you only need to write your custom endpoints and you'll have in your hands a bunch of features like authentication, permissions, caching, file uploading and many others.

2. Features

  • Full ES6
  • Functional programming approach
  • Airbnb Javascript coding style
  • Full GraphQL API, no REST endpoints
  • Vanilla GraphQL calls (Not focused on Relay users)
  • MongoDB connection
  • Jest tests
  • User creation
  • User updating
  • User password encrypted
  • User authentication
  • Creating and authenticating user with Facebook
  • Simple error handling
  • Auto generates a temporary Token on Login
  • Manage permissions
  • Image uploading support
  • File uploading support
  • Caching support
  • Serving static files
  • Sending emails

3. Installation

  1. Watchman:
  1. Node.js:
  1. MongoDB:
$ mongo
> use ExpressQL
> exit

4. How to Use

All the information that you need is in the Wiki.

5. Technologies Used

Technology Package Used
GraphQL express-graphql
MongoDB mongoose
JWT jsonwebtoken

6. Folder Structure

The structure of ExpressQL was designed for perfect scaling. The structure is explained on the schema below.

ExpressQL
│
└───services
    |
      # Try to concentrate all your internal logic in here,
      # Things evolving data manipulation, validations
    |
│
└───models
    |
      # This is were you put all your Mongoose models
      # In the models that you do the connection with MongoDB (CRUD methods)
    |
│   
└───graphql
|   └───mutations
    |
      # All GraphQL mutations goes here
    |
|   └───queries
    |
      # All GraphQL queries goes here
    |
|   └───types
    |
      # All GraphQL types goes here
    |
    schema.js # Main GraphQL schema file
|
└───tests
    |
      # This is were you put all your jest tests
    |
│