CoderManagement is a platform that helps individuals and teams manage their tasks.
These are more than just simple to-do lists. Task management tools allow teams to collaborate digitally by organizing, prioritizing, and assigning tasks to each other.
That's a lot! The actual task management system is quite large for us at the moment. But we can utilize our knowledge to achieve a few features from it. To be specific, let's implement the 1, 3, 7, 9, and 10 features in our app.
You're the CEO of a small tech start-up company.
After a while, you realize that you need a system that can keep track of the tasks and improve productivity.
As this is just an internal mini-project of the company, your goal is also to keep the cost low.
Remembered your amazing time at CoderSchool learning how to code, you roll up your sleeve and start up your Visual Studio Code.
As a wise programmer, you started off planning for an MVP (Minimum Viable Product). For the first phase of this product:
You came up with this design
You have decided for this first phase of the application that:
Everyone who uses the app is a user. there are 2 roles for user: employee and manager
You are the user that have higher authority in the company ( later could be other managers).
This hierarchy of roles allows us to limit access to certain features in the application that only the manager
has permission.
However, at this stage, you just want to warm up your coding skill and make the most straightforward version as fast as possible.
For now, your account will be created through compass with the role: manager
From a client app, you could test these routes to:
Create a new user by user's name. default role is employee
Browse for all your employee with filter
Search for an employee by name
Browse your tasks with filter allowance ( status
, createdAt
,updatedAt
,…). The following attribute is required to help category tasks by tag and status, also sorting bycreatedAt
,updatedAt
status
createdAt
,updatedAt
description
Get a detailed description of a single task by id.
You could search all tasks of 1 member either by name or id
You could assign member to a task or unassign them
You could create a task with the required information.
You could update the status of a task.
There are some rules for updating task status :
done
, it can't be changed to other value except archive
isDeleted
to true
Research and Apply: In backend development, input validation is an important step. This time, you are required to research on express-validator
and apply further control API request input.
body
for : existence, include name , name's value is a valid string.body
for : existence, and other requirements per task schema._id
, must be check for its : existence, is a mongo object id.In the real world, schema design is often the responsibility of senior devs. However, it is an important skill for a new developer to obtain and build gradually.
Don't worry. We will help you out a bit.
As you already identified the problem above, the next step is to critically think about Schema - how and what data we want to record in our database.
You will need 2 Schemas: User and Task.
User Schema:
name
, so there must be a name
field in user schema
. This is mandatory (required)manager
and employee
=> a role field in User
with String type and we need enum
validator for its value. moreThe
enum
validator is an array that will check if the value given is an item in the array. If the value is not in the array, Mongoose will throw an error.
Task Schema:
A task should contain the field name
and description
for the basic information. Can a task have no name and no description? For now, let's say make them mandatory too.
The task status is tricky. Let's say you have decided there are 5 types of the status
field: pending
, working
, review
, done
, archive
.
Key note from requirements
Instead of jumping right into making routes, we should plan for it by writing pseudo code. It would be helpful to have the big picture at the beginning.
User
Now it's your turn to complete all the requirements!
Everyone will start at a 100 score.
Requirement | Grade |
---|---|
Missing any requirements | -10 |
Missing the planning part a.k.a the pseudo-code for each route | -3 |
Handling probable errors | +10 |
This assignment's minimum pass score is 80/100
Good luck have fun!