React + TypeScript frontend for the Virginia Tech AI Lecture Assistant. It provides a learning management interface with AI-powered Q&A, lecture notes, and Canvas LMS integration. Authentication is via Canvas OAuth only; the app talks to the Spring Boot backend (API gateway) for all data.
- Canvas OAuth only: Sign in with Canvas; no email/password login. The backend exchanges the OAuth code for tokens and issues JWTs. Redirect URI and OAuth server URL are configurable via environment variables.
- Landing (
/): Public marketing page (HokieLearn AI) with hero, features, about, and testimonials. Scroll-aware nav; redirects authenticated users to/homeor/profile. - Login (
/login): Single "Sign in with Canvas" button; redirects to Canvas OAuth. - OAuth callback (
/auth/callback): Handles redirect from Canvas; exchanges code via backend and redirects to/homeor/profileby role.
- Profile (
/profile): User info and academic context; course registration. - Home (
/home): Announcements and discussions (Piazza-style). - Chat (
/chat): AI Q&A with course-aware context; markdown, copy, typing indicators. - Lectures (
/lectures), Lecture notes (/lectures/:id/notes): Course materials, notes, and placeholders for quiz/recording. - FAQ (
/faq): Expandable Q&A with search and categories. - History (
/history): Student-only; past Q&A history. - Knowledge Base (
/knowledge-base): Instructor-only; syllabus, assignments, announcements, modules, vectorization status. - Analytics (
/analytics,/analytics/student/:studentId): Instructor-only; Q&A analytics and per-student detail. - Disputes (
/disputes): Instructor-only; Q&A dispute resolution. - Upload Transcript (
/instructor/upload): Instructor-only; transcript upload and processing.
- Virginia Tech branding (maroon/orange); responsive layout; sidebar nav with role-based items; Inter and DM Serif Display fonts; Tailwind-based design system with custom animations (e.g. rise, reveal, float).
- React 18 with hooks and functional components
- TypeScript
- React Router 6 for client-side routing
- Tailwind CSS for styling (custom theme: maroon, orange, VT gray)
- Lucide React and Heroicons for icons
- Inversify for dependency injection (repositories, presenters)
- Axios via
ApiService(JWT in memory, refresh via HTTP-only cookie) - Recharts for analytics charts
-
Install dependencies
npm install
-
Environment variables
Create a.envin the project root (or set in the shell). Required:REACT_APP_API_BASE_URL– Backend API base URL (e.g.http://localhost:3167/api). Required; app throws if missing.REACT_APP_API_TIMEOUT– Request timeout in ms (optional; default 60000).REACT_APP_OAUTH_SERVER_URL– Canvas OAuth server URL (e.g.https://canvas.vt.eduor mock server for dev).REACT_APP_OAUTH_CLIENT_ID– OAuth client ID.REACT_APP_OAUTH_REDIRECT_URI– OAuth redirect URI (e.g.http://localhost:3000/auth/callbackfor local dev).
-
Start development server
npm start
App runs at
http://localhost:3000by default.
npm start– Development server (port 3000).npm run build– Production build (output inbuild/).npm test– Run tests.npm run eject– Eject from Create React App (irreversible).
- VT Maroon:
#630031(vt-maroon); alsomaroon/maroon-dark/maroon-light. - VT Orange:
#FF6600(vt-orange); alsoorange/orange-dark/orange-light. - VT Gray:
#54585A(vt-gray); VT Light Gray:#F5F5F5(vt-light-gray).
- Sans: Inter (system fallback).
- Display: DM Serif Display (Georgia fallback); loaded from Google Fonts in
src/index.css.
fade-in,fade-in-delay,slide-up,slide-up-delayrise,rise-d1…rise-d5,reveal,reveal-d1,reveal-d2float,pulse-slow,slide-in-right
src/App.tsx– Route definitions;AuthProvider,CourseProvider, etc.src/pages/– Page components (Landing, Login, OAuthCallback, Home, Profile, Chat, etc.).src/components/– Layout, ProtectedRoute, modals, course/student UI.src/context/– AuthContext, CourseContext, UserProfileContext, CourseSelectionContext.src/config/oauth.ts– OAuth config andgetAuthorizationUrl().src/services/ApiService.ts– Axios instance, JWT attachment, refresh handling.src/repositories/– API layer (interfaces + implementations).src/presenters/– Business logic and repository orchestration.src/container.ts– Inversify container;presenterBindings.tswires presenters.src/models/index.ts– Shared TypeScript types and DTOs.tailwind.config.js– Theme (colors, fonts, animations).
- Add the component under
src/pages/. - Add the route in
src/App.tsx(public under<Routes>, or protected inside<Layout>with<ProtectedRoute>and optionalallow={["instructor"]}orallow={["student"]}). - If it should appear in the sidebar, extend the
navigationarray insrc/components/Layout.tsx(role-based logic is already there).
Multi-stage build: Node 18 Alpine for build, nginx Alpine for serving.
- Build:
docker build -t vt-ai-frontend . - Run: e.g.
docker run -p 80:80 vt-ai-frontend
Build args (defaults in Dockerfile): REACT_APP_API_BASE_URL, REACT_APP_API_TIMEOUT, REACT_APP_OAUTH_SERVER_URL, REACT_APP_OAUTH_CLIENT_ID, REACT_APP_OAUTH_REDIRECT_URI. Override with --build-arg when building for different environments.
- Run
npm run buildand deploy thebuild/directory to any static host (e.g. S3 + CloudFront, Netlify, Vercel). - Ensure
REACT_APP_*values are set at build time for the target environment; the backend URL and OAuth redirect URI must match the deployed frontend URL.
- Canvas OAuth for sign-in; backend stores and uses Canvas tokens for API calls.
- VT branding and terminology; role-based experience for students and instructors.
- Built for use with the VT AI Lecture Assistant backend and Canvas LMS.
Built with ❤️ for VT students by VT students