This setup was made on Linux. For Windows instead of using the 'sudo' command make sure you run the terminal as an admin. The Mac setup should use the same commands.
Please make sure you have yarn
installed. Here is the documentation on how to get it setup here.
Once you have yarn setup go to the frontend folder by running:
cd frontend
and install all the dependencies by running:
yarn install
To run the frontend locally:
yarn start
Please make sure you have docker installed. Here is the documentation on how to get it setup here.
Once you have docker installed, go to the backend directory by running:
cd backend
and build the docker image by running:
sudo docker build -t lineup .
Then run the container by running
sudo docker run -p 8000:8000 docker.io/library/lineup
The client side of the app should be hosted on the port 3000 hence please go to:
http://localhost:3000
This project uses pipenv
for virtual environment and pytest
for testing. The setup for pipenv can be found here.
To setup the virtual environment run:
pipenv install --dev
To run the virtual environment run:
pipenv shell
You can now run the REST API by running inside the pipenv virtual environment :
pipenv run start
This project uses pipenv
for virtual environment and pytest
for testing. The setup for pipenv can be found here.
To setup the virtual environment run:
pipenv install --dev
To run the virtual environment run:
pipenv shell
Once in virtual environment run:
pytest
You can also run the pipfile script by running:
pipenv run test
You should see all the tests passing.
The project was setup using cypress hence you need to make sure that both the frontend and backend are running as shown in instructions above.
To summarise make sure you have 2 terminals running one for the frontend:
yarn start
and the backend either inside the Docker container:
sudo docker run -p 8000:8000 docker.io/library/lineup
or by natively running FastAPI inside the pipenv virtual environment:
pipenv run start
Once you have both frontend and backend running, please run
yarn cypress run open
You should see all the tests passing.
You can also use the Cypress client to inspect the tests by running:
yarn run cypress open
Select the web browser to use and then click the test you want to run.