Giter VIP home page Giter VIP logo

lineup-now's Introduction

Full-Stack Engineer: Line-Up Coding Exercise

Tech used: React, React-Query, Cypress, Material UI, Docker, FastAPI, Pytest

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.

Frontend

Installation

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

Run locally

To run the frontend locally:

yarn start

Backend

Installation

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

Running the app

The client side of the app should be hosted on the port 3000 hence please go to:

http://localhost:3000

Running REST API outside the Docker image

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

Testing

Testing the REST API

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.

Testing the client

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.

lineup-now's People

Contributors

kamilpawel avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.