diff --git a/.gitignore b/.gitignore index 4838c8aaa..752ded36e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,10 @@ # Python -app/__pycache__/ -app/*/__pycache__/ -app/*.pyc +backend/*/__pycache__/ +backend/*.pyc # Logs -app/logs/ -app/*.log +backend/logs/ +backend/*.log # Environment variables -app/config/.env \ No newline at end of file +backend/config/.env \ No newline at end of file diff --git a/Dockerfile b/Dockerfile_backend similarity index 97% rename from Dockerfile rename to Dockerfile_backend index 8f04fe510..71d821a30 100644 --- a/Dockerfile +++ b/Dockerfile_backend @@ -8,7 +8,7 @@ RUN apt-get update && apt-get install -y pkg-config python3-dev default-libmysql WORKDIR /app # Copy the current directory contents into the container at /app -COPY app/ /app +COPY backend/ /app # Create a virtual environment and install dependencies RUN python -m venv /venv @@ -20,7 +20,6 @@ RUN pip install --no-cache-dir -r requirements.txt EXPOSE 8000 # Define environment variable -#ENV NAME World ENV DB_HOST="" ENV DB_PORT=3306 ENV DB_USER="" diff --git a/Dockerfile_frontend b/Dockerfile_frontend new file mode 100644 index 000000000..ff09bb3da --- /dev/null +++ b/Dockerfile_frontend @@ -0,0 +1,16 @@ +# Use an official Nginx image as a base image +FROM nginx:latest + +# Set the working directory to /app +WORKDIR /app + +# Copy the PHP files into the container +COPY frontend/ /app + +# Copy the Nginx configuration file +COPY nginx.conf /etc/nginx/conf.d/default.conf + +# Expose port 80 to the outside world +EXPOSE 80 + +# Define environment variable \ No newline at end of file diff --git a/app/config/__pycache__/config.cpython-311.pyc b/app/config/__pycache__/config.cpython-311.pyc deleted file mode 100644 index c64a1f1ec..000000000 Binary files a/app/config/__pycache__/config.cpython-311.pyc and /dev/null differ diff --git a/app/controllers/__pycache__/__init__.cpython-311.pyc b/app/controllers/__pycache__/__init__.cpython-311.pyc deleted file mode 100644 index 4962a9a13..000000000 Binary files a/app/controllers/__pycache__/__init__.cpython-311.pyc and /dev/null differ diff --git a/app/controllers/__pycache__/activitiesController.cpython-311.pyc b/app/controllers/__pycache__/activitiesController.cpython-311.pyc deleted file mode 100644 index 6d2801921..000000000 Binary files a/app/controllers/__pycache__/activitiesController.cpython-311.pyc and /dev/null differ diff --git a/app/controllers/__pycache__/gearController.cpython-311.pyc b/app/controllers/__pycache__/gearController.cpython-311.pyc deleted file mode 100644 index 8c9cad372..000000000 Binary files a/app/controllers/__pycache__/gearController.cpython-311.pyc and /dev/null differ diff --git a/app/controllers/__pycache__/sessionController.cpython-311.pyc b/app/controllers/__pycache__/sessionController.cpython-311.pyc deleted file mode 100644 index a8f74601b..000000000 Binary files a/app/controllers/__pycache__/sessionController.cpython-311.pyc and /dev/null differ diff --git a/app/controllers/__pycache__/stravaController.cpython-311.pyc b/app/controllers/__pycache__/stravaController.cpython-311.pyc deleted file mode 100644 index 68afd8117..000000000 Binary files a/app/controllers/__pycache__/stravaController.cpython-311.pyc and /dev/null differ diff --git a/app/controllers/__pycache__/userController.cpython-311.pyc b/app/controllers/__pycache__/userController.cpython-311.pyc deleted file mode 100644 index d34cac179..000000000 Binary files a/app/controllers/__pycache__/userController.cpython-311.pyc and /dev/null differ diff --git a/app/controllers/__pycache__/waypointsController.cpython-311.pyc b/app/controllers/__pycache__/waypointsController.cpython-311.pyc deleted file mode 100644 index 9403eac0b..000000000 Binary files a/app/controllers/__pycache__/waypointsController.cpython-311.pyc and /dev/null differ diff --git a/app/db/__pycache__/__init__.cpython-311.pyc b/app/db/__pycache__/__init__.cpython-311.pyc deleted file mode 100644 index f27351b19..000000000 Binary files a/app/db/__pycache__/__init__.cpython-311.pyc and /dev/null differ diff --git a/app/db/__pycache__/db.cpython-311.pyc b/app/db/__pycache__/db.cpython-311.pyc deleted file mode 100644 index ed5619a6a..000000000 Binary files a/app/db/__pycache__/db.cpython-311.pyc and /dev/null differ diff --git a/app/config/config.py b/backend/config/config.py similarity index 100% rename from app/config/config.py rename to backend/config/config.py diff --git a/app/controllers/activitiesController.py b/backend/controllers/activitiesController.py similarity index 100% rename from app/controllers/activitiesController.py rename to backend/controllers/activitiesController.py diff --git a/app/controllers/gearController.py b/backend/controllers/gearController.py similarity index 100% rename from app/controllers/gearController.py rename to backend/controllers/gearController.py diff --git a/app/controllers/sessionController.py b/backend/controllers/sessionController.py similarity index 100% rename from app/controllers/sessionController.py rename to backend/controllers/sessionController.py diff --git a/app/controllers/stravaController.py b/backend/controllers/stravaController.py similarity index 100% rename from app/controllers/stravaController.py rename to backend/controllers/stravaController.py diff --git a/app/controllers/userController.py b/backend/controllers/userController.py similarity index 100% rename from app/controllers/userController.py rename to backend/controllers/userController.py diff --git a/app/db/createdb.sql b/backend/db/createdb.sql similarity index 100% rename from app/db/createdb.sql rename to backend/db/createdb.sql diff --git a/app/db/db.py b/backend/db/db.py similarity index 100% rename from app/db/db.py rename to backend/db/db.py diff --git a/app/main.py b/backend/main.py similarity index 100% rename from app/main.py rename to backend/main.py diff --git a/docker-compose.yml b/docker-compose.yml index 0a7777b0d..1eaa35c5c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,9 +1,21 @@ version: '3' services: + gearguardian-frontend: + image: gearguardian-frontend:latest + volumes: + - ./app:/app + - ./nginx.conf:/etc/nginx/conf.d/default.conf + ports: + - "8080:80" + networks: + - frontend_network + - backend_network + restart: unless-stopped + # API logic - gearguardian-api: - container_name: gearguardian-api - image: your-image-name + gearguardian-backend: + container_name: gearguardian-backend + image: gearguardian-backend:latest environment: - DB_HOST= #required - DB_PORT=3306 #optional - will use port 3306 by default @@ -85,4 +97,6 @@ services: networks: backend_network: + driver: bridge + frontend_network: driver: bridge \ No newline at end of file diff --git a/frontend/activities/activity.php b/frontend/activities/activity.php new file mode 100644 index 000000000..ae1278936 --- /dev/null +++ b/frontend/activities/activity.php @@ -0,0 +1,755 @@ + + + + +
+ + + + + + + + + + + + + +
+ +
+ alt="userPicture" class="rounded-circle" width="55" height="55"> +
+
+ "> +
+ + '; }else{ if($activity[0]["activity_type"] == 4 || $activity[0]["activity_type"] == 5 || $activity[0]["activity_type"] == 6 || $activity[0]["activity_type"] == 7 || $activity[0]["activity_type"] == 8){ echo ''; }else{ if($activity[0]["activity_type"] == 9){ echo ''; } } } ?> format("d/m/y"); ?>@format("H:i"); ?> +
+
+ +
+ + + + + +

