Student collaboration platform for university courses. The primary feature is a course-based discussion forum where students can ask questions, share resources, and collaborate. A real-time session board (post where you're studying, join others) is a secondary feature. Built for university students: .edu emails only.
Firebase logic lives in src/lib/. Status per module:
| Module | Status | Notes |
|---|---|---|
| Auth | ✅ Complete | Google sign-in, .edu enforcement, auth state listener |
| Sessions | ✅ Complete | Create, join, expire, real-time listener for active sessions |
| Users | ✅ Complete | Profile creation on first sign-in, course enrollment |
| Courses | ✅ Complete | Create courses, fetch course data, check collaboration policy |
| Honor Code | Scaffolded, needs keyword refinement | Syllabus keyword scan → blocks posting if collaboration not allowed |
| Discussions | ✅ Complete | Core CRUD done — search/filter utilities still TODO |
| Firestore rules | ✅ Complete | Covers users, sessions, courses, discussions |
Backend is complete and functional as of Milestone 1 (May 8). All Firebase logic is in src/lib/ and ready to wire into UI. Next phase: frontend pages.
- Next.js (App Router) + Tailwind CSS
- Firebase Auth — Google sign-in, gated to
.eduaddresses - Firestore — real-time session feed, user profiles, course data
src/lib/
firebase.ts # Firebase app init — do not import directly in UI
auth.ts # signInWithGoogle, signOut, onAuthChange
sessions.ts # createSession, joinSession, expireSession,
# getActiveSessions, listenToActiveSessions
users.ts # createUserProfile, getUserProfile, addCourseToUser
courses.ts # createCourse, getCourse, checkCollaborationAllowed
honorCode.ts # parseSyllabusForCollaboration
discussions.ts # createDiscussion, getDiscussionsByClass,
# replyToDiscussion, listenToDiscussions, getDiscussionDetail
app/
page.tsx # Discussion board landing (search, filter tabs, thread list)
sessions/page.tsx # Sessions feed + post a session form
discussions/
new/page.tsx # Create discussion form
firestore.rules # Firestore security rules
Import backend functions directly from src/lib/ — never touch Firebase SDK calls in UI components:
import { createSession, listenToActiveSessions } from '@/lib/sessions';
import { signInWithGoogle, onAuthChange } from '@/lib/auth';
import { checkCollaborationAllowed } from '@/lib/courses';git clone <repo-url>
cd bettered
npm installCreate .env.local in the project root with your Firebase project values:
NEXT_PUBLIC_FIREBASE_API_KEY=your_api_key
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your_project_id
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your_project.appspot.com
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
NEXT_PUBLIC_FIREBASE_APP_ID=your_app_idNever commit
.env.local. It is already in.gitignore. If you need the values, ask a teammate — do not paste them into the repo.
To get these values: Firebase Console → your project → Project Settings → Web app → SDK setup and configuration.
npm run devOpen http://localhost:3000.
firebase deploy --only firestore:rulesDiscussion forum (primary):
- ✅ Discussion board landing — thread list, search bar, filter tabs (built, wired to mock data — needs Firestore)
- ✅ Create discussion form — UI complete, needs honor code check + Firestore submit
- Discussion detail page — full thread, reply list, reply form
- Wire discussion board to Firestore via listenToDiscussions
Sessions (secondary):
- ✅ Sessions page — post form + live feed built and wired to Firestore
- Wire Join button to joinSession (button exists, not connected)
User:
- User profile page — display name, school, enrolled courses; add/remove courses
All data logic lives in src/lib/. Pages should import from there and focus on rendering and user interaction only.