Giter VIP home page Giter VIP logo

viaplay-test's Introduction

Viaplay

Viaplay Smart-TV react application.

Installation Guide

Clone the project.

git clone [email protected]:blacksrc/viaplay-test.git

Start development

  1. Open viaplay-test directory.

  2. Install dependencies.

$ yarn install
  1. Copy .env.development.local.example file to .env.development.local. The latest env variables will be added to .env.development.local.example. So do not delete or rename this file. Then open the copied file and add your environment variables:
# Application running port like: 3003
PORT=

# HOST => API endpoint host with "/" in the end like: https://content.viaplay.se/
REACT_APP_API_HOST=
# DEVICE => API endpoint device like: pc
REACT_APP_API_DEVICE=
# MARKET => API endpoint market like: se
REACT_APP_API_MARKET=

It will be look like something like this:

# Application running port like: 3003
PORT=3003

# HOST => API endpoint host with "/" in the end like: https://content.viaplay.se/
REACT_APP_API_HOST=https://content.viaplay.se/
# DEVICE => API endpoint device like: pc
REACT_APP_API_DEVICE=pc
# MARKET => API endpoint market like: se
REACT_APP_API_MARKET=se
  1. Run project in development mode.
$ yarn start

Test

To run all test cases.

$ yarn test

Project's structure

src directory contains some important sub directories which is explained below the tree view:

.
├── app
│   ├── api
│   ├── assets
│   ├── components
│   ├── config
│   ├── index.js
│   ├── layouts
│   ├── locales
│   ├── pages
│   ├── redux
│   ├── theme
│   └── utils

api:

Contains the api request functionality. There is a _API.js files which hold API class to implement a layer of abstraction for making request. So, any token or header variable or maybe refresh token functionality will be implemented there. For each model endpoint, There is a need to create a new file like Movie.js which will be used in different parts of the code to make request.

assets

Contains the static assets like images or styles.

components

Contains all components that is being used in the application.

config

Contains all application configuration. Basically this folder exits to read all environment variables from env file.

layouts

Contains all layouts of application like header, footer, main, etc. The layout components are not meant to be for implementing functionality. They are just here to load component into pages and construct the page structure.

locales

Contains all translations. To add new translations you need to just add another file and import it in index.js. Consider changing the key (se-SE) in the translation file.

pages

Contains all pages in the application. If there is any router implemented. It should load this components.

redux

Contains all redux functionalities.

theme

Contains theme variables, colors, break pints, fonts, etc. Adding new themes need to be implemented in index.js file.

utils

Contains all utility functions. If number of functions increased during the development, it can be decoupled in small files or maybe classes.

Todo

Things need to be done.

  • Localization.
  • Arrow control functionality.
  • Enter and Return functionality.
  • Create component visual documentation (Storybook).
  • Unit tests.
  • e2e tests (Cypress).
  • Review inline code comments.
  • Dockerizing.

viaplay-test's People

Contributors

blacksrc avatar dependabot[bot] avatar

Stargazers

Roman 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.