Skip to content

Repository files navigation

BetterEd

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.


Backend Status

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.


Tech Stack

  • Next.js (App Router) + Tailwind CSS
  • Firebase Auth — Google sign-in, gated to .edu addresses
  • Firestore — real-time session feed, user profiles, course data

Project Structure

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';

Setup

1. Clone and install

git clone <repo-url>
cd bettered
npm install

2. Add Firebase credentials

Create .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_id

Never 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.

3. Run locally

npm run dev

Open http://localhost:3000.

4. Deploy Firestore rules (once, or when rules change)

firebase deploy --only firestore:rules

What's Left to Build

Discussion 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.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages