Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore/mobile/refactor #273

Merged
merged 105 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
595b9cb
creating file structure for code refactoring
KamogeloMoeketse Jul 23, 2024
5772fc2
auth models complete
KamogeloMoeketse Jul 23, 2024
6977bbb
added rooms and booking models
KamogeloMoeketse Jul 23, 2024
3b4be02
request models complete
KamogeloMoeketse Jul 23, 2024
7ba4f7f
login service and utils function
KamogeloMoeketse Jul 24, 2024
0cea872
chore: Update response model status types to string literals
KamogeloMoeketse Jul 25, 2024
c7541f2
chore: Refactor login form and API integration
KamogeloMoeketse Jul 27, 2024
23a983a
chore: refactor fetching and storing user details
KamogeloMoeketse Jul 28, 2024
8171a86
refactor get and store notification and security settings
KamogeloMoeketse Jul 28, 2024
628a71f
chore: refactor notification and security setting updating
KamogeloMoeketse Jul 28, 2024
58ef4a5
chore: Update booking and room models, refactor view booking details …
KamogeloMoeketse Jul 28, 2024
5c4f173
chore: logout refactor
KamogeloMoeketse Jul 29, 2024
f0946e4
chore: Refactor Welcome-test.tsx and add GradientButton import
u21631532 Jul 30, 2024
2f9fc83
chore: Update tsconfig.json for better module interoperability and st…
u21631532 Jul 30, 2024
4ea965b
chore: Mock NavBarProvider in NavBar-test.tsx
u21631532 Jul 30, 2024
4515332
chore: Update Dashboard-test.tsx with mock dependencies and fix rende…
u21631532 Jul 30, 2024
b22ad22
chore: Refactor login form and API integration
u21631532 Jul 30, 2024
5abbf9f
Refactor login form and API integration
u21631532 Jul 30, 2024
d427b30
chore: Update npm dependencies and configuration files
u21631532 Jul 30, 2024
407a6b8
Refactor getUserBookings function and improve error handling
u21631532 Jul 30, 2024
583b044
chore: Refactor API services test file and update mock responses
u21631532 Jul 30, 2024
1703b9c
chore: Refactor getUserBookings function and improve error handling
u21631532 Jul 30, 2024
bbd5f06
Refactor response.ts file and fix formatting issue
u21631532 Jul 30, 2024
9fba091
Refactor getUserDetails function and improve error handling
u21631532 Jul 30, 2024
409f4ba
Tests 100% pass
u21631532 Jul 30, 2024
d6db0e8
chore: check-in refactor
KamogeloMoeketse Jul 30, 2024
d7da93f
chore: cancelbooking refactor
KamogeloMoeketse Jul 30, 2024
b90739a
chore: Refactor authservices-tests file for logout
u21631532 Jul 30, 2024
a8cd32a
chore: Refactor authservices-tests file for login error handling
u21631532 Jul 30, 2024
2b7a8ea
Tests passing
u21631532 Jul 30, 2024
a63718f
chore: Refactor securestore-test file and update mock responses
u21631532 Jul 30, 2024
3a45aae
getToken
u21631532 Jul 30, 2024
b287406
Refactor securestore-test file and update mock responses
u21631532 Jul 30, 2024
cba6b8c
chore: Refactor bookings-test file and update mock responses
u21631532 Jul 30, 2024
4f1de0e
chore: Refactor auth module for login and logout functionality
u21631532 Jul 30, 2024
536288c
Test Suites: 1 passed, 1 total
u21631532 Jul 30, 2024
ac0f1e3
chore: Update notifications-test file with mock functions and test cases
u21631532 Jul 30, 2024
4e6083c
chore: Add authentication check before fetching user bookings
u21631532 Jul 30, 2024
27537f8
Test Suites: 1 passed, 1 total
u21631532 Jul 30, 2024
8a76d57
chore: Refactor auth module for login and logout functionality
u21631532 Jul 30, 2024
01d12d0
Merge branch 'develop' into chore/mobile/refactor
u21631532 Jul 30, 2024
51939fb
Merge branch 'develop' into chore/mobile/refactor
KamogeloMoeketse Jul 30, 2024
fc8af02
Merge branch 'chore/mobile/refactor' of https://github.com/COS301-SE-…
KamogeloMoeketse Jul 30, 2024
8dccf52
fix: added missing comma in package.json
waveyboym Jul 30, 2024
7e93526
Merge branch 'chore/mobile/refactor' of https://github.com/COS301-SE-…
waveyboym Jul 30, 2024
d1ec220
chore: Add test coverage command to package.json
waveyboym Jul 30, 2024
4cc46a0
Merge branch 'develop' into chore/mobile/refactor
KamogeloMoeketse Aug 2, 2024
29ef361
Merge branch 'chore/mobile/refactor' of https://github.com/COS301-SE-…
KamogeloMoeketse Aug 2, 2024
6adab07
Merge branch 'develop' into chore/mobile/refactor
KamogeloMoeketse Aug 2, 2024
44815a9
creating file structure for code refactoring
KamogeloMoeketse Jul 23, 2024
82e3fa6
auth models complete
KamogeloMoeketse Jul 23, 2024
6c51168
added rooms and booking models
KamogeloMoeketse Jul 23, 2024
4cefc20
request models complete
KamogeloMoeketse Jul 23, 2024
908a89c
login service and utils function
KamogeloMoeketse Jul 24, 2024
f9dd85c
chore: Update response model status types to string literals
KamogeloMoeketse Jul 25, 2024
6dbfe34
chore: Refactor login form and API integration
KamogeloMoeketse Jul 27, 2024
2a4a1ed
chore: refactor fetching and storing user details
KamogeloMoeketse Jul 28, 2024
aa65c34
refactor get and store notification and security settings
KamogeloMoeketse Jul 28, 2024
bfebe6c
chore: refactor notification and security setting updating
KamogeloMoeketse Jul 28, 2024
f8c4a23
chore: Update booking and room models, refactor view booking details …
KamogeloMoeketse Jul 28, 2024
81dfca9
chore: logout refactor
KamogeloMoeketse Jul 29, 2024
65c6aba
chore: Refactor Welcome-test.tsx and add GradientButton import
u21631532 Jul 30, 2024
c03a0aa
chore: Update tsconfig.json for better module interoperability and st…
u21631532 Jul 30, 2024
4fec067
chore: Mock NavBarProvider in NavBar-test.tsx
u21631532 Jul 30, 2024
ebc732f
chore: Update Dashboard-test.tsx with mock dependencies and fix rende…
u21631532 Jul 30, 2024
0c8ce9e
chore: Refactor login form and API integration
u21631532 Jul 30, 2024
49205f0
Refactor login form and API integration
u21631532 Jul 30, 2024
40ac99d
chore: Update npm dependencies and configuration files
u21631532 Jul 30, 2024
a622d95
Refactor getUserBookings function and improve error handling
u21631532 Jul 30, 2024
d4896bd
chore: Refactor API services test file and update mock responses
u21631532 Jul 30, 2024
dde3677
chore: Refactor getUserBookings function and improve error handling
u21631532 Jul 30, 2024
3de60a5
Refactor response.ts file and fix formatting issue
u21631532 Jul 30, 2024
fe3feab
Refactor getUserDetails function and improve error handling
u21631532 Jul 30, 2024
6976b38
Tests 100% pass
u21631532 Jul 30, 2024
ebccf77
chore: check-in refactor
KamogeloMoeketse Jul 30, 2024
97d9f7d
chore: cancelbooking refactor
KamogeloMoeketse Jul 30, 2024
002f2a8
chore: Refactor authservices-tests file for logout
u21631532 Jul 30, 2024
33e316c
chore: Refactor authservices-tests file for login error handling
u21631532 Jul 30, 2024
30b53c5
Tests passing
u21631532 Jul 30, 2024
8a866ab
chore: Refactor securestore-test file and update mock responses
u21631532 Jul 30, 2024
598c716
getToken
u21631532 Jul 30, 2024
492d474
Refactor securestore-test file and update mock responses
u21631532 Jul 30, 2024
db335d7
chore: Refactor bookings-test file and update mock responses
u21631532 Jul 30, 2024
89f492b
chore: Refactor auth module for login and logout functionality
u21631532 Jul 30, 2024
0b53640
Test Suites: 1 passed, 1 total
u21631532 Jul 30, 2024
331e316
chore: Update notifications-test file with mock functions and test cases
u21631532 Jul 30, 2024
3bb507c
chore: Add authentication check before fetching user bookings
u21631532 Jul 30, 2024
32f62c5
Test Suites: 1 passed, 1 total
u21631532 Jul 30, 2024
0196d88
chore: Refactor auth module for login and logout functionality
u21631532 Jul 30, 2024
134c4df
Merge branch 'develop' into chore/mobile/refactor
KamogeloMoeketse Aug 2, 2024
bedd72a
fix: added missing comma in package.json
waveyboym Jul 30, 2024
d8d3705
Merge branch 'chore/mobile/refactor' of https://github.com/COS301-SE-…
KamogeloMoeketse Aug 2, 2024
3841c5a
chore: Refactor auth module for login and logout functionality
KamogeloMoeketse Aug 2, 2024
b534b48
chore: BookRoom refactor
KamogeloMoeketse Aug 2, 2024
1af7058
home page editing
KamogeloMoeketse Aug 3, 2024
14ef07b
chore: refactor register - partially complete
KamogeloMoeketse Aug 3, 2024
cf97f8a
Merge branch 'develop' into chore/mobile/refactor
KamogeloMoeketse Aug 3, 2024
d0770b6
home page render with theme
KamogeloMoeketse Aug 4, 2024
484256d
theme and appearance settings fix
KamogeloMoeketse Aug 4, 2024
fa49160
chore: Add accent color setting to NavBar component
KamogeloMoeketse Aug 4, 2024
1369a22
chore: refactor notifications
KamogeloMoeketse Aug 4, 2024
313934a
register functionality fix
KamogeloMoeketse Aug 5, 2024
c3c7af7
chore: refactor profile details update
KamogeloMoeketse Aug 5, 2024
d031583
small fix
KamogeloMoeketse Aug 6, 2024
7384ecf
Merge branch 'develop' into chore/mobile/refactor
KamogeloMoeketse Aug 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 30 additions & 40 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ jobs:
name: Build Backend Binary
runs-on: ${{ matrix.os }}

