GSTU Go Documentation
Everything students, CRs, faculty, and maintainers need: campus features, role isolation, Cloudflare Pages & custom domain DNS setup, and our zero-Blaze 6-digit Email OTP authentication worker.
1. Campus Architecture & Role Isolation
GSTU Go isolates academic data by department and batch so every user sees only what belongs to them:
StudentDepartment & batch-isolated timetable, results, question bank, PDF library, personal calendar & AI Assistant.
Class Representative (CR)Post departmental notices, manage batch routine updates/cancellations, and upload batch materials.
Teacher & ChairmanDepartment teachers group chat, global faculty group, plus Chairman-only inter-department coordination group.
Office StaffSame-department academic notices, calendar exceptions, and CSV routine upload/restoration.
Blood Bank AdminExplicitly appointed middleman workflow protecting patient phone numbers behind pending review & verified donor matching.
Bus Driver & Club AdminLive GPS shuttle broadcasting and club member events/chat management.
2. Core Features Guide
- My Calendar & Today's Highlights: Interactive monthly/weekly calendar with color-coded Holidays, Campus Events, To-Do tasks, and live
Day X of Yexam/suspension progress. - AI Assistant: Context-aware study companion reading your real Room timetable, personal tasks, scoped library files, and notices—with Clear for Today, Bangla/English toggle, and one-tap task saving.
- Notices & Tree Cascade: Shows the latest 15 days of Central + Departmental notices fast, with a See More button for archives and automatic syncing to My Calendar.
- PDF Library & Question Bank: Fast cached "Recently Uploaded" strip, per-course uploads inside course folders, and strict separation between regular lectures and Question Bank papers.
3. Cloudflare Domain, Pages & Resend DNS Setup
Host the documentation site at https://gstugo.study and power transactional OTP emails without upgrading Firebase to Blaze:
A. Deploy Website on Cloudflare Pages
- In Cloudflare Dashboard → Workers & Pages → Create → Pages → Connect to Git (or Direct Upload).
- Set Build output directory to
website(no build command needed). - Under Custom domains, add
gstugo.studyandwww.gstugo.study. Cloudflare automatically creates proxied CNAME records and provisions free SSL.
B. Verify Domain in Resend (for 6-Digit Email OTP)
- Create a free account on Resend → Domains → Add Domain → enter
gstugo.study(ormail.gstugo.study). - Copy the SPF (TXT/MX), DKIM (TXT), and optional DMARC (TXT) records from Resend into Cloudflare → DNS → Records.
- Keep Resend DNS records set to DNS only (Grey Cloud)—do not proxy MX/DKIM records. Wait until Resend shows Verified.
4. Cloudflare Worker Email OTP & Firebase Custom Tokens (No OAuth)
Because Firebase Magic Links expire quickly and often land in spam, cloudflare-worker/ handles 6-digit OTP verification using Cloudflare KV, Resend, and RS256 Firebase Custom Tokens:
Step 1: Create KV & Secrets
cd cloudflare-worker npx wrangler kv namespace create OTP_STORE # Paste the returned id into wrangler.toml under [[kv_namespaces]] npx wrangler secret put RESEND_API_KEY npx wrangler secret put FIREBASE_SERVICE_ACCOUNT_JSON npx wrangler deploy
Step 2: Worker Endpoints
POST /auth/send-otp— Validates email, enforces KV rate-limits (60s cooldown, 5/15m per email, 15/15m per IP), stores SHA-256 hash with 300s TTL, and sends code via Resend.POST /auth/verify-otp— Verifies 6-digit code (max 5 attempts), looks up any existing Firebase AuthlocalIdvia Identity Toolkit so existing users never lose their account, ensuresemailVerified: true, and returns a signed 1-hour FirebasecustomToken.POST /auth/verify-registration-otp— Authenticated endpoint allowing newly registered users in Step 3 to verify their email via 6-digit OTP without relying on Magic Links.
Optional Custom Route
Attach auth.gstugo.study/* or api.gstugo.study/* to gstu-go-proxy in Cloudflare → Workers Routes and set PROXY_WORKER_URL in local.properties.
5. Common Setup Checks
- Custom Token & Firestore Rules: Ensure the Worker attaches
{ email, email_verified: true }in Custom Token claims and calls Identity Toolkitaccounts:updatesorequest.auth.token.email_verified == truepassesfirestore.rules. - Email Delivery: If OTP emails go to Spam, confirm Resend DKIM + SPF records are Grey Cloud in Cloudflare DNS and verified in Resend.
- Support: Contact support@gstugo.study for campus admin or domain configuration assistance.
GSTU Go