day-planner

Day-planner

Summary

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

Table of content

General description

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:

Screenshots

Day planner screenshot - desktop version ![Day planner screenshot - desktop version](./assets/screenshots/desktop-day-planner.png)
Day planner screenshot - mobile version ![Day planner screenshot - mobile version](./assets/screenshots/mobile-day-planner.png)

Technologies

For this project, the following technologies and libraries were used:

For public file structure:

For the source file structure and database:

Development steps

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:

Wireframe

Day planner - wireframe

Functionalities

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:

Day planner - general logic

The routes needed for interaction with the database are detailed below:

Day planner - Routes for api calls

As a result, the structure of the server was built as per this illustration:

Day planner - Server structure

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:

Head link - Bootstrap ```html ```
Head link - Fontawesome ```html ```
Head link - Google fonts ```html ```
Body link - jQuery ```html ```
Body link - moment.js ```html ```

Styling

Styling of the page is a combination of a local CSS file and the use of some bootstrap classes:

Allocation of classes - author and bootstrap

Further improvements possible

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.