# set working directory
defaults:
run:
working-directory: occupi-backend

steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -50,22 +45,17 @@ jobs:

- name: Build application
run: |
cd occupi-backend
go build -o occupi-backend_${{ matrix.goos }}_${{ matrix.arch }}${{ matrix.extension }} ${{ matrix.args }} -v cmd/occupi-backend/main.go

- name: Upload artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v3
with:
name: occupi-backend_${{ matrix.goos }}_${{ matrix.arch }}${{ matrix.extension }}
path: occupi-backend_${{ matrix.goos }}_${{ matrix.arch }}${{ matrix.extension }}
path: occupi-backend/occupi-backend_${{ matrix.goos }}_${{ matrix.arch }}${{ matrix.extension }}

build-android:
runs-on: ubuntu-latest

# set working directory
defaults:
run:
working-directory: frontend/occupi-mobile4

steps:
- name: Setup repo
uses: actions/checkout@v4
Expand Down Expand Up @@ -93,25 +83,19 @@ jobs:
token: ${{ secrets.EXPO_TOKEN }}

- name: Install dependencies
run: npm install --legacy-peer-deps
run: npm ci

- name: Build Android app
run: eas build --platform android --profile preview --local --output ${{ github.workspace }}/occupi-mobile-android.apk
run: eas build --platform android --profile preview --local --output ${{ github.workspace }}/app-release.apk

