diff --git a/README.md b/README.md index 3e82675..94534a5 100644 --- a/README.md +++ b/README.md @@ -6,10 +6,12 @@ By Chardae Schnabel and Giulia Cellerino - [Introduction](#introduction) - [Motivation](#motivation) -- [Features & Views](#features--views) +- [Features & Views](#features-views) - [Tools Used](#tools-used) - [Getting Started](#getting-started) - [Database Schema](#database-schema) +- [Relationships](#relationships) +- [EndRoutes](#endroutes) - [API Route](#api-route) - [Future Features](#future-features) - [Contact](#contact) @@ -31,24 +33,53 @@ This fitness app focuses on building confidence and inspiring users of all level This app is made up of the following pages: -- **Homepage:** Provides an overview of the app, featuring essential information and navigation options. -- **Login:** Allows users to authenticate and access their accounts securely. +-

Homepage:

Provides an overview of the app, featuring essential information and navigation options. -- **Buildyourownworkout:** Enables users to customize their workout routines based on preferences and goals. +-

Register && Login:

Provides a registration form for new users to create accounts and join the app. Standard Login page - allows users to authenticate and access their accounts securely. -- **Calendar:** Displays scheduled workouts and fitness events, helping users plan and track their activities. + Home Page -- **Exercise:** Offers detailed information and instructions for various exercises and workout routines. + The user has the option to upload a photo... -- **Profile:** Allows users to manage their personal information, track progress, and customize settings. + Home Page -- **Register:** Provides a registration form for new users to create accounts and join the app. + And the photo will load in the navbar, when logged in: -- **Sentworkouts:** Shows a history of sent or scheduled workout plans, facilitating organization and planning. + Home Page -- **Sidebar:** Provides quick access to navigation options and additional features throughout the app. +-

Buildyourownworkout:

Enables users to customize their workout routines based on preferences and goals. -- **Workout:** Presents structured workout routines and exercises tailored to user preferences. + Home Page + + Dropdown menu calls the API in order to provide user with WO options. + + Home Page + +-

Workout:

Presents structured workout routines and exercises tailored to user preferences. + + Home Page + +FullCalendar.io was used in order to give the user the option to choose a day and time... + + Home Page + +-

Profile && Calendar:

Profile includes the option to render profile details, see workouts sent by friends and to organze WOs with a drag and drop option in the Calendar. Displays scheduled workouts and fitness events, helping users plan and track their activities. + +Home Page + +Below the calendar is also a month summary of all of the workouts organized for that month, with each workout rendering a separate delete or edit workout option. + +Home Page + +-

**Exercise:**

Offers detailed information and instructions for various exercises and workout routines, as well as a progress bar to movivate the user (and so they know where they are in their routine)! + +Home Page + +-

Sentworkouts:

Shows a history of sent or scheduled workout plans, facilitating organization and planning. + +Home Page + +-

Sidebar:

Provides quick access to navigation options and additional features throughout the app. ## Tools Used @@ -70,7 +101,8 @@ This app is made up of the following pages: - **DrawSQL** - Tool for creating database diagrams - **FullCalendar.io** - JavaScript calendar library for displaying events - **Material-UI** - React component library for building UIs with Google's Material Design principles -- **Exercise API** - API for retrieving exercises and workout data from [Ninja API](https://api-ninjas.com/api/exercises) +- **Exercise API** - API for retrieving exercises and workout data from: + [Ninja API](https://api-ninjas.com/api/exercises) ## Getting Started @@ -155,7 +187,7 @@ Frontend runs on http://localhost:5173/, and backend runs on http://localhost:40 ## Database Schema -![Database Schema Diagram](../fs35-team-A/client/images/databaseschema.png) +![Database Schema Diagram](/client/images/READMEimages/DatabaseSetup.png) The database consists of three main tables: `users`, `workouts`, and `exercises`. Below is a summary of their purpose and relationships: @@ -173,6 +205,14 @@ The database consists of three main tables: `users`, `workouts`, and `exercises` ### Relationships +<<<<<<< HEAD +### Endroutes + +- Click here to see the http method, description, request and response objects for each of our endroutes. + https://docs.google.com/document/d/1VD0Nsywif69Nr0MCx-je22KXIx5FMICRA2M1A-4CoNg/edit +||||||| 99abd21 +### Example Queries +======= 1. **Users to Workouts (1:N)** - **Relationship:** One user can have multiple workouts. @@ -196,6 +236,7 @@ The database consists of three main tables: `users`, `workouts`, and `exercises` These relationships ensure that each workout is linked to a specific user and can include multiple exercises, and they allow tracking of both the user performing the workout and the user who created it. ### Example Queries +>>>>>>> master The following SQL queries demonstrate how to interact with the database: @@ -225,11 +266,18 @@ These queries provide insights into how data is structured and retrieved within ### API Route +<<<<<<< HEAD +||||||| 99abd21 +- Enpoints description +- We can create a PDF file and link it + +======= - Enpoints description - We can create a PDF file and link it ### Guards +>>>>>>> master ## Future Features ### Instructions to contribute diff --git a/client/images/READMEimages/BuildWOWithDropdown.png b/client/images/READMEimages/BuildWOWithDropdown.png new file mode 100644 index 0000000..fa3e38e Binary files /dev/null and b/client/images/READMEimages/BuildWOWithDropdown.png differ diff --git a/client/images/READMEimages/BuildYourWorkout.png b/client/images/READMEimages/BuildYourWorkout.png new file mode 100644 index 0000000..2466a8d Binary files /dev/null and b/client/images/READMEimages/BuildYourWorkout.png differ diff --git a/client/images/READMEimages/CalendarDrop.png b/client/images/READMEimages/CalendarDrop.png new file mode 100644 index 0000000..f263b28 Binary files /dev/null and b/client/images/READMEimages/CalendarDrop.png differ diff --git a/client/images/READMEimages/DatabaseSetup.png b/client/images/READMEimages/DatabaseSetup.png new file mode 100644 index 0000000..717944e Binary files /dev/null and b/client/images/READMEimages/DatabaseSetup.png differ diff --git a/client/images/READMEimages/ExerciseNow.png b/client/images/READMEimages/ExerciseNow.png new file mode 100644 index 0000000..cd81882 Binary files /dev/null and b/client/images/READMEimages/ExerciseNow.png differ diff --git a/client/images/READMEimages/FullCalendar.io.png b/client/images/READMEimages/FullCalendar.io.png new file mode 100644 index 0000000..edbc78d Binary files /dev/null and b/client/images/READMEimages/FullCalendar.io.png differ diff --git a/client/images/READMEimages/NavBarWithPhoto.png b/client/images/READMEimages/NavBarWithPhoto.png new file mode 100644 index 0000000..95edd56 Binary files /dev/null and b/client/images/READMEimages/NavBarWithPhoto.png differ diff --git a/client/images/READMEimages/ProfileCalendar.png b/client/images/READMEimages/ProfileCalendar.png new file mode 100644 index 0000000..73ab587 Binary files /dev/null and b/client/images/READMEimages/ProfileCalendar.png differ diff --git a/client/images/READMEimages/RegisterWithPhoto.png b/client/images/READMEimages/RegisterWithPhoto.png new file mode 100644 index 0000000..f8afe2a Binary files /dev/null and b/client/images/READMEimages/RegisterWithPhoto.png differ diff --git a/client/images/READMEimages/RegistrationPage.png b/client/images/READMEimages/RegistrationPage.png new file mode 100644 index 0000000..9b394d4 Binary files /dev/null and b/client/images/READMEimages/RegistrationPage.png differ diff --git a/client/images/READMEimages/SentWorkouts.png b/client/images/READMEimages/SentWorkouts.png new file mode 100644 index 0000000..6eb6bd9 Binary files /dev/null and b/client/images/READMEimages/SentWorkouts.png differ diff --git a/client/images/READMEimages/SummaryOfMonth.png b/client/images/READMEimages/SummaryOfMonth.png new file mode 100644 index 0000000..db7c653 Binary files /dev/null and b/client/images/READMEimages/SummaryOfMonth.png differ diff --git a/client/images/READMEimages/UserDropDown.png b/client/images/READMEimages/UserDropDown.png new file mode 100644 index 0000000..b257f8e Binary files /dev/null and b/client/images/READMEimages/UserDropDown.png differ diff --git a/client/images/READMEimages/WorkoutDropdown.png b/client/images/READMEimages/WorkoutDropdown.png new file mode 100644 index 0000000..ab250b8 Binary files /dev/null and b/client/images/READMEimages/WorkoutDropdown.png differ diff --git a/client/images/READMEimages/WorkoutSummary.png b/client/images/READMEimages/WorkoutSummary.png new file mode 100644 index 0000000..38d393a Binary files /dev/null and b/client/images/READMEimages/WorkoutSummary.png differ diff --git a/client/src/index.css b/client/src/index.css index a15396c..038fc93 100644 --- a/client/src/index.css +++ b/client/src/index.css @@ -276,7 +276,7 @@ button:focus-visible { .workoutfriends-page { position: relative; width: 100%; - height: 100vh; + height: 200vh; } .workoutfriends-page::before { @@ -286,7 +286,10 @@ button:focus-visible { left: 0; width: 100%; height: 100%; - background: url("../images/workoutfriends.jpeg") no-repeat center center/cover; + background-image: url("../images/workoutfriends.jpeg"); + background-repeat: no-repeat; + background-position: center top, center bottom; /* Position the image twice */ + background-size: cover; opacity: 0.3; z-index: 1; } diff --git a/public/img/01e4db2f-2e22-42ce-a416-d7e09d4b74d8.png b/public/img/01e4db2f-2e22-42ce-a416-d7e09d4b74d8.png new file mode 100644 index 0000000..aa48112 Binary files /dev/null and b/public/img/01e4db2f-2e22-42ce-a416-d7e09d4b74d8.png differ diff --git a/public/img/12bb775d-bf1d-4474-a42e-246d9a1eb0dd.png b/public/img/12bb775d-bf1d-4474-a42e-246d9a1eb0dd.png new file mode 100644 index 0000000..f408aa0 Binary files /dev/null and b/public/img/12bb775d-bf1d-4474-a42e-246d9a1eb0dd.png differ diff --git a/public/img/1317edc1-7e79-4d0b-b132-52ae3468c335.jpeg b/public/img/1317edc1-7e79-4d0b-b132-52ae3468c335.jpeg new file mode 100644 index 0000000..2f18f5b Binary files /dev/null and b/public/img/1317edc1-7e79-4d0b-b132-52ae3468c335.jpeg differ diff --git a/public/img/1417fa39-9823-4f19-a4ec-22c0d4e4ba56.jpeg b/public/img/1417fa39-9823-4f19-a4ec-22c0d4e4ba56.jpeg new file mode 100644 index 0000000..2f18f5b Binary files /dev/null and b/public/img/1417fa39-9823-4f19-a4ec-22c0d4e4ba56.jpeg differ diff --git a/public/img/22c2fa9d-8efc-4088-84d3-0ec82d0953f3.jpeg b/public/img/22c2fa9d-8efc-4088-84d3-0ec82d0953f3.jpeg new file mode 100644 index 0000000..e47623b Binary files /dev/null and b/public/img/22c2fa9d-8efc-4088-84d3-0ec82d0953f3.jpeg differ diff --git a/public/img/2cd04526-210f-43d5-b49b-bfff37f32317.jpeg b/public/img/2cd04526-210f-43d5-b49b-bfff37f32317.jpeg new file mode 100644 index 0000000..2f18f5b Binary files /dev/null and b/public/img/2cd04526-210f-43d5-b49b-bfff37f32317.jpeg differ diff --git a/public/img/3450fdd3-9be4-414c-8d31-822483c88e68.jpeg b/public/img/3450fdd3-9be4-414c-8d31-822483c88e68.jpeg new file mode 100644 index 0000000..e2a56d6 Binary files /dev/null and b/public/img/3450fdd3-9be4-414c-8d31-822483c88e68.jpeg differ diff --git a/public/img/3f374f7c-69c1-4f9a-8ee7-c1c43ad8772e.png b/public/img/3f374f7c-69c1-4f9a-8ee7-c1c43ad8772e.png new file mode 100644 index 0000000..aa48112 Binary files /dev/null and b/public/img/3f374f7c-69c1-4f9a-8ee7-c1c43ad8772e.png differ diff --git a/public/img/4b5cdbb7-0b34-4991-8b7e-b921f207d025.png b/public/img/4b5cdbb7-0b34-4991-8b7e-b921f207d025.png new file mode 100644 index 0000000..887c5f8 Binary files /dev/null and b/public/img/4b5cdbb7-0b34-4991-8b7e-b921f207d025.png differ diff --git a/public/img/59df94b4-78ce-4afb-b4d7-e9afaadf2e86.jpeg b/public/img/59df94b4-78ce-4afb-b4d7-e9afaadf2e86.jpeg new file mode 100644 index 0000000..2f18f5b Binary files /dev/null and b/public/img/59df94b4-78ce-4afb-b4d7-e9afaadf2e86.jpeg differ diff --git a/public/img/73a4d1cd-9f0c-4446-b350-3273c393beee.jpeg b/public/img/73a4d1cd-9f0c-4446-b350-3273c393beee.jpeg new file mode 100644 index 0000000..e2a56d6 Binary files /dev/null and b/public/img/73a4d1cd-9f0c-4446-b350-3273c393beee.jpeg differ diff --git a/public/img/80976641-fdfe-45f2-b6ab-c6a19ac1f51b.jpeg b/public/img/80976641-fdfe-45f2-b6ab-c6a19ac1f51b.jpeg new file mode 100644 index 0000000..e2a56d6 Binary files /dev/null and b/public/img/80976641-fdfe-45f2-b6ab-c6a19ac1f51b.jpeg differ diff --git a/public/img/a21f5c21-0849-42dc-901a-23c73a6a6fbb.jpeg b/public/img/a21f5c21-0849-42dc-901a-23c73a6a6fbb.jpeg new file mode 100644 index 0000000..e47623b Binary files /dev/null and b/public/img/a21f5c21-0849-42dc-901a-23c73a6a6fbb.jpeg differ diff --git a/public/img/d3add287-bb91-42f4-91d2-92abd6b979ea.jpeg b/public/img/d3add287-bb91-42f4-91d2-92abd6b979ea.jpeg new file mode 100644 index 0000000..e2a56d6 Binary files /dev/null and b/public/img/d3add287-bb91-42f4-91d2-92abd6b979ea.jpeg differ diff --git a/public/img/e2e160c2-8439-4afd-a458-9edf963c1cef.png b/public/img/e2e160c2-8439-4afd-a458-9edf963c1cef.png new file mode 100644 index 0000000..f408aa0 Binary files /dev/null and b/public/img/e2e160c2-8439-4afd-a458-9edf963c1cef.png differ diff --git a/public/img/fbedbc0e-f067-439d-9c87-0717b9921d4a.png b/public/img/fbedbc0e-f067-439d-9c87-0717b9921d4a.png new file mode 100644 index 0000000..887c5f8 Binary files /dev/null and b/public/img/fbedbc0e-f067-439d-9c87-0717b9921d4a.png differ diff --git a/routes/workouts.js b/routes/workouts.js index fa1fc2b..048a026 100644 --- a/routes/workouts.js +++ b/routes/workouts.js @@ -89,9 +89,8 @@ router.get("/:workout_id", async function (req, res, next) { exercisesByWorkout = `SELECT exercises.*, workouts.date FROM workouts LEFT JOIN exercises ON workouts.id = exercises.workout_id WHERE workouts.id = ${workout_id}`; const result = await db(exercisesByWorkout); - // This does the grouping by wo_id + const groupedData = group(result.data, (d) => d.workout_id); - // console.log(result.data); const formattedData = Array.from(groupedData, ([key, values]) => { return { id: key, @@ -117,7 +116,7 @@ router.put( const workout_id = req.params.workout_id; // same as above const { date } = req.body; // Extract the updated date from the request body const exercisesByWorkoutUpdate = `UPDATE workouts SET date = '${date}', sender_id = null WHERE id = ${workout_id}`; - await db(exercisesByWorkoutUpdate); // Update the workout date in the database + await db(exercisesByWorkoutUpdate); res.status(200).send({ message: "Workout updated successfully" }); } catch (err) { console.error("Error updating workout:", err); @@ -159,7 +158,7 @@ router.delete( // Finally, it retrieves the complete list of exercises for the created workout and sends it back as a response. router.post("/", userShouldBeLoggedIn, async function (req, res, next) { try { - const user_id = req.user_id; // comes from the guard + const user_id = req.user_id; //comes from the guard const { date, exercises } = req.body; // getting the date and exs from the body of the req const createWorkout = `INSERT INTO workouts (user_id, date) VALUES (${user_id}, '${date}'); SELECT LAST_INSERT_ID()`; // Insert a new wokrout into the table with the given user_id and date. // Retrives the last inserted ID @@ -177,7 +176,6 @@ router.post("/", userShouldBeLoggedIn, async function (req, res, next) { const finalWorkoutResult = await db(finalWorkout); const workout = finalWorkoutResult.data[0]; workout.exercises = finalExerciseResult.data; - // Extracts the workout details and exercises from the results of the database queries. res.status(200).send(workout); } catch (err) { console.error("Error creating workout:", err);