Skip to content
This repository was archived by the owner on Aug 15, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
290edd4
Merge pull request #15 from Team293/production
PillageDev Aug 10, 2025
78410fc
Refactor env config and paths, update ports, add .env.example
PillageDev Aug 11, 2025
a52b34a
Update .github/workflows/deploy.yml
PillageDev Aug 11, 2025
a9ee4a7
Update .github/workflows/deploy.yml
PillageDev Aug 11, 2025
391a0a8
Update apps/auth/app/login/page.tsx
PillageDev Aug 11, 2025
9bc64a1
Update pr.yml
PillageDev Aug 11, 2025
c7ecebc
Update packages/env/src/env.server.ts
PillageDev Aug 11, 2025
f668beb
Log available environment variables in deploy workflow
PillageDev Aug 11, 2025
7dfb117
Merge branch 'bugfix/auth-and-paths-config-local' of https://github.c…
PillageDev Aug 11, 2025
14fbb30
Update env var handling in workflows and expand .env contents
PillageDev Aug 11, 2025
df9c66f
Merge pull request #20 from Team293/bugfix/auth-and-paths-config-local
PillageDev Aug 11, 2025
35326c3
Added attendance system
NathanEdg Aug 11, 2025
ad111ed
refractor for better readability + pass lint checks
NathanEdg Aug 11, 2025
0434bfd
Update apps/attendance/components/data-table/data-table.tsx
NathanEdg Aug 11, 2025
4287afe
Update apps/attendance/app/api/cron/route.ts
NathanEdg Aug 11, 2025
26b5cdb
fixed style and import errors
NathanEdg Aug 11, 2025
aee5eb4
Merge branch 'feat/attendance-system' of https://github.com/Team293/S…
NathanEdg Aug 11, 2025
f96e817
Update apps/attendance/components/data-table/data-table-column-header…
NathanEdg Aug 11, 2025
9ec9ea7
Update apps/attendance/components/data-table/data-table-column-header…
NathanEdg Aug 11, 2025
963a92c
Update apps/attendance/types/data-table.ts
NathanEdg Aug 11, 2025
82d93d3
Update apps/attendance/types/data-table.ts
NathanEdg Aug 11, 2025
59c2aba
Update apps/attendance/app/admin/dashboard/_components/user-table.tsx
NathanEdg Aug 11, 2025
44c8491
fix attendance deploy
NathanEdg Aug 11, 2025
c5c84aa
fix pr ci
NathanEdg Aug 11, 2025
c4a362a
copilot mistake
NathanEdg Aug 11, 2025
79e2436
Update pr.yml
NathanEdg Aug 11, 2025
4aa7dd9
Update package.json
NathanEdg Aug 11, 2025
0a207f4
remove better auth and fix pr
NathanEdg Aug 11, 2025
485d7b1
Update pnpm-lock.yaml
NathanEdg Aug 11, 2025
6aac2e1
Merge pull request #22 from Team293/feat/attendance-system
PillageDev Aug 11, 2025
807efec
fix deploy
NathanEdg Aug 12, 2025
c9784f6
fix deploy
NathanEdg Aug 12, 2025
131c238
Update apps/attendance/app/api/cron/route.ts
NathanEdg Aug 12, 2025
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
16 changes: 12 additions & 4 deletions .env.development
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
DATABASE_URL=postgres://postgres:123456789@localhost:7501/postgres
NEXT_PUBLIC_API_BASE_URL='http://localhost:5000'
DATABASE_URL=postgres://postgres:123456789@localhost:7501/postgres # local docker db url

BETTER_AUTH_SECRET=kOmFf8qlUgCYXyXvlpCHO2D0wOXgoYXC # this isn't the production one don't worry
NODE_TLS_REJECT_UNAUTHORIZED=0
BETTER_AUTH_URL='http://localhost:3001'

# Base urls
NEXT_PUBLIC_AUTH_BASE_URL='http://localhost:3001'
NEXT_PUBLIC_API_BASE_URL='http://localhost:5000'
NEXT_PUBLIC_DOCS_BASE_URL='http://localhost:3002'
NEXT_PUBLIC_LANDING_BASE_URL='http://localhost:3000'
NEXT_PUBLIC_LEARN_BASE_URL='http://localhost:3003'
NEXT_PUBLIC_SCOUT_BASE_URL='http://localhost:3004'