- name: Upload APK artifact
uses: actions/upload-artifact@v4
with:
name: occupi-mobile-android.apk
path: occupi-mobile-android.apk
name: app-release
path: ${{ github.workspace }}/app-release.apk

build-ios:
runs-on: macos-latest

# set working directory
defaults:
run:
working-directory: frontend/occupi-mobile4

steps:
- name: Setup repo
uses: actions/checkout@v4
Expand All @@ -130,16 +114,16 @@ jobs:
token: ${{ secrets.EXPO_TOKEN }}

- name: Install dependencies
run: npm install --legacy-peer-deps
run: npm ci

- name: Build iOS app
run: eas build --platform ios --local --non-interactive --output ${{ github.workspace }}/occupi-mobile-ios.ipa
run: eas build --platform ios --local --non-interactive --output ${{ github.workspace }}/app-release.ipa

- name: Upload IPA artifact
uses: actions/upload-artifact@v4
with:
name: occupi-mobile-ios
path: ${{ github.workspace }}/occupi-mobile-ios.ipa
name: app-release
path: ${{ github.workspace }}/app-release.ipa

build-vite-app:
name: Build Vite App
Expand Down Expand Up @@ -168,7 +152,7 @@ jobs:
zip -r dist/occupi-web.zip frontend/occupi-web/dist

