An app that allows users to manage their tasks. Frontend built with React, Tailwind and Flowbite components. Backend built with Node/Express and MongoDB.
Live demo
TaskManager is a simple webapp that allows users to create, update and delete their tasks.
- Firstly, you will need to clone this repository to your machine.
-
Installing Node and NPM: This project depends on Nodejs and Node Package Manager (NPM). Before continuing, you must download and install Node (the download includes NPM) from https://nodejs.com/en/download.
-
Inside the
frontend
directiory runnpm i
to install dependencies. -
Starting the app: Start the app by running
npm run dev
. App should now be running at the specified port, access the given port to view the app.
NB: Since the backend has been hosted, you can fully test out the app by running the frontend alone :)
-
Firstly, you will need to clone this repository to your machine.
-
Inside the
backend
directiory runnpm i
to install dependencies. -
Starting the app: Start the app by running
npm run dev
. App should now be running at the specified port, access the given port to view the app.
NB: You'll need to add your own MongoDB url and JWT secret to the env file provided
The API documentation can be found here
I decided to go with a simple minimalistic design making it easy to use and interact with. To reduce the number of screens, modals were used in order to enhance user experience through out the application
The task body consists of title ie name of the task, priority, status and dueDate.
{
title: "complete code assessment",
priority: "high", // or low
status: "uncompleted", // or completed
dueDate: "2/03/2023"
}
Fields such as priority and status have specific options:
- priority: "high" or "low"
- status: "completed" or "uncompleted"
The data from the backend is fetched constantly to keep tasks up to date. Which means newly added tasks (or updated or deleted tasks) should reflect immediately after those requests are carried out. To maintain consistency in the frontend as well as backend, operations will only reflect if the API calls were successful, on failure, the user will be alerted about about what went wrong.
For managing the user session, the user token is stored in local storage upon login and used in the authorization header to provide authorization for protected endpoints. On token expiry, users will be logged out and will have to login again.
The tasks are being sorted by their properties such as due date, status and priority. Below is a code snippet for the sorting functions.
Code Snippet:
const sortByDueDate = (data) => {
const sortedTasks = [...data].sort((a, b) => Date.parse(b.dueDate) - Date.parse(a.dueDate))
return sortedTasks
}
const sortByPriority = (data) => {
const sortedTasks = [
//retrive all tasks with high priority
...[...data].filter(task => task.priority === "high"),
//retrive all tasks with low (not high) priority
...[...data].filter(task => task.priority !== "high")
]
return sortedTasks
}
const sortByStatus = (data) => {
const sortedTasks = [
// retrive all tasks with completed status
...[...data].filter(task => task.status === "completed"),
// retrive all tasks with uncompleted (not completed) status
...[...data].filter(task => task.status !== "completed")
]
return sortedTasks
}
- Pagination for tasks page to reduce scrolling.
- More metrics and graphs on the dashboard.
- Email notifications about tasks close to due dates.