Git Product home page Git Product logo

silex-front's Introduction

Silex front




Front-end application of the Silex pipeline
(Images: Blender Foundation)


Introduction

This project is built upon React / TypeScript and Material UI and talks with the CGWire Zou API with GraphQL in order to display and interact with the production data, launch dccs and manage scene versions.

We didn't want to rely on classical Qt interfaces in Python integrated in Houdini or Maya but leverage the power of the web through a user friendly and powerful frontend application.

Installation

The package manager used is Yarn. Clone the repository and install the dependencies:

$ git clone https://github.com/ArtFXDev/silex-front
$ cd silex-front
$ yarn install # Install the dependencies

Usage

Environment variables

Before starting the UI, copy the .env.example file to .env and configure the following variables:

They are:

  • VITE_ZOU_API - the url of the Zou server (like http://my-zou-server). It's the same URL as the Kitsu app (since they are behind a Nginx proxy).

  • VITE_WS_SERVER - the url of the Silex websocket service running on the client machine (open on the port 5118).

  • VITE_TRACTOR_URL - url of the Tractor interface

  • VITE_TRACTOR_BLADE - the url of the Pixar Tractor Blade service running on the computer.

  • VITE_TRACTOR_LOG_URL - Tractor log retrieval url (see: https://rmanwiki.pixar.com/display/TRA/Logging)

  • VITE_TICKET_URL - URL of the Ticket system (we currently use Zammad)

  • VITE_HARVEST_URL - URL of Harvest, the render farm monitoring UI (deprecated)

Available scripts

The build system is Vite, it's a faster alternative than CRA (Create React App) / Webpack.

  • πŸš€ yarn dev -> runs the Vite development server with HMR (hot module replacement)

  • πŸ‘· yarn build -> builds and bundle the whole app in a dist folder. It is used to bundle the code into static files meant to be hosted on a web server like Nginx or Apache.

  • πŸ”¨ yarn tsc -> runs the TypeScript compiler and report errors. Add :watch to run an interactive process that watches file changes.

  • πŸ’… yarn prettify -> prettify the code with Prettier. Add :write to write the modifications.

  • 🚨 yarn lint -> shows ESLint warnings and errors. Add :fix to apply auto fixes.

Docker image

The front-end can be deployed using Docker. First build the image:

$ docker build -t artfxdev/silex-front:<version> . # use whatever version tag you want

The image uses Nginx to serve the files so you can run it locally:

$ docker run -it --rm -p 127.0.0.1:80:80 artfxdev/silex-front:<version>

⚠️ Issues

Currently, Silex uses the Zou API to authenticate the user against the database. For that we make a request to /api/auth/login and we receive headers with the Set-Cookie directive so that the token is sent again on future requests.

Recently the standards changed for the SameSite attribute for cookies which restrict the usage to a first-party or same site context.

Previously if the SameSite value wasn't provided (it was not the case for Zou, see this) cookies were sent all the time. This is the behavior of Electron and our desktop app is concerned.

Since the Zou API is hosted on a different domain name than Silex, cookies must now have the SameSite=None value with the Secure attribute which allows the usage of the cookie on another domain but forces HTTPS which may not be ideal...

It also constrain the local development of the front-end since you need to setup https locally. Hopefully you can disable it in Firefox or Chrome.

Libraries

Here are the main libraries and packages used:

Library Version
Material UI 5.13.1
React 18.2.0
TypeScript 5.0.4
socket.io-client 4.6.1
React router 6.11.2
Apollo Client (React) 3.7.14

Special thanks

  • Karrik is a libre font created by Jean-Baptiste Morizot et Lucas Le Bihan. It is licensed under the SIL Open Font License, Version 1.1.

Contributing

Pull requests and issues are welcome. For major changes, please open an issue first to discuss what you would like to change.

✨ This project uses the Conventional Commits convention for commit messages. They are checked automatically with a git hook (thanks to Husky and commitlint).

βœ… There is also a pre-commit hook that will check and format your staged files with ESLint and Prettier. (thanks to lint-staged)

License

MIT @ArtFX

silex-front's People

Contributors

acedyn avatar ayaee avatar guillaumeroeder avatar johhnry avatar michaelhaussmann avatar olivierargentieri avatar shlule avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

silex-front's Issues

Basic login and logout

The interface should provide a reliable way to login and logout the user.

Should also be possible to have a user page with session information.

  • Separate login page from other pages (also put pages into their own folder for organization)
  • Move login button and avatar to the right of the header
  • Center login on page and add Silex logo
  • Correct the color of the avatar text when there is no profile picture
  • Make the avatar clickable when mouse hovering it
  • Do form validation when entering the email address
  • Enable press enter to submit login
  • Add Silex text next to logo in the header and make it clickable to go home /
  • Make a user page with information (like Kitsu)
  • Fix double rendering which leads to http get /authenticated twice

silex_gif

Handle overflow

When the step label is too long, it overflows

image

Check if it does that with command's labels too

File explorer

Implements a file explorer with a tree structure. It should be possible to navigate into sequences / shots / task / scenes and ultimately versions (both local and remote).

  • Implement the left menu with a Drawer
  • Implement a switch project button next to the avatar
  • Have a tree view to display sequences/shots/task/scenes
  • Remove sequences and display them as category

Screenshot from 2021-09-21 00-08-31

Update README

Add documentation to the README including badges / screenshots, run commands and global architecture.

More robust state management

As the project is getting more complex, we might want to consider those issues:

Use a proper state management library like:

Because right now, using React contexts is fine but we might get into trouble later with unnecessary re renders : https://blog.logrocket.com/pitfalls-of-overusing-react-context/

For now we have this:

<SnackbarProvider maxSnack={3}>
  <ProvideGraphQLClient>
    <ProvideSocket>
      <ProvideAuth>

        {/* ... */}

      </ProvideAuth>
    </ProvideSocket>
  </ProvideGraphQLClient>
</SnackbarProvider>

Take the step's index in acount an reorder them when the index changes

When new steps are inserted during the execution of an action, all the indexes of the following steps are shifted to insert the new steps in between. When an update is sent, the order of the steps must be recomputed using the index attribute to allow inserting steps in the middle of other steps.

Display a circular progress on login

The login action can take some time. For user feedback, it would be great to display a circular progress until it's completed.

Check the material UI documentation for that.

Show asset categories

Just like the sequences for the shots, show the asset categories in the asset browser

Add new parameters

  • Create a parameter to choose in a list of predefined choices
  • Create a parameter for toggle
  • Create a parameter for slider with a range
  • Create a prettier parameter for file path
  • Create a prettier parameter for file int

Sort the tasks by order

In the explorer view, the tasks that are returned by the queries are not sorted by the order defined by the pipeline. This is especially visible on the list view.

Suscribe to zou's events for real time updates

If a user creates a shot on a running instance of Kitsu or update a task, the data does not update on another client with Apollo GraphQL. (except when reloading the page)

A nice way would be to suscribe to zou's events with socketio as described in the Gazu documentation and then refetch the active GraphQL queries (see this)

Asyncio connection to WSS

Handle asyncio connection with the WSS server.

  • Store socket in React.Context
  • Store the list of dccs and fetch this at startup and update on connect and deconnect
  • Make a view with the dccs (with logos)

The boolean parameter does always display the default value

Step to reproduce:

  • go on silex-client
  • git checkout conform-action
  • rez build -i
  • rez env silex_client -- silex action conform

-> the value of the parameter "Conform the sequence of the selected file" is actually false but shown to true
If you let the parameter at the default value, the value will actually be false

image

Create a new task / task / asset type button

Be able to create a new task (possibly a task type?)

Do the same for assets to easily create them during the production.

  • Create a new asset
  • Create a new task (use task names with the default main)
  • Create a new shot
  • Create a new sequence

Add 404 not found page

Since nginx will redirect to index.html if the route is not found, we need to have a 404 error page.
Screenshot from 2021-10-28 13-00-36

Right now the page will show up but with no users.

Show the sequence / shot in the explorer

Description

When browsing the tasks of a shot in the explorer, we don't actually know the sequence we are currently in because the shot number could be included in another sequence.

For example:

Solution

It should show SQ01 / SH01

Refactor: move components into separate folders

Currently the components are in the components folder and some of them are alongside the pages folder.

It would be more appropriate to introduce another level of folder structure like common or wrappers

Stop using React.FC

Fade UI elements

When UI elements are rendered, it's not visually nice if they are not fading in/out.

Use Transitions in MUI to smooth the user experience πŸ’…

New parameter types

New parameter types for commands include:

  • Multiple select
  • Int array
  • Task selector

Work with diff for performance boost in big actions

Steps to reproduce:

git checkout optimisation
rez env silex_client -- silex action stress-test

Problem

This action iterate over the tester action 40 times. It ends up with a huge action which is supposed to mimic the size of a conform action on a big scene.
The more steps there is, the slower it gets. If we work only with diff, the action can have any size and update time will not grow (or a little)

Add support for multiple running actions

Tweak the ActionContext context to add an array of actions and organize the action page in tabs.

The actions should be canceled by the user and switch between them

Create new parameters

Steps to reproduce:

git checkout parameter-update
rez env silex_client -- silex action tester

Parameters

  • Text parameter, readonly text to display : {type: {name: "text"}, value: <string>}
  • Path parameter, update to handle more options: {type: {name: "Path", multiple: <bool>, extensions: <string[]>}, value: <string> | <string>[]}
  • Frame set parameter, like a string parameter with regex check {type: {name: "FrameSet"}, value: <string>} (see FrameSet docstring at https://github.com/justinfx/fileseq/blob/master/src/fileseq/frameset.py)

Optional sugar (These parameters are used only in hidden parameters for now)

  • Warn the user when he press "continue" and a value is still null
  • List parameter, this parameter is a list of any parameter, it would be similar to the multiparm folders in houdini:
    {type: {name: "list", itemtype: {<the-type-of-the-parameter-in-the-list>}}, value: <any[]>}

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.