- name: Upload artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v3
with:
name: occupi-web
path: frontend/occupi-web/dist/occupi-web.zip
Expand Down Expand Up @@ -197,11 +181,6 @@ jobs:
extension: ""
args: ''
arch: x86_64

# set working directory
defaults:
run:
working-directory: frontend/occupi-desktop

name: Build Tauri App
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -258,10 +237,21 @@ jobs:
runs-on: ubuntu-latest
needs: [build-backend-binary, build-android, build-ios, build-vite-app, build-tauri-app]
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
# according to the docs, if name is not specified, all artifacts are downloaded
# https://github.com/actions/download-artifact/tree/v4/?tab=readme-ov-file#inputs
with:
path: dist
merge-multiple: true
- name: Install GitHub CLI
run: |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0
sudo apt-add-repository https://cli.github.com/packages
sudo apt update
sudo apt install gh

- name: Login to GitHub
run: |
gh auth login

- name: Create a Release
run: |
gh release create v1.0.0 -t "v1.0.0" -n "v1.0.0" ./occupi-backend/occupi-backend ./occupi-frontend/occupi-frontend ./occupi-frontend/dist ./occupi-frontend/build ./occupi-frontend/target/release/occupi-frontend

- name: Upload Release Assets
run: |
gh release upload v1.0.0 ./occupi-backend/occupi-backend ./occupi-frontend/occupi-frontend ./occupi-frontend/dist ./occupi-frontend/build ./occupi-frontend/target/release/occupi-frontend
41 changes: 0 additions & 41 deletions .github/workflows/build-python.yml

This file was deleted.

34 changes: 16 additions & 18 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build 🏗️ and Deploy Documentation 🛳️
name: Deploy Docs site to Live site

on:
push:
Expand All @@ -10,8 +10,7 @@ on:
"documentation/occupi-docs/next.config.js",
"documentation/occupi-docs/package.json",
"documentation/occupi-docs/theme.config.tsx",
"documentation/occupi-docs/tsconfig.json",
".github/workflows/deploy-docs.yml"
"documentation/occupi-docs/tsconfig.json"
]

workflow_dispatch:
Expand All @@ -23,45 +22,44 @@ defaults:
jobs:
# Build job
build-test:
name: 🏗️ Build
runs-on: ubuntu-latest
steps:
- name: ⬇️ Checkout
- name: Checkout
uses: actions/checkout@v4

- name: 🏗 Setup Bun
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest # or "latest", "canary", <sha>

- name: 📦 Install dependencies with Bun
- name: Install dependencies with Bun
run: bun install

- name: 🚀 Build with Next.js
- name: Build with Next.js
run: bun run build

