Git Product home page Git Product logo

technical-test-2's Introduction

alt text alt text alt text alt text

Bug Fixes

Bug One Fixed

We couldn't get the name of the project because it is an object in an Array, therefore we need to get the object from the array first before with project[0]

Bug Two Fixed Bug Number two Fixed, the property _id is located inside an object which is then located inside an arrya, to get the id we need to first get the object inside the array with project[0], then we can get the id property *

Bug Three Fixed

Fixed undefined error on getting the values from the project

Bug Four Fixed

the add-input-to-a-list function, We needed to add the input to the values array first before mapping through the array to display each added item, This requires us to run the the mapping of the values after the form submission

Bug Five Fixed We need to call the handleSubmit function when the button is clicked not on the onChange

Bug Six Fixed FIXED the name of the project was not being displayed

Feature Added

Delete All feature
In the frontend code, I've added a button labeled "Delete all projects" that triggers the deletion of all projects when clicked. When the button is clicked, it first clears the local state variable projects to ensure that the frontend reflects the changes after deletion. Then, it prompts the user with a confirmation dialog to confirm whether they want to proceed with the deletion. If the user confirms, it sends a DELETE request to the backend API endpoint "/project/" using the api.remove function. Upon successful deletion, it displays a success toast message using toast.success and redirects the user to the "/project" page using history.push("/project").

Backend code In the backend code, I've implemented a route handler for DELETE requests at the "/" endpoint. This route is protected by the Passport middleware, ensuring that only authenticated users can access it. Inside the route handler, I use ProjectObject.deleteMany({}) to delete all documents in the "ProjectObject" collection in the MongoDB database. If the operation is successful, I send a 200 OK response with { ok: true }. If an error occurs during the deletion process, I catch it, log it to the console for debugging purposes, and send a 500 Internal Server Error response with details about the error.

Technical test

Introduction

Fabien just came back from a meeting with an incubator and told them we have a platform “up and running” to monitor people's activities and control the budget for their startups !

All others developers are busy and we need you to deliver the app for tomorrow. Some bugs are left and we need you to fix those. Don't spend to much time on it.

We need you to follow these steps to understand the app and to fix the bug :

  • Sign up to the app
  • Create at least 2 others users on people page ( not with signup )
  • Edit these profiles and add aditional information
  • Create a project
  • Input some information about the project
  • Input some activities to track your work in the good project

Then, see what happens in the app and fix the bug you found doing that.

Then

Time to be creative, and efficient. Do what you think would be the best for your product under a short period.

The goal is to fix at least 3 bugs and implement 1 quick win feature than could help us sell the platform

Setup api

  • cd api
  • Run npm i
  • Run npm run dev

Setup app

  • cd app
  • Run npm i
  • Run npm run dev

Finally

Send us the project and answer to those simple questions :

  • What bugs did you find ? How did you solve these and why ?
  • Which feature did you develop and why ?
  • Do you have any feedback about the code / architecture of the project and what was the difficulty you encountered while doing it ?

Bug Fixes

Bug One Fixed

Bug Two Fixed

Bug Three Fixed

Bug Four Fixed

Bug Five Fixed

Bug Six Fixed

Feature Added

Delete All feature

Backend code

technical-test-2's People

Contributors

easyblend avatar goffle 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.