+ + +
+
+ +
+ + km + + m + +
+
+ +
+ diff($endDateTime); + + if ($interval->h < 1) { + // If the difference is less than one hour + echo $interval->i . "m " . $interval->s . "s"; + } else { + // If the difference is one hour or more + echo $interval->h . "h " . $interval->i . "m"; + } + ?> +
+
+ + +
+ m + + + +
+ min/km + + + +
+ min/100m + + + +
+
+ +
+ +
+ +
+ W + +
+
+ +
+ m +
+
+ +
+ m +
+ + +
+ +
+ km/h +
+
+ +
+ W + +
+
+ +
+ m +
+ +
+ + +
+ + + + + +
+
+

+ +
+ '; }else{ if($activity[0]["activity_type"] == 4 || $activity[0]["activity_type"] == 5 || $activity[0]["activity_type"] == 6 || $activity[0]["activity_type"] == 7 || $activity[0]["activity_type"] == 8){ echo ''; }else{ if($activity[0]["activity_type"] == 9){ echo ''; } } } ?> + + + + + +

+
+ + + + + + + + + + + + + + + + + + + +
+
+ + +
+
+ + + +
+

+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ +
+ + +
+ +
+ + +
+ +
+
+ +

+
+
+ + + + + +
+
+ +
+ +
+ + \ No newline at end of file diff --git a/frontend/gear/gear.php b/frontend/gear/gear.php new file mode 100644 index 000000000..f6dfa778a --- /dev/null +++ b/frontend/gear/gear.php @@ -0,0 +1,255 @@ + + + + +
+

+
+ +
+ + + + + + + + + + +
+ +
+ +
+ alt="gearPicture" width="180" height="180"> + +
+
+
+ +
+ + + + + + + + + + + + + +
+ + + + + + + + + " href="#" role="button" data-bs-toggle="modal" data-bs-target="#deleteGearModal" > + + + + +
+ : km + + : + + + : + +
+
+
+ +
+
+ + + +
+
+
+ +
+ + + +
    + + +
  • + "> + : format("d/m/y"); ?>@format("H:i"); ?> +
  • + + +
+ +
+
+
+ +
+
+ +
+ +
+ + \ No newline at end of file diff --git a/frontend/gear/gear_old.php b/frontend/gear/gear_old.php new file mode 100644 index 000000000..9b0699b63 --- /dev/null +++ b/frontend/gear/gear_old.php @@ -0,0 +1,349 @@ + + + + +
+

+
+ +
+ + + + + + + + + + + + + + + +
+
+ +

+ + + + + +
+

+
+
+ + +
+ +
+ +
+ + +
+
+ + + + + + + +

( :

+
    + +
  • +
    + alt="gearPicture" class="rounded-circle" width="55" height="55"> +
    +
    + +
    + +
    + + + + + +
    +
    +
    + "> + + + + "> + + + +
    +
  • + +
+ +
+ + + + +
+
+
+
+ +
+ +
+ + \ No newline at end of file diff --git a/frontend/gear/gears.php b/frontend/gear/gears.php new file mode 100644 index 000000000..836d5f8bc --- /dev/null +++ b/frontend/gear/gears.php @@ -0,0 +1,264 @@ + + + + +
+

+
+ +
+ + + + + + + + + + + + + + + +
+
+ +

+ + + + + +
+

+
+
+ + +
+ +
+ +
+ + +
+
+ + + + + + + +

( :

+ + +
+ + + + +
+
+
+
+ +
+ +
+ + \ No newline at end of file diff --git a/frontend/img/avatar/bicycle1.png b/frontend/img/avatar/bicycle1.png new file mode 100644 index 000000000..c59e1da99 Binary files /dev/null and b/frontend/img/avatar/bicycle1.png differ diff --git a/frontend/img/avatar/bicycle2.png b/frontend/img/avatar/bicycle2.png new file mode 100644 index 000000000..02297a2f0 Binary files /dev/null and b/frontend/img/avatar/bicycle2.png differ diff --git a/frontend/img/avatar/female1.png b/frontend/img/avatar/female1.png new file mode 100644 index 000000000..b21a90502 Binary files /dev/null and b/frontend/img/avatar/female1.png differ diff --git a/frontend/img/avatar/male1.png b/frontend/img/avatar/male1.png new file mode 100644 index 000000000..46aaedb50 Binary files /dev/null and b/frontend/img/avatar/male1.png differ diff --git a/frontend/img/avatar/running_shoe1.png b/frontend/img/avatar/running_shoe1.png new file mode 100644 index 000000000..5fdd38ac2 Binary files /dev/null and b/frontend/img/avatar/running_shoe1.png differ diff --git a/frontend/img/avatar/running_shoe2.png b/frontend/img/avatar/running_shoe2.png new file mode 100644 index 000000000..0529198d8 Binary files /dev/null and b/frontend/img/avatar/running_shoe2.png differ diff --git a/frontend/img/avatar/wetsuit1.png b/frontend/img/avatar/wetsuit1.png new file mode 100644 index 000000000..8dc424a1e Binary files /dev/null and b/frontend/img/avatar/wetsuit1.png differ diff --git a/frontend/img/avatar/wetsuit2.png b/frontend/img/avatar/wetsuit2.png new file mode 100644 index 000000000..affb24651 Binary files /dev/null and b/frontend/img/avatar/wetsuit2.png differ diff --git a/frontend/img/logo/logo.png b/frontend/img/logo/logo.png new file mode 100644 index 000000000..87c9c6686 Binary files /dev/null and b/frontend/img/logo/logo.png differ diff --git a/frontend/img/strava/api_logo_cptblWith_strava_horiz_light.png b/frontend/img/strava/api_logo_cptblWith_strava_horiz_light.png new file mode 100644 index 000000000..009500aeb Binary files /dev/null and b/frontend/img/strava/api_logo_cptblWith_strava_horiz_light.png differ diff --git a/frontend/img/strava/api_logo_cptblWith_strava_stack_light.png b/frontend/img/strava/api_logo_cptblWith_strava_stack_light.png new file mode 100644 index 000000000..82f1dde7f Binary files /dev/null and b/frontend/img/strava/api_logo_cptblWith_strava_stack_light.png differ diff --git a/frontend/img/strava/btn_strava_connectwith_orange.png b/frontend/img/strava/btn_strava_connectwith_orange.png new file mode 100644 index 000000000..ae1871507 Binary files /dev/null and b/frontend/img/strava/btn_strava_connectwith_orange.png differ diff --git a/frontend/img/users_img/img_12_9656950_12.JPG b/frontend/img/users_img/img_12_9656950_12.JPG new file mode 100644 index 000000000..51ee2c828 Binary files /dev/null and b/frontend/img/users_img/img_12_9656950_12.JPG differ diff --git a/frontend/inc/Template-Bottom.php b/frontend/inc/Template-Bottom.php new file mode 100755 index 000000000..f4659f974 --- /dev/null +++ b/frontend/inc/Template-Bottom.php @@ -0,0 +1,10 @@ + +