Web app to interact with a deck of cards
This is a simple web app allowing a magician to perform magic tricks. They can shuffle, draw and sort cards.
The app is mainly a React frontend supported by a minimal Node.js Express server backend.
To aid development and ensure quality, we:
.travis.yml
)These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
Clone the repo
git clone [email protected]:rwalle61/deck-of-cards.git
Install dependencies
npm install
npm run build
npm start
The app will be running at http://localhost:9100
.
Alternatively, you can run npm start
from
/server
to start only the server/client
to start only the clientRun npm run start:dev
from the root directory to start both the client and server in 'hot-restart' mode. Editing the client code will restart the client; editing the server code will restart the server
The client app will be running at http://localhost:42000
.
The server will be running at http://localhost:9100
.
npm run test:full
Run this from the root directory to run integration and component tests for both the client and server.
We use Cypress to perform client-server integration tests. Cypress manipulates our client, checking that calling the server's API renders the correct components.
If the app is already running, run these tests via the following command:
# With Cypress UI
npm run cypress:open
# Without Cypress UI, in command line
npm run cypress:run
If the app is not already running, use the following command to start the app, run the integration tests, then clean up:
npm run test:integration
These do not require the app to be running.
We use Jest to test that the client's components render correctly.
cd client
# Run all component tests
jest
# Run all component tests in watch mode
jest --watch
We use Mocha to test our server's APIs.
cd server
# Run all API tests
npm test
# Run all API tests and generate coverage report
npm run test:coverage
client/config/index.js
, set the cloud config to your Cloud Foundry address.npm run deploy:cloud
then update using npm run deploy:cloud:update