build-push-docker:
name: 🐋 Build and Push Documentation Docker Image
name: Build and Push Documentation Docker Image
runs-on: ubuntu-latest
needs: build-test

steps:
- name: ⬇️ Checkout code
- name: Checkout code
uses: actions/checkout@v4

- name: 🏗 Set up QEMU
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: 🏗 Set up Docker Buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: 🧑‍💻 Login to DockerHub
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: 🐳 Build and push Docker image
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: documentation/occupi-docs
Expand All @@ -71,15 +69,15 @@ jobs:
tags: ${{ secrets.DOCKER_USERNAME }}/occupi-documentation:latest

deploy:
name: 🛳️ Deploy Documentation
name: Deploy Documentation
runs-on: ubuntu-latest
needs: build-push-docker

steps:
- name: ⬇️ Checkout code
- name: Checkout code
uses: actions/checkout@v4

- name: 🪷 Copy files to VM
- name: Copy files to VM
uses: appleboy/scp-action@v0.1.5
with:
host: ${{ secrets.VM_IP }}
Expand All @@ -89,7 +87,7 @@ jobs:
target: "/home/${{ secrets.VM_USERNAME }}/occupi-docs"

# SSH to VM and run commands
- name: 🚀 SSH to VM
- name: SSH to VM
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.VM_IP }}
Expand Down
34 changes: 17 additions & 17 deletions .github/workflows/deploy-golang-develop.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build 🏗️ and Deploy Golang App 🛳️ to Develop 🚈
name: Build and Deploy Dev golang

on:
push:
Expand All @@ -18,52 +18,52 @@ defaults:

jobs:
build-test:
name: 🏗️ Build
name: Build
runs-on: ubuntu-latest

steps:
- name: ⬇️ Checkout code
- name: Checkout code
uses: actions/checkout@v4

- name: 🏗 Set up Go
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21' # Specify the Go version you are using

- name: 🚀 Build the code
- name: Build the code
run: |
go build -v cmd/occupi-backend/main.go

build-push-docker:
name: 🐋 Build and Push Develop Docker Image
name: Build and Push Develop Docker Image
runs-on: ubuntu-latest
needs: build-test

steps:
- name: ⬇️ Checkout code
- name: Checkout code
uses: actions/checkout@v4

- name: 🏗 Set up QEMU
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: 🏗 Set up Docker Buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: 🧑‍💻 Login to DockerHub
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: 🔓 Decrypt default variables
- name: Decrypt default variables
run: |
echo "${{ secrets.GPG_PASSPHRASE }}" | gpg --quiet --batch --yes --decrypt --passphrase-fd 0 configs/config.yaml.gpg > configs/config.yaml

- name: 🔓 Decrypt test variables
- name: Decrypt test variables
run: |
echo "${{ secrets.GPG_PASSPHRASE }}" | gpg --quiet --batch --yes --decrypt --passphrase-fd 0 configs/dev.deployed.yaml.gpg > configs/dev.deployed.yaml

- name: 🐳 Build and push Docker image
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: occupi-backend
Expand All @@ -73,15 +73,15 @@ jobs:
tags: ${{ secrets.DOCKER_USERNAME }}/occupi-backend:latest-develop

deploy:
name: 🛳️ Deploy for Develop
name: Deploy for Develop
runs-on: ubuntu-latest
needs: build-push-docker

steps:
- name: ⬇️ Checkout code
- name: Checkout code
uses: actions/checkout@v4

- name: 🪷 Copy files to VM
- name: Copy files to VM
uses: appleboy/scp-action@v0.1.5
with:
host: ${{ secrets.VM_IP }}
Expand All @@ -91,7 +91,7 @@ jobs:
target: "/home/${{ secrets.VM_USERNAME }}/occupi-backend-dev"

# SSH to VM and run commands
- name: 🚀 SSH to VM
- name: SSH to VM
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.VM_IP }}
Expand Down
Loading
Loading