https://github.com/rosvik/ntnu-tdt4145-database-project
- Open MySQL Workbench
- Find the file named "workoutdiary.sql" locally on your computer
- Open the file in MySQL Workbench
- Execute the file
- Make sure that the workoutdiary database has appeared
- Open the file named config.conf
- Replace 'username' on line 1 and 'password' on line 2 with the credentials to your database
- If your database's location isn't local, replace the url with an appropriate url
- Open Terminal.app
- Navigate to the project folder
cd location/of/workoutdiary/project
- Run
./workout-diary [data]
where [data] is replaced by one of the examples below. - Run
./workout-diary help
to get a list of possible commands
- Open cmd.exe
- Navigate to the project folder
cd location/of/workoutdiary/project
- Run
workout-diary.bat [data]
where [data] is replaced by one of the examples below. - Run
workout-diary.bat help
to get a list of possible commands
Add any of these examples to the commands explained above. ./workout-diary [example]
on Mac or Linux and workout-diary.bat [example]
on Windows.
List the 5 latest workouts
list workout 5
List all exercises from 2012 to 2020
list exercise 2012-01-01 2020-01-01
List all exercises in the Bulking group
list group "Bulking"
List exercises that have an equipment
list equipment 2012-04-25 2018-04-27
Add a workout with in April 2018 at 11:45AM with shape 8 and description "Fin tur i skogen"
add workout 2018-04-25 11:45:23 8 "Fin tur i skogen"
Add an exercise named Fjelltur with description "Gå en tur i fjellet"
add exercise "Fjelltur" "Gå en tur i fjellet"
Add an equipment named Spaserstokk with the description "Stav som gir stabilitet"
add equipment "Spaserstokk" "Stav som gir stabilitet"
Make a new group with name "Rolig beilmuskulaturvedlikehold"
add group "Rolig beilmuskulaturvedlikehold"
Add exercise with id 1 to workout with id 3 with a duration of 23 minutes and 9 performance
connect exercise 3 1 23 9
Add equipment with id 1 to exercise id 1 that is 50 kilos and has 10 sets
connect equipment 1 1 50 10
Add equipment with id 3 to exercise with id 2
connect group 2 3
Our classes are:
- ConnectionConfiguration
- ConnectionCredentials
- MainController
- Add
- Connect
- List
- ConnectionApp
Handles command line input, finds the appropriate function for given parameters, passes information on to the other classes, and displays help information to the user.
Reads the contents of the config.conf file, and finds the password, username and url for the database.
Establishes a connection to a database with the given credentials.
Handles all cases where information needs to be added to the database. This class satisfies requirement number 1, and parts of 4. The class is able to add workouts, exercises, equipment and groups.
Handles all cases where there needs to be created a relation between two entities. This includes
- Adding an exercise to a workout
- Adding an exercise to a exercise group
- Adding equipment to an exercise
Handles all cases where there needs to be displayed a list to the user. This class satisfies the requirement 2,3,5 and the remaining parts of 4. The class is able to display:
- The n latest workouts
- Workouts with a given exercise within a time period
- All exercises that are part of a group
- All exercises that uses an equipment
Used for testing the application during development
- Registrere apparater, øvelser og treningsøkter med tilhørende data.
- Løses ved å kjøre addEquipment(), addExercise(), addWorkout(), som legger inn en ny rad i databasen, med den informasjonen fremstilt av brukeren
- Få opp informasjon om et antall n sist gjennomførte treningsøkter med notater, der n
spesifiseres av brukeren.
- Løses ved å kjøre listWorkouts(), som gjennomfører spørringer som filtrerer ut ønsket data, og viser denne til brukere.
- For hver enkelt øvelse skal det være mulig å se en resultatlogg i et gitt tidsintervall spesifisert av brukeren.
- Løses ved å kjøre listExercises(), som gjennomfører spørringer som filtrerer ut ønsket data gitt ved tidsintervall spesifisert av brukeren, og viser dette.
- Lage øvelsegrupper og finne øvelser som er i samme gruppe.
- Løses ved å kjøre addExerciseGroup() og listExerciseInGroup(), som lager en ny excercise gruppe og viser alle exercises som er klassifisert i en gruppe
- Et valgfritt use case som dere selv bestemmer.
- Løses ved å kjøre listExercisesWithEquipment(). Denne metoden gjennomfører spørring som viser hvilke exercise som bruker hvilke equipment, i et gitt tidsintervall.