Skip to content

Rawne/swapi-graphql

 
 

Repository files navigation

swapi-character-browser

Getting Started

Install dependencies with

npm/yarn install

it will build the project API & client after install

Structure & Testing

src/ contains both the API and client(conviently located in /client) code, to run the tests for both just run:

npm test

Local Server

A local express server is in ./server, this will serve both the graphql API and the front-end. It can be run with:

npm run build/ npm run build-client # Only if you changed something
npm start

The web page will be opened athttp://localhost:8080/ (or similar; the actual port number will be printed to the console) to explore the API. A GraphiQL instance will be availlable at http://localhost:port/graphql

Choices

The assignment text was a bit ambiguous in places, so i decided to fill in some blanks, and have a bit of fun with the project.

  • I wasnt sure if it was expected to wrap the graphql SWAPI with another API, this seemed like overkill. I thought it made sense to just fork the graphql SWAPI, add some image fetching logic and a React web page.
  • I used imgur as the image source since it is an easy and public API, hopefully there will be some funny images.
  • I decided to be a bit lazy and just adjust the existing pipeline of the forked project(browserify & flow)

TODOS

If i had more time..

  • introduce some nicer tooling for the FE like webpack, scss and gatsby
  • Typescript instead of flow, and jest instead of mocha
  • A bit of fallback logic for some characters that do not have any easy to find memes on imgur(search albums?)
  • Add docker image for easy deployment
  • Setup travis/circleci
  • Add more tests (more component tests, snapshot tests, e2e tests)

About

A GraphQL schema and server wrapping SWAPI.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 97.6%
  • Shell 1.5%
  • Other 0.9%