Skip to content

An demo workout webapp using node, graphql with relay modern, mongoose, docker, react, linaria and jest

Notifications You must be signed in to change notification settings

skywickenden/gym

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gym

WORK IN PROGRESS

A small webapp for logging and graphing activity down the gym.

Demonstrates usage of:

  • Docker for a unified developement environment and easy pushing to production
  • React - using hooks
  • Linaria for CSS
  • Relay for graphql embeded in React
  • Webpack and babel for minification and transpilation
  • Express and graphql-js for a graphql api
  • Mongoose for a mongodb
  • Jest - with react-testing-library - for testing on fronted and back
  • Eslint for linting

Setup

Clone into a folder. Copy example.env into .env and edit .env to add unique db passwords and ensure that the ports the app runs on are available. Copy example.mong-init.js into mong-init.js and add the same passwords as entered into .env.

Run docker-compose build followed by docker-compose up.

Developing

To install new packages: Run the docker with docker-compose run --rm client sh or docker-compose run --rm api sh and then use npm install <package_name>. Type exit to return to your command line and then rebuild and rerun - only this time add a -V switch... docker-compose up -V. This will force the deletion of the anonymous node_package volume and prevent a docker race condition issue.

Graphql schema changes are developed on the api. They then need copying to the client and compiling:

  • A service that watches for graphql schema changes on the server and copies them to the local schema docker-compose run --rm client npm run getschema
  • A service that compiles react-graphql schema code into graphql for hot reloading. docker-compose run --rm client npm run relay

There is a seperate test runner for both client and api

  • The test runner. docker-compose run --rm client npm run test
  • The test runner. docker-compose run --rm api npm run test

There is a seperate linting process for both client and api

  • The test runner. docker-compose run --rm client npm run lint
  • The test runner. docker-compose run --rm api npm run lint

About

An demo workout webapp using node, graphql with relay modern, mongoose, docker, react, linaria and jest

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages