Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

Title: ​Green House

Description:​ A web application where users can go to share information about their house and
garden plants and perhaps, take a leaf from someone else’s book. Users will have information
like their USDA Hardiness Zone and their collection of plants, with notes attached to each one,
stored on their account. They will be able to easily track and update variables like watering
frequency, soil used, temperature, light exposure, and fertilization for each plant in their
collection. They will be able to promote this information on a centralized forum to either share
their success stories or to request advice or diagnosis from other plant owners, including
specific personal images of plants in their collection.

Roles: ​We decided to implement agile workplace philosophy for this small project, therefore our
squad has a great deal of autonomy. Each member of the squad will have end-to-end
responsibility for specific tasks and outcomes of the project, making their own judgements about
how to solve specific problems. Holly and Marianna both have experience with databases, API
and front-end development, David suggested that he has a great handle on styling and
formatting. However, we decided that we will all take our own part in every step of development
with following leadership attributions:
Holly ​-- web developer, back end dev leader (API), scrum master, team coordinator
Marianna -​ - web developer, database leader (MySQL)
David​ -- web developer, front end leader (node.js, bootstrap)
Jordan​ -- web developer, QA chapter leader

Tentative plan:
Week 4 -- Team Intro, Planning, Research
Week 5 -- Research, Design, API testing
Week 6 -- Database Design, Data Seed and scripting, Functional pages development
Week 7 -- Putting it all together
Week 8 -- Final Testing, Packaging the project

Code base ​located:


https://github.com/hollygoaightly/cst336_project

Database configuration ​is stored in dbPool.js file.

Changes from Original Design:​ Since the initial design, we have dropped the user photo
upload for a user’s individual plant, user’s ability to search for other user’s plants on the site,
and the gamification of the site.

Task Distribution:
Holly:
● Trefle API implementation throughout the site.
● Search functionality for the user’s plant catalog.
● Backend functionality for a user to add a plant from the search catalog.
● Plant’s Talk page development
Marianna:
● Backend Authentication
● Database design and implementation(Comment, Login, LoginPlant, Plant, Post)
● Local API development
● Plant’s Talk page development
David:
● Front-end design and layout for site
● Your Plants page development (both backend and frontend)

External API used:


https://trefle.io/api/v1/plants/search?token=6t4ZVV4DE7bKaqSg1CDFPHq3r5giNXINF3qlk43Po
vk&q=[search​ string]
Internal API used:
/api/getMyPlants -- gets all plants in the collection of logged in user
/api/insertLoginPlant -- adds a plant to logged in user collection
/api/insertPlant -- adds a Trefle plant to database table `Plant` for reference to other database
objects
/api/getPosts -- gets the list of all posts for Plants Talk page
/api/getComments -- gets all comments to map with the posts (above)

Node.js Modules used in the project:


Bcrypt -- for hashing passwords for storing in the database
Multer, multerS3, aws-sdk, dotenv -- for storing user’s provided images into S3 bucket
established for posts, created by registered users. S3 bucket Access Key ID and Secret Access
Key are stored in .env file for security purposes, then manually imported into Heroku
configuration for functionality on heroku site.
Express-session -- for session storage and operations

Database schema and data ​script (sqldump) is archived in zip file here:
https://github.com/hollygoaightly/cst336_project/blob/main/GreenHouse20201212.zip

Following ​techniques ​were utilized in database design:


Foreign keys, Primary Keys, Unique Key (for loginname)
User’s password is stored BCRYPTed in `HashedPwd` column
Database schema:
Version 1

Version 2
Version 1 Design
Final Result

From the home page, only the Find Plants, Sign In, and Register pages are accessible. The rest
redirect to the Sign In page.

The sign in page prompts for Username and Password, checking the database for valid pairs.
Passwords are stored using bcrypt.
The Registration page has required fields and input validation.

The Your Plants page allows for users to update existing data about their plants.
The Plant Talk page allows users to post about plants in their Your Plants collection (stored in
the Login Plant table) and to comment on other posts.

Here is an example of a post with comments.


The add plants page lets users search for a plant by keyword. This keyword is sent in a REST
request to the trefle.io API.

The results from the Trefle API response are displayed on the Results.ejs view. Logged in users
will have visibility of the “Add to my plants” button, while other users will not. On clicking the
button, the plant is added to both the Plants table and (if it is not already there) to the LoginPlant
table as well. The user is notified if the plant was successfully added to their Your Plants
collection or if it is already in said collection.
Note​: recently there has been an issue with some of the image urls provided by the Trefle api
not loading. When visiting these urls, stored at ​https://bs.floristic.org/​, 404 errors are received.
This should be temporary.

You might also like