An example app demonstrating role based authentication and file upload with Relay and GraphQL.
An example app demonstrating role based authentication and file upload with Relay and GraphQL.
Users may have a role of type reader, publisher or admin. Readers can access a list of all posts and their own profile. Publishers can additionally create posts and see a list of their own posts. Admin role is not used widely yet.
Uses cookie-session and jsonwebtoken to save session data in form of a JSON Web Token in a cookie. This data contains the users id and its role and is made available as rootValue in GraphQL schema.
$ npm install
Start the local dev server:
$ npm start
Navigate to http://localhost:3000/ to view the app. Login with email [email protected], [email protected] or [email protected] and password qwerty.
$ npm run test:server
$ npm run update-schema
Based on Essential React starter kit