Code Monkey home page Code Monkey logo

whoiswho-graphql's Introduction

Spring boot + React + GraphQL Example

This project contains a full example of an application developed using GraphQL within the Java ecosystem. The backend uses Spring boot, Spring Data, and the GraphQL Java Kickstart library.

The frontend uses React (with React hooks) and the Apollo GraphQL client.

Installation

The backend requires JDK 11+ and can be installed using:

cd whoiswho-backend
./mvnw package

The frontend requires Node.js 12+ can be installed using:

cd whoiswho-frontend
npm install

Running

To run the backend, you need JDK 11+ and you can use the following command:

cd whoiswho-backend
WHOISWHO_SECURITY_PASSWORDSTRENGTH=10
WHOISHWO_SECURITY_TOKENSECRET=myspecialsecret 
./mvnw spring-boot:run

To run the frontnd, you need Node.js 12+ and you can use the following command:

cd whoiswho-frontend
npm start

Testing it out

The backend provides a GraphQL Playground to test things out. The playground is located at http://localhost:8080/playground by default. Authentication happens by passing a JWT token as a header by using the Authorization: Bearer <token> header.

A JWT token can be obtained by calling the login mutation. By default, there is a user created with the following credentials:

By default, the JWT token is valid for 4 hours, but this can be extended by the use of the whoiswho.security.tokenexpiration property.

The frontend will run at http://localhost:3000. Logging in can be done through the credentials provided above.

whoiswho-graphql's People

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.