- Create a simple model on mongoose
- Create a REST CRUD (create, read, update, delete) for the model created using koajs
- it should be open sourced on your github repo
- Create a GraphQL Type for the model created, and expose it in a GraphQL endpoint
- Add tests using Jest
- Add authentication
- Add docker support
- Node >= 7.7.3
- MongoDB >= 3.2.12
- Clone this repo -
git clone git@github.com:yasserhussain1110/koa-graphql-app.git
- cd into cloned repo
- Copy sample .env file -
cp sample.env .env
- Fill in .env values
- Install npm dependencies -
npm i
- Start mongodb server
- Seed the database -
npm run seed
- Start server -
npm run start
- (Optional) Test application -
npm run test
-
Employee - This model created using Mongoose is manipulated using the Project's Rest API and GraphQL.
-
Admin - Admin model is used for authenticating requests.
- REST - Requests can be sent to update/fetch data via ordinary REST API.
- GraphQL - Requests can be sent to update/fetch data via GraphQL.
This project used Facebook's Jest Framework for testing
purposes.
Tests cover both REST API and GraphQL endpoints.