Running the platform
Video (0:56, Indonesian narration): the admin tools on sigro.id. More in 10 Video guides.
Roles
| Role | Can | How someone gets it |
|---|---|---|
| Learner | Take courses, track progress, buy a Learning Pass, register for workshops, link Discord | Signing up |
| Creator | Everything in /creator: courses, blog, workshops, manual Learning Pass grants | LEARNING_CONTENT_ADMIN_EMAILS, or Admin → Users → role Creator |
| Admin | Creator rights + /admin: users, roles, course announcements, member emails, Discord | PLATFORM_ADMIN_EMAILS (bootstrap admins, cannot be demoted in the UI), or Admin → Users → role Admin |
Roles are checked on the server against the current verified email in Clerk, so changing an email in Clerk changes what the person can do.
Admin pages
| Page | Use it to |
|---|---|
/admin/users | Search accounts, see Learning Pass status, change roles, stop or restore someone’s access |
/creator/learning-pass | Grant a Learning Pass without payment (scholarships, staff, partners), optionally with an invitation email |
/admin/course-announcements | See and control “new course” emails sent when a course is first published |
/admin/member-messages | Email all active Learning Pass holders (test send first; learners can opt out in their profile) |
/admin/discord | Check the Discord bot setup and the members whose role is synced |
Payments in practice
- A learner pays through Midtrans’ page (cards, bank transfer, e-wallets, QRIS, depending on your Midtrans account).
- Midtrans calls
/api/payments/midtrans/notifications; the server checks the signature and asks Midtrans for the live status before marking anything paid, so a forged or replayed notification can’t unlock access. - If a notification never arrives, a background job re-checks unfinished payments every
PAYMENT_RECONCILE_INTERVAL_MINUTES(default 10). - With email configured, the buyer gets a confirmation and creators get a “paid workshop registration” notice.
- Refunds are made in the Midtrans dashboard. When Midtrans reports a refund or chargeback the payment is marked failed; check the buyer in Admin → Users afterwards.
Background jobs
The API process runs these on timers; they need the API to stay up (Replit Reserved VM, or an always-on server):
| Job | What it does |
|---|---|
| Payment reconciliation | Re-checks pending payments with Midtrans; sends pending confirmation emails |
| Webinar reminders | Emails registered users before a webinar starts |
| Course announcements | Sends “new course” emails in batches |
| Member messages | Sends admin emails to pass holders in batches, with retries |
| Discord sync | Gives / removes the member role as Learning Pass status changes (production only) |
| Resource cleanup | Removes uploads that were started but never finished |
Backups
Everything that matters is in PostgreSQL (accounts, progress, courses, payments) plus uploaded files in App Storage.
- Replit: use the database’s point-in-time restore / backups, and export regularly:
pg_dump "$DATABASE_URL" > backup-$(date +%F).sql - Own server: a nightly
pg_dumpto another machine (see 08).
Clerk keeps the sign-in accounts; the local users table links to them by Clerk ID.
Updating the template
If you created your repo from the template, pull improvements by adding the template as a second remote:
git remote add template https://github.com/firmanhadi21/online-course-template.git
git fetch template
git merge template/main # resolve conflicts, usually only in site.config.ts and your locale edits
pnpm install && pnpm db:push && pnpm check