diff --git a/.env.example b/.env.example index 3a828f15..d0d9c04a 100644 --- a/.env.example +++ b/.env.example @@ -18,7 +18,7 @@ DB_SYNCHRONIZE=true DB_ENABLE_SSL=false PORT=8080 LOG_LEVEL=debug -JWT_EXPIRES_DAY=30d +JWT_EXPIRES_DAY=7d JWT_SECRET=hexschool666 FIREBASE_STORAGE_BUCKET='' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 3ea6ff53..00000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,142 +0,0 @@ -name: Check -on: - push: - - -jobs: - build : - name: build - runs-on: ubuntu-latest - steps: - - name: Checkout to Repo Directory - uses: actions/checkout@v4 - - name: Use Node.js 24 - uses: actions/setup-node@v6 - with: - node-version: '24' - cache: 'npm' - cache-dependency-path: backend/package-lock.json - - name: Restore cache node modules - id: cache - uses: actions/cache/restore@v4 - with: - path: backend/node_modules - key: ${{ runner.os }}-node-backend-${{ hashFiles('package-lock.json') }} - - name: Install dependencies - working-directory: backend - if: steps.cache.outputs.cache-hit != 'true' - run: npm ci - - name: update cache node modules - if: steps.cache.outputs.cache-hit != 'true' - uses: actions/cache/save@v4 - with: - path: backend/node_modules - key: ${{ runner.os }}-node-backend-${{ hashFiles('package-lock.json') }} - # eslint-scan : - # name: Eslint Scanning - # needs: [build] - # runs-on: ubuntu-latest - # steps: - # - name: Checkout to Repo Directory - # uses: actions/checkout@v4 - # - name: Use Node.js 22 - # uses: actions/setup-node@v6 - # with: - # node-version: '22' - # cache: 'npm' - # cache-dependency-path: backend/package-lock.json - # - name: Restore cache node modules - # id: cache - # uses: actions/cache/restore@v4 - # with: - # path: backend/node_modules - # key: ${{ runner.os }}-node-backend-${{ hashFiles('package-lock.json') }} - # restore-keys: | - # ${{ runner.os }}-node-backend- - # - name: Eslint Scan - # uses: reviewdog/action-eslint@v1 - # with: - # workdir: ./backend - # reporter: github-check - integration-test: - name: Run integration Test - needs: [build] - runs-on: ubuntu-latest - permissions: - contents: read - pull-requests: write - statuses: write - env: - DB_USERNAME: root - DB_DATABASE: test - DB_PASSWORD: test - DB_HOST: localhost - DB_PORT: 5432 - services: - postgres: - image: postgres:17-alpine - ports: - - 5432:5432 - env: - POSTGRES_USER: ${{ env.DB_USERNAME }} - POSTGRES_PASSWORD: ${{ env.DB_PASSWORD }} - POSTGRES_DB: ${{ env.DB_DATABASE }} - steps: - - name: Checkout to Repo Directory - uses: actions/checkout@v4 - - name: Use Node.js 24 - uses: actions/setup-node@v6 - with: - node-version: '24' - cache: 'npm' - cache-dependency-path: backend/package-lock.json - - name: Restore cache node modules - id: cache - uses: actions/cache/restore@v4 - with: - path: backend/node_modules - key: ${{ runner.os }}-node-backend-${{ hashFiles('package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node-backend- - - name: Make env file - uses: SpicyPizza/create-envfile@v1 - with: - envkey_NODE_ENV: production - envkey_DB_HOST: ${{ env.DB_HOST }} - envkey_DB_PORT: ${{ env.DB_PORT }} - envkey_DB_DATABASE: ${{ env.DB_DATABASE }} - envkey_DB_USERNAME: ${{ env.DB_USERNAME }} - envkey_DB_PASSWORD: ${{ env.DB_PASSWORD }} - envkey_DB_SYNCHRONIZE: true - envkey_DB_ENABLE_SSL: false - envkey_JWT_SECRET: hexschool666 - envkey_JWT_EXPIRES_DAY: 30d - envkey_LOG_LEVEL: debug - envkey_FIREBASE_SERVICE_ACCOUNT: ${{ secrets.FIREBASE_SERVICE_ACCOUNT }} - envkey_FIREBASE_STORAGE_BUCKET: ${{ secrets.FIREBASE_STORAGE_BUCKET }} - envkey_PORT: 3000 - directory: backend - file_name: .env - # - name: init schema - # working-directory: backend - # run: npm run init:schema - - name: test server - working-directory: backend - run: npm run test:integration - - name: upload coverage report - uses: actions/upload-artifact@v4 - with: - name: IntegrationTest Coverage report - path: backend/coverage - retention-days: 1 - - name: Integration Test Coverage monitor - uses: slavcodev/coverage-monitor-action@v1 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - coverage_path: "backend/coverage/clover.xml" - threshold_alert: 10 - threshold_warning: 50 - comment_context: 'Integration Test Report' - - - \ No newline at end of file diff --git a/.github/workflows/validate-advanced-missions.yml b/.github/workflows/validate-advanced-missions.yml new file mode 100644 index 00000000..408088c5 --- /dev/null +++ b/.github/workflows/validate-advanced-missions.yml @@ -0,0 +1,152 @@ +name: Validate Advanced Missions + +on: + push: + branches: ['*'] + pull_request: + branches: ['*'] + +jobs: + validate-screenshots: + name: Validate Advanced Missions Screenshots + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Check screenshots folder exists + run: | + echo "๐ ๆชขๆฅ screenshots ่ณๆๅคพๆฏๅฆๅญๅจ" + if [ -d "screenshots" ]; then + echo "โ screenshots ่ณๆๅคพๅญๅจ" + else + echo "โ ๏ธ screenshots ่ณๆๅคพไธๅญๅจ๏ผ่ทณ้้ฒ้ไปปๅ้ฉ่ญ" + echo "๐ก ๆ็คบ๏ผๅฆๆๆจๅชๅฎๆๅ้ไปปๅ (LV1)๏ผๅฏไปฅๅฟฝ็ฅๆญคๆชขๆฅ" + echo "SKIP_VALIDATION=true" >> $GITHUB_ENV + fi + + - name: Check screenshot 01 - Register + if: env.SKIP_VALIDATION != 'true' + run: | + echo "๐ ๆชๅ 1๏ผๆชขๆฅ่จปๅๆๅๆชๅ" + if [ -f "screenshots/01-register.png" ] || [ -f "screenshots/01-register.jpg" ] || [ -f "screenshots/01-register.jpeg" ]; then + echo "โ ้้๏ผ01-register ๆชๅๅทฒไธๅณ" + else + echo "โ ๅคฑๆ๏ผ่ซไธๅณ screenshots/01-register.png๏ผๅ ฉๅๅธณ่่จปๅๆๅ๏ผ" + exit 1 + fi + + - name: Check screenshot 02 - Add Credit Package + if: env.SKIP_VALIDATION != 'true' + run: | + echo "๐ ๆชๅ 2๏ผๆชขๆฅๆฐๅข็ตๅๅ ๆนๆกๆชๅ" + if [ -f "screenshots/02-add-credit-package.png" ] || [ -f "screenshots/02-add-credit-package.jpg" ] || [ -f "screenshots/02-add-credit-package.jpeg" ]; then + echo "โ ้้๏ผ02-add-credit-package ๆชๅๅทฒไธๅณ" + else + echo "โ ๅคฑๆ๏ผ่ซไธๅณ screenshots/02-add-credit-package.png๏ผDBeaver ๆฐๅข็ตๅๅ ๆนๆกๆๅ๏ผ" + exit 1 + fi + + - name: Check screenshot 03 - Add Skill + if: env.SKIP_VALIDATION != 'true' + run: | + echo "๐ ๆชๅ 3๏ผๆชขๆฅๆฐๅขๆ่ฝๆชๅ" + if [ -f "screenshots/03-add-skill.png" ] || [ -f "screenshots/03-add-skill.jpg" ] || [ -f "screenshots/03-add-skill.jpeg" ]; then + echo "โ ้้๏ผ03-add-skill ๆชๅๅทฒไธๅณ" + else + echo "โ ๅคฑๆ๏ผ่ซไธๅณ screenshots/03-add-skill.png๏ผๅพๅฐๆฐๅขๆ่ฝๆๅ๏ผ" + exit 1 + fi + + - name: Check screenshot 04 - Upgrade Coach + if: env.SKIP_VALIDATION != 'true' + run: | + echo "๐ ๆชๅ 4๏ผๆชขๆฅๅ็ดๆ็ทดๆชๅ" + if [ -f "screenshots/04-upgrade-coach.png" ] || [ -f "screenshots/04-upgrade-coach.jpg" ] || [ -f "screenshots/04-upgrade-coach.jpeg" ]; then + echo "โ ้้๏ผ04-upgrade-coach ๆชๅๅทฒไธๅณ" + else + echo "โ ๅคฑๆ๏ผ่ซไธๅณ screenshots/04-upgrade-coach.png๏ผๆ็ทด่ณๆ ผ็ฎก็ๅ็ดๆๅ๏ผ" + exit 1 + fi + + - name: Check screenshot 05 - Create Course + if: env.SKIP_VALIDATION != 'true' + run: | + echo "๐ ๆชๅ 5๏ผๆชขๆฅๆ็ทด้่ชฒๆชๅ" + if [ -f "screenshots/05-create-course.png" ] || [ -f "screenshots/05-create-course.jpg" ] || [ -f "screenshots/05-create-course.jpeg" ]; then + echo "โ ้้๏ผ05-create-course ๆชๅๅทฒไธๅณ" + else + echo "โ ๅคฑๆ๏ผ่ซไธๅณ screenshots/05-create-course.png๏ผๆ็ทด้่ชฒๆๅ๏ผ" + exit 1 + fi + + - name: Check screenshot 06 - Buy Credits + if: env.SKIP_VALIDATION != 'true' + run: | + echo "๐ ๆชๅ 6๏ผๆชขๆฅ่ณผ่ฒทๅ ๆธๆชๅ" + if [ -f "screenshots/06-buy-credits.png" ] || [ -f "screenshots/06-buy-credits.jpg" ] || [ -f "screenshots/06-buy-credits.jpeg" ]; then + echo "โ ้้๏ผ06-buy-credits ๆชๅๅทฒไธๅณ" + else + echo "โ ๅคฑๆ๏ผ่ซไธๅณ screenshots/06-buy-credits.png๏ผๅญธๅก่ณผ่ฒทๅ ๆธๆๅ๏ผ" + exit 1 + fi + + - name: Check screenshot 07 - Book Course + if: env.SKIP_VALIDATION != 'true' + run: | + echo "๐ ๆชๅ 7๏ผๆชขๆฅ้ ็ด่ชฒ็จๆชๅ" + if [ -f "screenshots/07-book-course.png" ] || [ -f "screenshots/07-book-course.jpg" ] || [ -f "screenshots/07-book-course.jpeg" ]; then + echo "โ ้้๏ผ07-book-course ๆชๅๅทฒไธๅณ" + else + echo "โ ๅคฑๆ๏ผ่ซไธๅณ screenshots/07-book-course.png๏ผๅญธๅก้ ็ด่ชฒ็จๆๅ๏ผ" + exit 1 + fi + + - name: Check screenshot 08 - Booking Record + if: env.SKIP_VALIDATION != 'true' + run: | + echo "๐ ๆชๅ 8๏ผๆชขๆฅ้ ็ด็ด้ๆชๅ" + if [ -f "screenshots/08-booking-record.png" ] || [ -f "screenshots/08-booking-record.jpg" ] || [ -f "screenshots/08-booking-record.jpeg" ]; then + echo "โ ้้๏ผ08-booking-record ๆชๅๅทฒไธๅณ" + else + echo "โ ๅคฑๆ๏ผ่ซไธๅณ screenshots/08-booking-record.png๏ผ้ ็ด็ด้็ซ้ข๏ผ" + exit 1 + fi + + - name: All advanced missions completed + if: env.SKIP_VALIDATION != 'true' + run: | + echo "" + echo "๐๐๐ ๆญๅ๏ผ้ฒ้ไปปๅๆชๅๅ จ้จไธๅณๅฎๆ๏ผ๐๐๐" + echo "" + echo "โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ" + echo "โ ้ฒ้ไปปๅๆชๅ้ฉ่ญ็ตๆ โ" + echo "โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฃ" + echo "โ ๆชๅ 1๏ผๅ ฉๅๅธณ่่จปๅๆๅ โ ๅทฒไธๅณ โ" + echo "โ ๆชๅ 2๏ผDBeaver ๆฐๅข็ตๅๅ ๆนๆกๆๅ โ ๅทฒไธๅณ โ" + echo "โ ๆชๅ 3๏ผๅพๅฐๆฐๅขๆ่ฝๆๅ โ ๅทฒไธๅณ โ" + echo "โ ๆชๅ 4๏ผๆ็ทด่ณๆ ผ็ฎก็ๅ็ดๆๅ โ ๅทฒไธๅณ โ" + echo "โ ๆชๅ 5๏ผๆ็ทด้่ชฒๆๅ โ ๅทฒไธๅณ โ" + echo "โ ๆชๅ 6๏ผๅญธๅก่ณผ่ฒทๅ ๆธๆๅ โ ๅทฒไธๅณ โ" + echo "โ ๆชๅ 7๏ผๅญธๅก้ ็ด่ชฒ็จๆๅ โ ๅทฒไธๅณ โ" + echo "โ ๆชๅ 8๏ผ้ ็ด็ด้็ซ้ข โ ๅทฒไธๅณ โ" + echo "โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฃ" + echo "โ โ ๅ จ้จ 8 ๅผตๆชๅๅทฒไธๅณ๏ผ โ" + echo "โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ" + echo "" + echo "๐ ๆญๅๅฎๆ LV2 ้ฒ้ไปปๅ๏ผ" + + - name: Skip message + if: env.SKIP_VALIDATION == 'true' + run: | + echo "" + echo "โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ" + echo "โ ้ฒ้ไปปๅๆชๅ้ฉ่ญ็ตๆ โ" + echo "โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฃ" + echo "โ โ ๏ธ ๆชๅตๆธฌๅฐ screenshots ่ณๆๅคพ โ" + echo "โ โ" + echo "โ ๅฆๆๆจๅชๅฎๆ LV1 ๅ้ไปปๅ๏ผๅฏไปฅๅฟฝ็ฅๆญค่จๆฏ โ" + echo "โ ๅฆๆๆจ่ฆๅฎๆ LV2 ้ฒ้ไปปๅ๏ผ่ซ๏ผ โ" + echo "โ 1. ๅปบ็ซ screenshots ่ณๆๅคพ โ" + echo "โ 2. ไธๅณ 8 ๅผตๆชๅ๏ผ01-register.png ~ 08-booking-record.png๏ผโ" + echo "โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ" diff --git a/.github/workflows/validate-beginner-missions.yml b/.github/workflows/validate-beginner-missions.yml new file mode 100644 index 00000000..6acf8f85 --- /dev/null +++ b/.github/workflows/validate-beginner-missions.yml @@ -0,0 +1,104 @@ +name: ๅ้ไปปๅ้ฉ่ญ + +on: + push: + branches: ['*'] + pull_request: + branches: ['*'] + +jobs: + validate-missions: + name: ้ฉ่ญๅ้ไปปๅ 7 ้ก + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Task 1 - Check website title + run: | + echo "๐ ้ก็ฎ 1๏ผๆชขๆฅ็ถฒ็ซ Title" + if grep -q "
+
LiveFit+
+
LiveFit+
diff --git a/screenshots/01-register.png b/screenshots/01-register.png
new file mode 100644
index 00000000..e11d7d72
Binary files /dev/null and b/screenshots/01-register.png differ
diff --git a/screenshots/02-add-credit-package.png b/screenshots/02-add-credit-package.png
new file mode 100644
index 00000000..d015ce3b
Binary files /dev/null and b/screenshots/02-add-credit-package.png differ
diff --git a/screenshots/03-add-skill.png b/screenshots/03-add-skill.png
new file mode 100644
index 00000000..655c2179
Binary files /dev/null and b/screenshots/03-add-skill.png differ
diff --git a/screenshots/04-upgrade-coach.png b/screenshots/04-upgrade-coach.png
new file mode 100644
index 00000000..ed4bc01b
Binary files /dev/null and b/screenshots/04-upgrade-coach.png differ
diff --git a/screenshots/05-create-course.png b/screenshots/05-create-course.png
new file mode 100644
index 00000000..b99d7833
Binary files /dev/null and b/screenshots/05-create-course.png differ
diff --git a/screenshots/06-buy-credits.png b/screenshots/06-buy-credits.png
new file mode 100644
index 00000000..0a90c8a7
Binary files /dev/null and b/screenshots/06-buy-credits.png differ
diff --git a/screenshots/07-book-course.png b/screenshots/07-book-course.png
new file mode 100644
index 00000000..449aa227
Binary files /dev/null and b/screenshots/07-book-course.png differ
diff --git a/screenshots/08-booking-record.png b/screenshots/08-booking-record.png
new file mode 100644
index 00000000..533e6f18
Binary files /dev/null and b/screenshots/08-booking-record.png differ