This project is to develop a simple page where the user can add some tasks at specific hours of the day, save them, edit them or even remove them.
Deployed URL: Heroku page
Github repository: day-planner repo
When accessing the page, the user can see a large header with title and the current date. Underneath is a set of time blocks which represent a working day. Each time block consists of a time label on the left, a text field in the middle where the user can enter a task, two buttons on the right to save the task in the text field or remove it from the text field.
The text fields in the timeblocks are colour coded based on the current time:
The user also has access to a database to keep track of their tasks. When interacting with the page, the user can:
For this project, the following technologies and libraries were used:
For public file structure:
For the source file structure and database:
The following steps were followed as listed to develop this project, and are further details in the sections below:
First pass:
Second pass - addition of server and database:
The user journey is explained above in the section General description. When looking at it in terms of functions, this can be translated into the following logic:
The routes needed for interaction with the database are detailed below:
As a result, the structure of the server was built as per this illustration:
For this project we used the following versions of the libraries mentioned above:
Node.js: 18.2.0
NPM: 8.9.0
NPM packages:
"dotenv": "^16.0.1",
"express": "^4.18.1",
"mysql2": "^2.3.3",
"nodemon": "^2.0.16"
Styling libraries:
Styling of the page is a combination of a local CSS file and the use of some bootstrap classes:
There is the option to refactor the render functions to create the time blocks and the buttons with jQuery/template strings syntax. That would potentially reduce the amount of code in those blocks.
It would also be possible to modularise the code so that the rendering functions and other utility functions live in their own module.
It would also be good to add restrictions on task length: if the string is above a certain number of characters, it alerts the user that the message is too long, and the user must edit it to be able to save it.