These instructions will get your project up and running on your local machine for development and testing purposes.
Be sure to have the following properly installed and running:
Install the dependencies and build the project:
yarn && yarn build
Test the project with the following command:
yarn test
This will build the project and launch test:jest
and test:e2e
.
The e2e test launches the dockerized mysql database together with the graphql api service and the react app, before running the cypress e2e tests. Once completed it shuts down the database and deletes any data that was saved.
Launch the app of your choosing:
GraphQL API (dependant on the MySQL database)
yarn start:graphql
React web application (dependant on the GraphQL API)
yarn start:react-app
Launch the following commands to set up the database
The database and server require certain environment variables to work. Go ahead and use the .env.example files provided by changing the file name to '.env'
mv .env.example .env && \
mv ./database/.env.example ./database/.env
docker build -t database-image ./database
docker run --restart=always -d --env-file=./database/.env -p 3306:3306 -v ${PWD}/database/data:/var/lib/mysql --name database-container database-image
docker exec -it db-container mysql -u root -psecret test