Giter VIP home page Giter VIP logo

factorial-bi's Introduction

Factorial Growth Engineer Challenge

The goal of the challenge is to evaluate your hard skills by providing a working code that can be presented to the rest of the team.

๐Ÿ–ฅ Your Job

Your job is to create a simple app with a backend and a client, with a special emphasis on quality. Feel free to use whatever tools you feel more comfortable with for the frontend and the backend, but those must be separated (single-page application). Youโ€™ll get extra points if the tool can be easily run on our machines.


๐Ÿ’ช The Challenge

Your challenge is to build a Frontend + Backend application that allows you to post and visualize metrics in a usable way. Each metric will have a timestamp, name, and value. The metrics will be shown in a timeline and must show averages per minute/hour/day and persisted in the database.

The maximum time for the challenge is 8 hours in the time frame we establish. Feel free to use any tools you need, but remember to keep your code accessible on the public GitHub repository and use one of our technologies (React, Next.js...). If possible include both the backend and frontend code in the same repo.


โœ… To evaluate

Once you deliver the challenge, weโ€™ll schedule a second meeting with the rest of the team to evaluate your coding process, your ability to write clean code, and beautiful CSS (you can use preprocessors like Sass, Stylus, CSS-in-JS,..., or vanilla CSS), your ability to analyze and test your solution, and your capacity to prioritize the project and your decisions.


My Implementation

The Stack

  • TypeScript
  • NextJS
  • TailwindCSS
  • Tremor (React Library to build Dashboards Fast)
  • Supabase (PostgreSQL DBaaS)
  • FalsoJS (To generate false data to seed the database)
  • Prisma (Node.js and TypeScript ORM)
  • Jest (Testing Library

The Implementation

The implementation consist on a dashboard that allows to visualize the sales of the company, and it shows the value of the sales along time, and also the number of clients along time.

It also shows the accumulated sales, the total clients and the total sales.

You can filter the data and show it by day, by hour and by minute, so you have a deeper insight of when the sales happen. Also showing the average revenue in those different time intervals.

The Implementation also has a manage table, where you can add or remove new data, and it's paginated so it's easier to visualize the information.

The result page is mobile ready, and all the libraries are prepared to be responive, although due to the requirements of the data it should manage, it might be hard to update the database using a phone.

The implementation uses classes to manage the database and to process the information, I decided to do so due to the cleaness of the code and the reusability.

It also has a /utils/types.d.ts where you can find the types I used for the data of the application.

Currently it has no authentication, but it could be easily added using the Supabase Auth library or NextAuth, that's why the APIs are not protected, in a real world scenario they should be protected with a JWT token or similar.

For the backend instead of using ExpressJS or a dedicated server, I decided to use NextJS API Routes, which are very easy to use and very fast to implement. I think it's a great solution for small projects like this one.

Testing

For testing purpose as the generation of the data is random, I focused on testing the funcions I used for processing the data.

Those tests are:

  • The sum of all the prices of the sale is correct
  • The total sales count is correct
  • The Average of all the prices in the data array is correct
  • The sum of all the prices for each day of sales is correct

Useful information

  • You should run yarn when you download the code to install the dependencies
  • You should create a .env file with the database information, it should be a PostgreSQL address, you can ask me for the db I used and I would send the .env
  • You would probably like to seed the database in order to visualize the information, that's why you should run npx prisma db seed
  • You can also find the application running at https://factorial-bi.jorgeorejas.com
  • For any other doubt I would be able to answer to it at the next interview.
  • In the application, you can remove all the entries in the database by clicking on the "Remove All" button in the header of the application, and you can add a 100 randomly generated entries by clicking on the "Seed 100" button.

Possible improvements

This project was developed in 8 hours, so there are some things that could be improved before being a production ready application. If the company finally adopts a tool like this, there are some improvements that could be done:

  • Add authentication, both for access and for API usage.
  • Update the database to a realtime database provider, that way the company can watch live how the sales evolve.
  • After the improvements in the routing system presented at the NextJS Conf (25th of October), the layout would be much more easier to implement and yet faster

factorial-bi's People

Contributors

jorgeorejas avatar

Stargazers

 avatar

Watchers

 avatar

factorial-bi's Issues

Thanks for using our library!

Hi @jorgeorejas, great job on the dashboard! If you would like to share any feedback regarding tremor's developer experience or desired features, feel free to drop me a message :) Happy to hop on a call as well

Cheers, Chris

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.