Skip to content

ErikssonJoakim/hexagonal-user-application

Repository files navigation

Hexagonal User Application

test lint

Install

These instructions will get your project up and running on your local machine for development and testing purposes.

Prerequisites

Be sure to have the following properly installed and running:

Setup

Install the dependencies and build the project:

yarn && yarn build

Test

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

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

Setting up the MySQL database

Launch the following commands to set up the database

Configuration

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

Build docker image

docker build -t database-image ./database

Run docker container

docker run --restart=always -d --env-file=./database/.env -p 3306:3306 -v ${PWD}/database/data:/var/lib/mysql --name database-container database-image

Execute queries inside the container

docker exec -it db-container mysql -u root -psecret test

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages