Giter Club home page Giter Club logo

amirnd51 / mlmodelscope Goto Github PK

View Code? Open in Web Editor NEW

This project forked from c3sr/mlmodelscope

0.0 0.0 0.0 622.12 MB

MLModelScope is an open source, extensible, and customizable platform to facilitate evaluation and measurement of ML models within AI pipelines.

Home Page: http://www.mlmodelscope.org

License: University of Illinois/NCSA Open Source License

Shell 0.13% JavaScript 87.19% CSS 0.02% HTML 0.13% Dockerfile 0.06% SCSS 12.47%

mlmodelscope's Introduction

MLModelScope Frontend

Getting Started

Prerequisites

  • Node.js (== 14.21.3 is the confirmed working version)
    • It is recommended to use nvm to manage your Node.js versions across multiple projects
  • Docker (latest version) and Docker Compose (latest version)
    • Docker is used to run the backend services (e.g. database, MLModelScope server) locally
    • Run the compose file found in the corresponding API repository in order to start the backend services for use in local development (https://github.com/c3sr/mlmodelscope-api)

First-time setup

  1. Install dependencies

    npm install
  2. Copy .env.example to .env. The default values in .env.example should be suitable for local development.

    cp .env.example .env

Running the app

In order to run the app completely, make sure the backend services are running (see Prerequisites above), then run the following command:

npm start

This will start the frontend app in development mode. Open http://localhost:3000 to view it in the browser.

Running storybook

Storybook is a tool for developing UI components in isolation. It is useful for developing and testing components. Additionally, there is a storybook deployment that is automatically updated when the develop branch is updated. The storybook deployment can be found here.

To run storybook locally, run the following command:

npm run storybook

This will start storybook in development mode. Open http://localhost:6006 to view it in the browser.

Running tests

To run the unit tests inside the terminal, run the following command:

npm test

In addition, most IDEs have a way to run tests from within the IDE. Refer to your IDE's documentation for more information on how to run Jest tests.

Project Structure

The project is structured as follows:

  • src/ - Contains the source code for the frontend app
    • components/ - Where the components for each of the pages reside. Subfolders within this folder are grouped by individual pages that are displayed on the website. Note that the React component (.js[x]), styles (.scss), and associated React hooks (use[*].js) will always be found within the same directory.
    • resources/ - Contains the resources (e.g. images, icons, etc.) used by the frontend app
    • /router/ - Contains page routes. Any new pages to the website are added through the routes array in router/config.js
    • /routes/ - Contains any wrapper components for specific page routes (for example, different wrappers for the model listing page for whether it is in "add mode" or "list mode"
    • /helpers/ - Contains helper functions and classes that are used throughout the frontend app
  • /public/ - Contains the public assets for the frontend app (e.g. favicon, index.html, etc.)
  • /.storybook/ - Contains the configuration for storybook
  • /scripts/ - Contains scripts that are used for development and deployment

Recommended Workflow for creating new components

Create a new folder in src/components/ with the name of the component, and create the following files as needed:

  • [ComponentName].jsx - The main React component
  • [ComponentName].scss - The styles for the component
    • Note that any new stylesheets should also be imported into src/Stopgap.scss
  • use[*].js - Any React hooks that are used by the component
  • [ComponentName].stories.jsx - The storybook stories for the component
  • [ComponentName].test.jsx - The unit tests for the component
  • use[*].test.js - The unit tests for the React hooks

Writing tests for UI components

This project uses Enzyme for testing React components. Enzyme is a testing utility for React that makes it easier to test React components. It is recommended to use Enzyme's shallow rendering API to test components. Shallow rendering is useful for testing components in isolation, and it is recommended to use shallow rendering for unit tests. For more information on shallow rendering, refer to the Enzyme documentation. Note that due to some shortcomings in Enzyme's ability to test React hooks, it is recommended to use the React Testing Library for testing React hooks.

Project Wiki

https://wiki.mlmodelscope.org

mlmodelscope's People

Contributors

andrewpixo avatar pixoanne avatar youngest avatar reneezhu avatar abduld avatar yen-hsiang-chang avatar pixoalex avatar pixo-steve avatar pixo-matthew-fotzler avatar cli99 avatar cwpearson avatar imgbotapp avatar jinjunxiong avatar codacy-badger 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.