For centuries, cultures around the world have utilized the therapeutic properties of certain flowers in their daily lives. This site allows the user to read about the benefits of medicinal flowers/herbs. Also, users are able to leave comments about how they have used the flower as medicine (brewed the pedals in a tea, used the buds as a topical ointment, etc.)
This API is using the following:
- Express version 4.17.1
- MongoDB: version 3.4.0
- Mongoose: version 5.8.1
- Models and Routes for Users, Posts, and Comments are located in the app folder.
- The seed folder containes userseed.js, a file that establishes the admin credentials
- The endpoints for authentication, posts, and comments are shown below.
Action | Method | Path |
---|---|---|
Sign-Up | POST | /sign-up |
Sign-In | POST | /sign-in |
Change-Password | PATCH | /change-password |
Sign-Out | DELETE | /delete |
Routes | Method | Path |
---|---|---|
Create | POST | /posts |
Index | GET | /posts |
Show | GET | /posts/:id |
Update | PATCH | /posts/:id |
Delete | DELETE | /posts/:id |
Routes | Method | Path |
---|---|---|
Create | POST | /comments |
Update | PATCH | /comments/:commentId |
Delete | DELETE | /comments/:commentId |
Website Resources
- I have a background in biology/pre-med and I love Botany and studying about different flowers. Therefore, for this project I wanted to work on something I love talking about and explaining to others. I began by creating user stories so I had a clear idea of the features I wanted my app to contain. Next, I made an ERD so I could visualize the relationships between my different resources (the user, the posts, and the comments). Lastly, I created a wireframe to get an idea of how version 1 would appear to the user.
- First, I built the models for post and comments. Next I updated the user model to include a username because I wanted to be able to display it with a greeting in the nav bar when a user signed-in. From the beginning of the project I knew that I wanted to have an admin feature, so I included an admin schema in the models, but left it commented out until I had a better understanding of how to implement it. Finally, I updated the user route so that I could implement the username feature and I created a route for post and another for comments. All routes were tested (using Postman) before moving on to the front-end app.
- I did a lot of research regarding how to seed a database. After collaborating with one of my instructors, we were able to create a seed that ensured the admin could have separate features from a normal user.
- Express
- MongoDB
- Mongoose
- JavaScript
- Passport
- Bcrypt
- Crypto
- Add a like button for users
- Add a search feature