gamejitsu / gamejitsu-web

0 stars 0 forks source link

CI

:space_invader: Gamejitsu Web

The Gamejitsu Typescript React.js frontend.

:page_with_curl: Instructions:

1) Fire up your console & clone this repo:

❍ git clone https://github.com/gamejitsu/gamejitsu-web.git

2) Enter the directory and install all the dependencies:

❍ cd gamejitsu-web && npm install

3) Create .env file

❍ touch .env

4) Edit .env & add the following variables:

__❍ API_ENDPOINT=http://localhost:4000__

__❍ SOCKET_ENDPOINT=ws://localhost:4000__

5) Load the environment variables:

❍ cd .

6) Start the Next server!

❍ npm run dev

7) Visit the Gamejitsu home page on your browser:

localhost:3000

8) Start the tests:

❍ npm run test

Ngrok & Stripe

When a customer completes a checkout successfully, Stripe calls the backend to create a review request. If you are working with http://localhost:4000, of course Stripe cannot call it directly

You need to create a tunnel, start ngrok to support Stripe webhooks, it will allow the creation of the review request after a successful checkout.

❍ ngrok http -hostname=gamejitsu-dev-us.ngrok.io 4000

Notes

Check on the Stripe Dashboard, enabling test data, that both the api key and the stripe webhook secret are correct.

Before Committing

1) Run Prettier:

❍ npm run prettier -- --write

2) Run Tests updating snapshot if needed (or CI will fail):

❍ npm run test -- --updateSnapshot