NODE_ENV='development'
18 changes: 18 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Server variables
BETTER_AUTH_SECRET=zZcnOqQ6hR1nvYin80pOS0QQaTZ5fT6h # You can generate a new one at: https://www.better-auth.com/docs/installation
DATABASE_URL=postgres://postgres:123456789@localhost:7501/postgres # This is the db url from pnpm run dev:setup (Docker required)
GITHUB_CLIENT_ID= # Don't worry about these; if you want you can create a github app
GITHUB_CLIENT_SECRET= # Just use magic link to test locally

# Shared Variables

# Base URLs (these are setup for local development, don't edit unless you know what you are doing)
NEXT_PUBLIC_AUTH_BASE_URL='http://localhost:3001'
NEXT_PUBLIC_API_BASE_URL='http://localhost:5000'
NEXT_PUBLIC_DOCS_BASE_URL='http://localhost:3002'
NEXT_PUBLIC_LANDING_BASE_URL='http://localhost:3000'
NEXT_PUBLIC_LEARN_BASE_URL='http://localhost:3003'
NEXT_PUBLIC_SCOUT_BASE_URL='http://localhost:3004'
NEXT_PUBLIC_ATTENDANCE_BASE_URL='http://localhost:3005'

NODE_ENV='development'
49 changes: 36 additions & 13 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,33 +98,45 @@ jobs:
- name: Generate environment files
run: |
set -euo pipefail
for APP in auth landing learn scout nitro-api; do
for APP in auth landing learn scout nitro-api attendance; do
mkdir -p "apps/$APP"
{
echo "BETTER_AUTH_URL=${BETTER_AUTH_URL}"
echo "DATABASE_URL=${DATABASE_URL}"
echo "NEXT_PUBLIC_API_BASE_URL=${NEXT_PUBLIC_API_BASE_URL}"
echo "NEXT_PUBLIC_BASE_URL=${NEXT_PUBLIC_BASE_URL}"
echo "NODE_ENV=${NODE_ENV}"
echo "BETTER_AUTH_SECRET=${BETTER_AUTH_SECRET}"
echo "NODE_TLS_REJECT_UNAUTHORIZED=0"
echo "DATABASE_URL=${DATABASE_URL}"
echo "GITHUB_CLIENT_ID=${GITHUB_CLIENT_ID}"
echo "GITHUB_CLIENT_SECRET=${GITHUB_CLIENT_SECRET}"
echo "NEXT_PUBLIC_AUTH_BASE_URL=${NEXT_PUBLIC_AUTH_BASE_URL}"
echo "NEXT_PUBLIC_API_BASE_URL=${NEXT_PUBLIC_API_BASE_URL}"
echo "NEXT_PUBLIC_DOCS_BASE_URL=${NEXT_PUBLIC_DOCS_BASE_URL}"
echo "NEXT_PUBLIC_LANDING_BASE_URL=${NEXT_PUBLIC_LANDING_BASE_URL}"
echo "NEXT_PUBLIC_LEARN_BASE_URL=${NEXT_PUBLIC_LEARN_BASE_URL}"
echo "NEXT_PUBLIC_SCOUT_BASE_URL=${NEXT_PUBLIC_SCOUT_BASE_URL}"
echo "NEXT_PUBLIC_ATTENDANCE_BASE_URL=${NEXT_PUBLIC_ATTENDANCE_BASE_URL}"
echo "CRON_SECURITY_KEY=${CRON_SECRET_KEY}"
echo "NODE_TLS_REJECT_UNAUTHORIZED=0"
} > "apps/$APP/.env"
cp "apps/$APP/.env" "apps/$APP/.env.production"
echo "Created env files for $APP"
done
env:
BETTER_AUTH_URL: ${{ secrets.BETTER_AUTH_URL }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
NEXT_PUBLIC_API_BASE_URL: ${{ secrets.NEXT_PUBLIC_API_BASE_URL }}
NEXT_PUBLIC_BASE_URL: ${{ secrets.NEXT_PUBLIC_BASE_URL }}
NODE_ENV: ${{ github.ref == 'refs/heads/production' && 'production' || 'staging' }}
BETTER_AUTH_SECRET: ${{ secrets.BETTER_AUTH_SECRET }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
GITHUB_CLIENT_ID: ${{ secrets.GH_CLIENT_ID }}
GITHUB_CLIENT_SECRET: ${{ secrets.GH_CLIENT_SECRET }}
NEXT_PUBLIC_AUTH_BASE_URL: ${{ secrets.NEXT_PUBLIC_AUTH_BASE_URL }}
NEXT_PUBLIC_API_BASE_URL: ${{ secrets.NEXT_PUBLIC_API_BASE_URL }}
NEXT_PUBLIC_DOCS_BASE_URL: ${{ secrets.NEXT_PUBLIC_DOCS_BASE_URL }}
NEXT_PUBLIC_LANDING_BASE_URL: ${{ secrets.NEXT_PUBLIC_LANDING_BASE_URL }}
NEXT_PUBLIC_LEARN_BASE_URL: ${{ secrets.NEXT_PUBLIC_LEARN_BASE_URL }}
NEXT_PUBLIC_SCOUT_BASE_URL: ${{ secrets.NEXT_PUBLIC_SCOUT_BASE_URL }}
NEXT_PUBLIC_ATTENDANCE_BASE_URL: ${{ secrets.NEXT_PUBLIC_ATTENDANCE_BASE_URL }}
CRON_SECRET_KEY: ${{ secrets.CRON_SECRET_KEY }}

- name: Turbo prebuild all deployable apps
run: |
pnpm turbo run build --filter=./apps/auth --filter=./apps/landing --filter=./apps/learn --filter=./apps/scout --filter=./apps/docs --filter=./apps/nitro-api
pnpm turbo run build --filter=./apps/auth --filter=./apps/landing --filter=./apps/learn --filter=./apps/scout --filter=./apps/docs --filter=./apps/nitro-api --filter=./apps/attendance

- name: List built artifacts
run: |
Expand All @@ -134,12 +146,13 @@ jobs:
ls -1 apps/scout/.next || true
ls -1 apps/docs/.next || true
ls -1 apps/nitro-api/.output || true
ls -1 apps/attendance/.next || true

- name: Package build artifacts
run: |
set -euo pipefail
mkdir -p dist-artifacts
for APP in auth landing learn scout docs; do
for APP in auth landing learn scout docs attendance; do
if [ -d "apps/$APP/.next" ]; then
(cd apps/$APP && tar -czf "../../dist-artifacts/next-${APP}${ARTIFACT_SUFFIX}.tgz" .next $( [ -f .env ] && echo .env ) $( [ -f .env.production ] && echo .env.production ))
echo "Packaged next-${APP}${ARTIFACT_SUFFIX}.tgz"
Expand Down Expand Up @@ -204,7 +217,15 @@ jobs:
path: dist-artifacts/nitro-api${{ env.ARTIFACT_SUFFIX }}.tgz
if-no-files-found: error
retention-days: 3


- name: Upload artifact attendance
uses: actions/upload-artifact@v4
with:
name: next-attendance${{ env.ARTIFACT_SUFFIX }}
path: dist-artifacts/next-attendance${{ env.ARTIFACT_SUFFIX }}.tgz
if-no-files-found: error
retention-days: 3

build-next:
name: Build & push Next.js images (prebuilt)
runs-on: ubuntu-latest
Expand All @@ -224,6 +245,8 @@ jobs:
webhook_key: WEBHOOK_URL_SCOUT
- app: docs
webhook_key: WEBHOOK_URL_DOCS
- app: attendance
webhook_key: WEBHOOK_URL_ATTENDANCE

steps:
- name: Checkout
Expand Down
81 changes: 49 additions & 32 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,6 @@ on:
- production
paths-ignore: []

jobs:
skip-if-staging-to-production:
if: github.event.pull_request.base.ref == 'production' && github.event.pull_request.head.ref == 'staging'
runs-on: ubuntu-latest
steps:
- run: echo "Skipping PR checks for staging -> production PR."
outputs:
skipped: true

lint:
if: github.event.pull_request.base.ref != 'production' || github.event.pull_request.head.ref != 'staging'

# Prevent duplicate runs on same PR head
concurrency:
group: pr-ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read
packages: read
Expand All @@ -36,8 +19,21 @@ env:
STAGING: true
ARTIFACT_SUFFIX: -pr

concurrency:
group: pr-ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
skip-if-staging-to-production:
if: github.event.pull_request.base.ref == 'production' && github.event.pull_request.head.ref == 'staging'
runs-on: ubuntu-latest
steps:
- run: echo "Skipping PR checks for staging -> production PR."
outputs:
skipped: true

lint:
if: github.event.pull_request.base.ref != 'production' || github.event.pull_request.head.ref != 'staging'
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 15
Expand All @@ -53,7 +49,7 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
run_install: false
run_install: false

- name: Get pnpm store directory
id: pnpm-store
Expand Down Expand Up @@ -111,33 +107,45 @@ jobs:
- name: Generate environment files
run: |
set -euo pipefail
for APP in auth landing learn scout nitro-api; do
for APP in auth landing learn scout nitro-api attendance; do
mkdir -p "apps/$APP"
{
echo "BETTER_AUTH_URL=${BETTER_AUTH_URL}"
echo "DATABASE_URL=${DATABASE_URL}"
echo "NEXT_PUBLIC_API_BASE_URL=${NEXT_PUBLIC_API_BASE_URL}"
echo "NEXT_PUBLIC_BASE_URL=${NEXT_PUBLIC_BASE_URL}"
echo "NODE_ENV=${NODE_ENV}"
echo "BETTER_AUTH_SECRET=${BETTER_AUTH_SECRET}"
echo "NODE_TLS_REJECT_UNAUTHORIZED=0"
echo "DATABASE_URL=${DATABASE_URL}"
echo "GITHUB_CLIENT_ID=${GITHUB_CLIENT_ID}"
echo "GITHUB_CLIENT_SECRET=${GITHUB_CLIENT_SECRET}"
echo "NEXT_PUBLIC_AUTH_BASE_URL=${NEXT_PUBLIC_AUTH_BASE_URL}"
echo "NEXT_PUBLIC_API_BASE_URL=${NEXT_PUBLIC_API_BASE_URL}"
echo "NEXT_PUBLIC_DOCS_BASE_URL=${NEXT_PUBLIC_DOCS_BASE_URL}"
echo "NEXT_PUBLIC_LANDING_BASE_URL=${NEXT_PUBLIC_LANDING_BASE_URL}"
echo "NEXT_PUBLIC_LEARN_BASE_URL=${NEXT_PUBLIC_LEARN_BASE_URL}"
echo "NEXT_PUBLIC_SCOUT_BASE_URL=${NEXT_PUBLIC_SCOUT_BASE_URL}"
echo "NEXT_PUBLIC_ATTENDANCE_BASE_URL=${NEXT_PUBLIC_ATTENDANCE_BASE_URL}"
echo "CRON_SECURITY_KEY=${CRON_SECURITY_KEY}"
echo "NODE_TLS_REJECT_UNAUTHORIZED=0"
} > "apps/$APP/.env"
cp "apps/$APP/.env" "apps/$APP/.env.production"
echo "Created env files for $APP"
done
env:
BETTER_AUTH_URL: ${{ secrets.BETTER_AUTH_URL }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
NEXT_PUBLIC_API_BASE_URL: ${{ secrets.NEXT_PUBLIC_API_BASE_URL }}
NEXT_PUBLIC_BASE_URL: ${{ secrets.NEXT_PUBLIC_BASE_URL }}
NODE_ENV: ${{ github.ref == 'refs/heads/production' && 'production' || 'staging' }}
BETTER_AUTH_SECRET: ${{ secrets.BETTER_AUTH_SECRET }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
GITHUB_CLIENT_ID: ${{ secrets.GH_CLIENT_ID }}
GITHUB_CLIENT_SECRET: ${{ secrets.GH_CLIENT_SECRET }}
NEXT_PUBLIC_AUTH_BASE_URL: ${{ secrets.NEXT_PUBLIC_AUTH_BASE_URL }}
NEXT_PUBLIC_API_BASE_URL: ${{ secrets.NEXT_PUBLIC_API_BASE_URL }}
NEXT_PUBLIC_DOCS_BASE_URL: ${{ secrets.NEXT_PUBLIC_DOCS_BASE_URL }}
NEXT_PUBLIC_LANDING_BASE_URL: ${{ secrets.NEXT_PUBLIC_LANDING_BASE_URL }}
NEXT_PUBLIC_LEARN_BASE_URL: ${{ secrets.NEXT_PUBLIC_LEARN_BASE_URL }}
NEXT_PUBLIC_SCOUT_BASE_URL: ${{ secrets.NEXT_PUBLIC_SCOUT_BASE_URL }}
NEXT_PUBLIC_ATTENDANCE_BASE_URL: ${{ secrets.NEXT_PUBLIC_ATTENDANCE_BASE_URL }}
CRON_SECURITY_KEY: ${{ secrets.CRON_SECURITY_KEY }}

- name: Turbo prebuild all deployable apps
run: |
pnpm turbo run build --filter=./apps/auth --filter=./apps/landing --filter=./apps/learn --filter=./apps/scout --filter=./apps/docs --filter=./apps/nitro-api
pnpm turbo run build --filter=./apps/auth --filter=./apps/landing --filter=./apps/learn --filter=./apps/scout --filter=./apps/docs --filter=./apps/nitro-api --filter=./apps/attendance

- name: List built artifacts
run: |
Expand All @@ -147,12 +155,13 @@ jobs:
ls -1 apps/scout/.next || true
ls -1 apps/docs/.next || true
ls -1 apps/nitro-api/.output || true
ls -1 apps/attendance/.next || true

- name: Package build artifacts
run: |
set -euo pipefail
mkdir -p dist-artifacts
for APP in auth landing learn scout docs; do
for APP in auth landing learn scout docs attendance; do
if [ -d "apps/$APP/.next" ]; then
(cd apps/$APP && tar -czf "../../dist-artifacts/next-${APP}${ARTIFACT_SUFFIX}.tgz" .next $( [ -f .env ] && echo .env ) $( [ -f .env.production ] && echo .env.production ))
echo "Packaged next-${APP}${ARTIFACT_SUFFIX}.tgz"
Expand Down Expand Up @@ -218,6 +227,14 @@ jobs:
if-no-files-found: error
retention-days: 3

- name: Upload artifact attendance
uses: actions/upload-artifact@v4
with:
name: next-attendance${{ env.ARTIFACT_SUFFIX }}
path: dist-artifacts/next-attendance${{ env.ARTIFACT_SUFFIX }}.tgz
if-no-files-found: error
retention-days: 3

build-next:
if: github.event.pull_request.base.ref != 'production' || github.event.pull_request.head.ref != 'staging'
name: Build Next.js images (prebuilt, no push)
Expand All @@ -232,6 +249,7 @@ jobs:
- app: learn
- app: scout
- app: docs
- app: attendance
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -263,7 +281,7 @@ jobs:
- name: Build image from prebuilt artifacts (no push)
run: |
IMAGE=ghcr.io/team293/${{ matrix.app }}
SHA_TAG=pr-${{ github.sha }}
SHA_TAG=pr-${{ github.sha }}
echo "Building $IMAGE:$SHA_TAG (no push)"
docker build \
--build-arg APP=${{ matrix.app }} \
Expand Down Expand Up @@ -323,7 +341,6 @@ jobs:
name: Summary
runs-on: ubuntu-latest
needs: [build-next, build-nitro]
if: always()
steps:
- name: Report
run: |
Expand Down
8 changes: 1 addition & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,4 @@ pnpm dev
```

## Contributing
We welcome contributions! Please follow these steps:

1. Fork the repository.
2. Create a new branch for your feature or bug
3. Make your changes and commit them with clear messages.
4. Push your changes to your fork.
5. Create a pull request against the `staging` branch of the original repository.
Please read our [contributing guidelines](CONTRIBUTING.md) before submitting a pull request.
46 changes: 46 additions & 0 deletions apps/attendance/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts

# OpenNext
/.open-next

# wrangler files
.wrangler
.dev.vars*
!.dev.vars.example
.env*
!.env.example
Loading