Closed sgdavis1 closed 2 years ago
sensorVal
valueNick had run into trouble with the Express server so moved ahead with a lot of great work connecting the site with Firebase so that he could add some functionality to the webpage using JavaScript to both write and read to/from a database hosted on Firebase. We discussed the implications of this (modules would need access to the internet to store values) and decided to make a goal of reworking the code so that it can contact the local Express server instead. We also discussed the future need of adding a lightweight (sqlite) database to the Node/Express system so that we can store the state of the sensors more permanently.
Some progress on creating a local database using Sequelize:
Decided MAC address would be a useful unique identifier for modules. Worked with Sequelize on the front-end and learned a few basics of data models and even setup a data dictionary to store a stateful representation of the sensor values in the browser memory. Since this is not the direction the code should be heading it was a good learning experience but the next weeks work will be to adjust the server side code to support Sequelize and the data models on the server instead of in the browser. We talked through the details of how this would work and looked at some examples and code documentation on the main Sequelize home page.
Lots of learning and code reorganization, created a working front end. Learned a lot about Sequelize and relational databases. Talked about pull requests and reiterated the importance of creating a new "clean" branch.
models/index.js
with javascript generated by SequelizeNick was able to get the 1 to many relationship between plants, and the DB schema is updated. Worked on models/index.js
but didn't get this completed. Added an API call (two new controllers) so that plants can be added / removed from the front end and the front end grabs the data by calling the API now.
Using ChartJS to do the graphing on the front-end (Great work!!). Still working through the front-end AJAX calls.
BLOB
Nick did some file renaming and is still working on more code reorganization. Worked on storing plant images as a BLOB in the database, learned a lot. Multipart forms are quirky. Worked on the models/index.js
generated file.
public/js
) https://learn.jquery.com/using-jquery-core/models/index.js
from SequelizeNick is making some progress on jQuery implementation throughout the project. Added a document "ready" event handler and "click" handlers. Added an api
folder for controllers. Still working on getting the binary data to correctly POST to the web application.
Defer the effort on the upload of the plant image until after the first accepted Pull Request
models/index.js
from SequelizeFinal meeting to wrap up the project for the summer! Reviewed and accepted the pull request, then tested it locally with a simple debug controller. Congrats @Nick-Hageman and @Nate-Schaefer !!
Track progress of summer project for Nick Hageman and Nate Schaefer