Skip to content

Latest commit

Β 

History

History
137 lines (110 loc) Β· 4.26 KB

File metadata and controls

137 lines (110 loc) Β· 4.26 KB

Clario β€” Campus Peer Learning Platform

A full-stack React + Firebase peer tutoring platform where students book live 1-on-1 video sessions with fellow students who've mastered the skills they're learning.


πŸš€ Getting Started

1. Clone & install

git clone <your-repo>
cd clario
npm install

2. Set up Firebase

  1. Create a project at console.firebase.google.com
  2. Enable Authentication β†’ Email/Password
  3. Enable Cloud Firestore
  4. Copy .env.example β†’ .env.local and fill in your project credentials
cp .env.example .env.local
# Edit .env.local with your Firebase values

3. Deploy Firestore security rules

npm install -g firebase-tools
firebase login
firebase deploy --only firestore:rules

4. Run dev server

npm run dev

5. Build for production

npm run build

πŸ“ Project Structure

src/
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ AppShell.jsx      # Shared UI components (Card, Button, Modal…)
β”‚   β”œβ”€β”€ Layout.jsx        # Authenticated app shell with sidebar
β”‚   β”œβ”€β”€ Sidebar.jsx       # Desktop sidebar + mobile drawer + bottom nav
β”‚   β”œβ”€β”€ SkillMap.jsx      # 3D interactive skill visualization (Three.js)
β”‚   └── WebRTCCall.jsx    # Peer-to-peer video call via WebRTC + Firestore
β”œβ”€β”€ context/
β”‚   └── ToastContext.jsx  # Global toast notification system
β”œβ”€β”€ pages/
β”‚   β”œβ”€β”€ Landing.jsx           # Public marketing page
β”‚   β”œβ”€β”€ Login.jsx             # Sign in + forgot password
β”‚   β”œβ”€β”€ Register.jsx          # Sign up with role selection
β”‚   β”œβ”€β”€ StudentDashboard.jsx  # Student home
β”‚   β”œβ”€β”€ TutorDashboard.jsx    # Tutor home with stats
β”‚   β”œβ”€β”€ FindSkills.jsx        # Browse & search tutors
β”‚   β”œβ”€β”€ TutorProfile.jsx      # Public tutor profile + booking form
β”‚   β”œβ”€β”€ TutorProfileEditor.jsx# Tutor edit skills, bio, rates
β”‚   β”œβ”€β”€ TutorRequests.jsx     # Incoming session requests
β”‚   β”œβ”€β”€ MySessions.jsx        # Session history with filters
β”‚   β”œβ”€β”€ SessionLobby.jsx      # Pre-session waiting room
β”‚   β”œβ”€β”€ SessionRoom.jsx       # Live video room with timer + notes
β”‚   β”œβ”€β”€ SessionComplete.jsx   # Post-session summary
β”‚   β”œβ”€β”€ RateSession.jsx       # Star rating + written review
β”‚   β”œβ”€β”€ Settings.jsx          # Full account management
β”‚   └── NotFound.jsx          # 404 page
β”œβ”€β”€ services/
β”‚   β”œβ”€β”€ authService.js    # Firebase Auth (register, login, reset, delete)
β”‚   β”œβ”€β”€ firebase.js       # Firebase app init (reads from .env.local)
β”‚   β”œβ”€β”€ sessionService.js # Session CRUD + real-time subscriptions
β”‚   β”œβ”€β”€ userService.js    # User profile read/write
β”‚   └── ratingService.js  # Ratings + aggregated averages
└── utils/
    └── skills.js         # Skill list, timing options, normalizers

πŸ”’ Security Checklist

  • Firebase credentials stored in .env.local (not committed)
  • .gitignore excludes all .env* files
  • Firestore rules: users can only read/write their own data
  • Sessions readable only by participants (participantIds array)
  • Ratings writable only by the authenticated rater
  • Tutor email addresses never exposed in UI
  • Account deletion requires password re-authentication

πŸ“± Mobile

  • Responsive breakpoint at 768px
  • Desktop: fixed sidebar (256px)
  • Mobile: hamburger β†’ slide-in drawer + bottom navigation bar
  • Touch-safe WebRTC video grid
  • touchAction: none on 3D SkillMap canvas

🎨 Design System

All design tokens are in src/index.css as CSS custom properties:

Token Value Use
--navy #060d1b Page background
--cyan #00e5ff Primary accent
--teal #3fe0c5 Success / completed
--coral #ff6b6b Danger / pending
--violet #7c6fff Secondary accent

πŸ”§ Deployment

Firebase Hosting

firebase init hosting
# Set public dir to: dist
# Configure as SPA: yes
npm run build
firebase deploy

Vercel / Netlify

Point build command to npm run build, output dir to dist. Add a rewrite rule: /* β†’ /index.html.

Created with πŸ’— for Students by Students.