This is a React & Typescrypt based project, that allow you interact with the SW-API
stack:
- Coded on React 17
- Uses hooks instead of Classes.
- Uses Context API. (Avoiding Redux)
- Fully typed using typescript.
- Follows Airbnb code style
in all cases you must clone this repository as first step
## by https
git clone https://github.com/SuichiM/starsWarsProject.git
## or by ssh
git clone [email protected]:SuichiM/starsWarsProject.git
you have serveral ways to run the project, we strongly recommend run the project in a docker container using docker-compose.
requirements node 12+
- install the dependecies
npm i
- run the dev server
npm run start
- build the container
docker build -t my_stars_wars_container .
- run the container
docker run -p 8080:8080 -v $PWD:/home/app -d my_stars_wars_container
- install the dependencies
docker exec <container_name> npm i
- run the dev server
docker exec <container_name> npm run start
having docker-compose
simplifies the process to run the project in a container.
- build and run the service
docker-compose up -d
- install the dependecies
docker-compose exec web npm i
- run the dev server
docker-compose exec web npm run start
# compile the project for production
npm run build
# lint and fix the files follow the styleguide
npm run lint
#format the code
npm run format
for test the aplication you can run the commands as follow. These commands will create a docker container that runs cypress.
for test the aplication you must have the dev server running.
first of all move to the e2e
folder
cd e2e
docker run -it --rm \
--network host \
-e CYPRESS_baseUrl=http://localhost:8080 \
-v $PWD:/e2e \
-w /e2e \
--entrypoint cypress \
cypress/included:6.2.1 run --project .
run this command on a terminal
xhost +local:
docker run -it --rm \
--network host \
-v ~/.Xauthority:/root/.Xauthority:ro \
-e DISPLAY=unix${DISPLAY} \
-e CYPRESS_baseUrl=http://localhost:8080 \
-v $PWD:/e2e \
-w /e2e \
--entrypoint cypress \
cypress/included:6.2.1 open --project .
feel free to send your PR for any improvement or bugfix
SuichiM