Coder Social home page Coder Social logo

dailymoderation's Introduction

Dailymoderation

Dailymoderation is a client media moderation tool that I have developped with the intention to show my software engineering skills to the technical interviewer. This tool makes use of a GraphQL API which has been provided in the technical test package.

Tool demonstration

Dependencies

How to run with Docker

The build and run process has been tested using Docker version 24.0.6

Production environment

make run-prod

Development environment

make run-dev

Run unit tests

make run-test

Clean the container

make clean

How to run with NPM

The run process has been tested using node v18.18.2 and npm v9.8.1

Building for production

npm run build
#... production files available in ./dist

Development environment

npm run dev

Run unit tests

npm run test

Design choices

Comunication with the GraphQL/REST APIs

The moderation client tool communication with two APIs:

  • GraphQL : The provided Apollo Server to fetch, censor and validate media.
  • REST: The public Dailymotion API, I used it because the title field was missing from the media information returned by the GraphQL API.

Sequence Diagram

React Router

I have made the choice to use React Router, firstly to display my skills with this library and also for the following reason:

Single Page Application

React Router is perfect to create modern Single Page Application, and it is certain that a media moderation tool will be composed of more than one page (Login, Profile, Logout route, etc.)

Better user experience for handling unexpected errors

React Router provides us with a way to add an Error Element inside of our routes, thus, displaying a user-friendly error page in case of any unexepected error.

Action functions inside the routes

My first approach was to use an action function to handle all the API and GraphQL queries and mutations. And for this case, React Router is very handfull and allows us to create some interface between the functionnal components (the vue) and the Rest/GraphQL APIs by acting as some king of controller, which gives us a good way of dealing with separation of concerns.

At the end, I went with another approach because I wanted to make use of the hooks provided by the @apollo/client library and to use a Redux Store to manage a global state, using action function would have forced me to add to much logic inside my Moderation Page functionnal component and make it too much overloaded.

Custom hook useMediaModeration

I decided to use a custom hook to handle the overall media management, fetching, censoring and validating logic. This was motivated by a need to separate concerns inside the ModerationPage component.
It would have been too much overloaded if all the hooks (Redux's hooks, Apollo's hooks, useEffects) would have been inside it.

Unit tests

I have always been taught that unit tests and test driven developments are a must-have in the software engineering field. This is why I have tried to implements several unit tests available inside the test folder.
I have been able to succesfully implement simple tests and mocks for testing the useMediaModeration custom hook.

Thanks

Thank you for the time taken to review this project.

Amin GHELIS

dailymoderation's People

Contributors

amghelis avatar

Stargazers

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