A terminal based JavaScript application that allows users to record their ratings of environmental factors such as noise, light, temperature, and humidity. The program stores entries during the session and provides a summary.
- Environment Ratings: Rate noise, light, temperature, and humidity on a 1–5 scale
- Notes: Add optional notes to each entry
- History: View previously recorded entries
- Summary: Calculate average ratings for each environmental factor
- Input Validation: Prevents invalid ratings outside the 1–5 range
- Interactive Menu: Add entries, view history, view summaries, or exit
- Terminal-Based: Runs directly in the command line
The user creates an entry by rating four environmental factors:
- Noise: 1–5
- Light: 1–5
- Temperature: 1–5
- Humidity: 1–5
The user can also add optional notes.
The history feature displays previous entries, while the summary feature calculates the average rating for each environmental factor.
Note: The ratings are subjective user inputs and are not measurements from physical sensors.
You need Node.js installed on your system.
Download the repository as a ZIP from GitHub and extract it. Open Terminal and navigate into the downloaded project folder.
From inside the project folder, run:
node src/sensory_tracker.jsThe program will then run in terminal.
After starting the program, you will see four options:
- Add Entry
- View History
- View Summary
- Exit
Select 1 and rate each environmental factor from 1–5. You can also enter optional notes about the environment.
Select 2 to view all entries recorded during the current session.
Select 3 to calculate and display the average rating for each individual environmental factor.
Select 4 to end the program.
In this video, I go through options 1, 3, and 4
Sensory.Environment.Tracker.Demo.mov
This project helped me practice:
- JavaScript functions
- Arrays and objects
- Conditional statements
- User input with Node.js (readline)
- Calculating averages
- Building an interactive terminal application
- Needed to learn how to collect user input in a Node.js terminal application. This is something new to me.
- Had to validate user ratings so that ONLY whole numbers from 1–5 were accepted.
- Needed to organize multiple environmental measurements into objects and store them in an array.
I developed the project by first creating the terminal input system and then adding the rating validation, entry storage, history display, and summary calculations.
I tested the program using valid and invalid ratings, multiple entries, optional notes, and different menu selections.
- Saving entries to a file so they persist after the program closes
- Adding timestamps to entries
- Adding visual charts or graphs
- Creating a graphical user interface
- Allowing users to customize the rating categories
- Creating a connection between this and my "Environment Sensory Sensor" repo.