Closed ryanwk closed 7 years ago
Wanna update with the simplified version and close this @ryanwk ?
Entities: User, exercise
Relationship: exercise and user tables will have a relationship (one to many)
WireFrame: https://user-images.githubusercontent.com/19196821/28437779-e229fdea-6d69-11e7-8b39-fc1106b37ded.png
API- Create exercise: POST; route: /exercise A user creates an exercise and this triggers a POST request to save the exercise to the DB
Update exercise weight: PATCH; route: exercise/:id A user enters a new date/weight for any exercise listed in exercise history. This triggers a POST request to create a new record of the weight and updates the DB.
Show exercise history: GET; route: exercise/ A user clicks the 'show exercise history’ button and this triggers a GET request to index all of the exercises stored in the DB
Delete exercise: DELETE A user clicks the ‘delete’ button and this triggers a DELETE request and destroys the record stored in the DB.
User stories: As a user, I want to sign up, so that I can sign-in. As a user, I want to sign in, so I can use the app. As a user, I want to sign in, so I can save exercises. As a user, I want to sign in, so I can save weight performed on exercises. As a user, I want to save exercises, so that I have a record of when I performed certain exercises. As a user, I want to save the weight I used, so that I can keep track of how much weight I'm lifting for each exercise. As a user, I want to see my prior workouts and weight used, so I can keep an eye on my progress
Steps: Two repos one from browser template and one from rails template Authentication stuff from tic-tac-toe to browser-template Spin up local grunt server and spin up local rails server Set up html skeleton to test user auth actions (sign-up etc) Create resource new table with rails migration, bin/rails generate scaffold etc In model add relationship make adjustments where necessary
User Stories:
ERD diagram: https://user-images.githubusercontent.com/19196821/28430272-df76ac40-6d4d-11e7-8ac9-7c89cf31d37c.png
Wire frame: https://user-images.githubusercontent.com/19196821/28425448-5181d93c-6d3e-11e7-973f-f851fca2435f.png
https://user-images.githubusercontent.com/19196821/28425562-aaf6b73a-6d3e-11e7-9cfc-cc90991e107e.png
API- Sign-in: POST; route: /user; what is action controller? A user signs in and this triggers a POST request to create a new user in the user DB?
Sign-up: POST; route: /user; A user signs in and this triggers a POST request to create a new user in the user DB
Sign-out: DELETE; route: /user/:id A user signs out and this triggers a DELETE request to destroy the user from the user DB
Change-pwd: PATCH route: /user/:id A user changes their password and this triggers a PATCH request to update the DB with the new password
Create workout: POST; route: /workout A user creates a workout and this triggers a POST request to create a new workout in the workout DB
Update workout weight: PATCH; route: workout/:id A user enters a new date/weight for a certain exercise while a workout is selected. This triggers a POST request to create a new record of the exercise, weight used, and date performed. This new record is added to the workout table of the DB.
Show all workouts: GET; route: workout/ A user clicks the 'show all workouts’ button and this triggers a GET request to index the workout tables from the DB
Show workout: GET; route: workout/:id A user clicks the 'show workout’ button and this triggers a GET request to show a workout table from the DB according to the id specified, how is the id specified?
Next Steps: Create resource ‘Workout’ use generator, make sure it works by performing all crud actions on it figure out how to attach a user to it (foreign_key, one-to-many association) then?