Web app for tracking ALEKS daily progress and running a coin-based reward system (student portal + multi-user admin).
git clone <repository-url>
cd aleks-coins-checker
npm install
npm run devRequires Node 18+ (see .nvmrc).
Minimum for local admin login (with Postgres):
ADMIN_PASSWORD="your-secure-bootstrap-pin"
ADMIN_SESSION_SECRET="generate-a-long-random-string"
POSTGRES_URL="postgres://..."Without Postgres, the student portal still runs on demo data; staff accounts need a database.
Full variable list (Resend, ALEKS sync tokens, GitHub PAT, etc.): see ENVIRONMENT_SETUP.md.
- Look up progress by student ID across exam periods
- Daily calendar, coin totals, and redemptions (assignment / quiz replacements)
- Override requests (reviewed topics or manual)
- Optional PII anonymization when enabled in admin settings
- Leaderboard and analytics views
- Staff accounts: username + PIN, roles (
professor|ta), session cookies - Profile: self-service display name and PIN changes
- Upload: manual Excel upload, or automated ALEKS sync (auto/manual modes)
- Periods: exam periods organized by semester, with dialog editing
- Requests: approve/reject redemptions and overrides; coin adjustments finalize on approve
- Overrides / coins: condensed lists; day overrides and coin adjustments
- Extras: leaderboard, email students, bug reports (Resend), settings (incl. PII hide)
Timestamps show in the viewer’s local timezone with a zone label.
GitHub Actions download ALEKS Time and Topic Excel reports and import them nightly. A second job verifies reviewed-topics overrides on each student’s Timeline (reviews are not in the Excel export).
| Workflow | Schedule | Purpose |
|---|---|---|
ALEKS daily sync |
~7 AM Central | Playwright → Excel → /api/admin/aleks-sync/import |
ALEKS review overrides |
~1 hour later | Auto-approve reviewed-topics when minutes ≥ 31 and topics ≥ 1 |
Admins can also trigger Excel sync from Admin → Upload → Pull from ALEKS now (needs GITHUB_SYNC_PAT).
Setup summary
- Generate a shared token:
openssl rand -hex 32 - Set
IMPORT_API_TOKENon Vercel and as a GitHub Actions secret - Add GitHub secrets:
ALEKS_USERNAME,ALEKS_PASSWORD,APP_URL,IMPORT_API_TOKEN - Optional:
GITHUB_SYNC_PAT+GITHUB_REPOfor the admin pull button
Details, local Playwright testing, and troubleshooting: scripts/aleks-sync/README.md.
| Layer | Stack |
|---|---|
| App | Next.js 14 (App Router), TypeScript, Tailwind, Radix UI |
| Data | PostgreSQL (Neon recommended; Vercel Postgres is deprecated) |
| Charts / Excel | D3.js, SheetJS (xlsx) |
| Automation | Playwright + GitHub Actions |
app/
├── page.tsx # Student portal
├── analytics/ # Class analytics
├── admin/ # Dashboard, upload, requests, periods, staff, …
└── api/
├── student/ # Lookup, requests, leaderboard
├── admin/ # Auth, upload, periods, ALEKS sync, …
├── analytics/
└── bug-report/
components/ # Calendar, redemption modal, charts, UI
lib/ # Auth, Excel helpers, periods, caching
scripts/aleks-sync/ # Playwright sync + review verification
.github/workflows/ # Nightly ALEKS jobs
Tables are created with CREATE TABLE IF NOT EXISTS on use. Core ones:
| Table | Role |
|---|---|
student_data |
Uploaded/synced Excel payloads (JSONB) per period/section |
student_requests |
Redemptions + override requests |
admin_users |
Staff accounts (hashed PIN, role) |
coin_adjustments |
Manual / redemption-linked adjustments (is_active soft-delete) |
student_day_overrides |
Per-student day force qualify/disqualify |
exam_periods |
Period keys, date ranges, excluded dates |
See older schema snippets in git history if you need full DDL; runtime migrations live next to the API routes that need them.
Per period:
- Base coins = qualified working days (minutes ≥ 31 and topics ≥ 1)
- Plus exempt-day credits when an excluded day would have qualified (also counts toward extra credit %)
- Plus coins-only exempt credits when a coins-only exempt day would have qualified (coin only — does not count toward extra credit %)
- Plus/minus active
coin_adjustmentsfor that period
Total coins = sum across periods. Approved day overrides rewrite qualification before totals.
- Staff sign in with username + PIN. Sessions are httpOnly cookies signed with
ADMIN_SESSION_SECRET. - First professor account is bootstrapped from
ADMIN_PASSWORD(usernameadmin) whenadmin_usersis empty. - Professors manage TAs under Admin → Staff.
- Students look up by ID only (no login); enable PII hide in settings for demos/screenshares.
- ALEKS import endpoints require
IMPORT_API_TOKEN— not an ALEKS credential.
Deploy on Vercel (this repo is linked as project student-points-website).
# Required on Vercel
vercel env add ADMIN_PASSWORD
vercel env add ADMIN_SESSION_SECRET
vercel env add POSTGRES_URL
# For ALEKS sync
vercel env add IMPORT_API_TOKEN
# optional: GITHUB_SYNC_PAT, GITHUB_REPO, APP_URL, RESEND_API_KEY, …Prefer Neon for Postgres (setup notes).
Vercel posts deployment records to GitHub Environments. Stale environments from old project links can be removed in Settings → Environments, or via API:
gh api -X DELETE "repos/OWNER/REPO/environments/ENVIRONMENT_NAME"Deleting an environment removes its deployment history there. Active Vercel production usually appears as Production – <vercel-project-name>.
| Doc | Contents |
|---|---|
ENVIRONMENT_SETUP.md |
Env vars, Neon, troubleshooting login |
scripts/aleks-sync/README.md |
Playwright sync, review verification, secrets |
Private and proprietary. All rights reserved.