Skip to content

Rezwan66/skillbridge-frontend

Repository files navigation

SkillBridge Frontend πŸŽ“

SkillBridge is a full-stack tutoring platform where students can discover expert tutors, book lesson slots, and pay securely via Stripe. This repository contains the Next.js frontend powering the user interface.

πŸ”— Live Site: https://skillbridge-frontend-plum.vercel.app πŸ”— Backend Repo: skillbridge-backend


πŸ› οΈ Tech Stack

Layer Technology
Framework Next.js 16 (App Router)
Language TypeScript
Styling Tailwind CSS v4
UI Components shadcn/ui (Radix UI primitives)
Forms TanStack React Form + Zod v4 validation
Authentication Better Auth (client SDK with session cookies)
State/Fetching Next.js Server Actions + Server Components
Animations Framer Motion
Smooth Scroll Lenis
Charts Recharts (Bar + Area charts)
Notifications Sonner (toasts) + SweetAlert2 (modals)
Carousel Embla Carousel
Theming next-themes (one-click light/dark toggle)
Runtime Bun
Deployment Vercel

πŸ“Έ Screenshots

Homepage

Homepage

Student Dashboard

Student Dashboard


✨ Key Features

  • Public Tutor Discovery β€” Browse, search, and filter tutors by name, category, rating, and hourly rate with a sticky sidebar filter panel.
  • Rich Tutor Detail Pages β€” Full tutor profile with cover image, skills/tags, availability schedule, reviews, and a "Related Tutors" recommendation section.
  • Role-Based Dashboards β€” Three parallel dashboard layouts using Next.js parallel routes: @student, @tutor, and @admin, each with tailored views.
  • Analytics Charts β€” Visual dashboard statistics using Recharts AreaCharts and BarCharts, populated from live /stats backend endpoints.
  • Booking System β€” Students browse tutor availability and book time slots with confirmation modals and real-time status updates.
  • Stripe Checkout β€” Seamless payment flow with redirect to Stripe Checkout (EUR) and a dedicated payment success page with transaction details.
  • Edge Middleware Auth β€” Server-side route protection that validates sessions and enforces role-based access before pages load.
  • Redirect Chain Preservation β€” Login/Register flows preserve the user's intended destination across authentication steps (including the register β†’ login β†’ destination chain).
  • Demo Login Buttons β€” One-click credential fill for Student, Tutor, and Admin demo accounts on the login page.
  • Dynamic Subjects Navbar β€” The "Subjects" dropdown in the navbar is populated dynamically from the categories API at render time, linking directly to filtered tutor listings.
  • Floating AI Chatbot (Bridget) β€” A premium floating chatbot widget visible on all public and dashboard pages, ready for OpenRouter AI integration.
  • Dark / Light Mode β€” Full one-click theme toggle powered by next-themes and the ModeToggle component.
  • Responsive Design β€” Fully responsive layout with a collapsible sidebar, mobile sheet navigation, and adaptive grid layouts.
  • Micro-Animations β€” Premium hover effects on tutor cards (lift + image zoom), smooth transitions, and interactive filter states powered by Framer Motion.
  • Dynamic Avatars β€” Integrates the DiceBear API to automatically generate unique, deterministic, and highly colorful vector avatars for students and tutors who do not upload a custom profile picture.
  • About & Contact Pages β€” Fully designed pages with core values, team section, contact form, and support information.

πŸ“ Project Structure

src/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ (auth)/                 # Login & Register pages
β”‚   β”‚   β”œβ”€β”€ login/
β”‚   β”‚   └── register/
β”‚   β”œβ”€β”€ (public)/               # Public pages (homepage, tutors, tutor details)
β”‚   β”‚   β”œβ”€β”€ page.tsx            # Homepage (8-section landing page)
β”‚   β”‚   β”œβ”€β”€ about/              # About Us page
β”‚   β”‚   β”œβ”€β”€ contact/            # Contact page
β”‚   β”‚   └── tutors/
β”‚   β”œβ”€β”€ (dashboard)/            # Protected dashboard (parallel routes)
β”‚   β”‚   β”œβ”€β”€ @admin/             # Admin dashboard views
β”‚   β”‚   β”œβ”€β”€ @student/           # Student dashboard views
β”‚   β”‚   β”œβ”€β”€ @tutor/             # Tutor dashboard views
β”‚   β”‚   └── layout.tsx          # Shared sidebar layout
β”‚   β”œβ”€β”€ globals.css
β”‚   β”œβ”€β”€ layout.tsx              # Root layout (fonts, providers, metadata)
β”‚   └── not-found.tsx           # Custom 404 page
β”œβ”€β”€ actions/                    # Next.js Server Actions
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ layout/                 # App sidebar, navbar, footer, mode toggle, FloatingChat
β”‚   β”œβ”€β”€ modules/                # Feature-specific components
β”‚   β”‚   β”œβ”€β”€ authentication/     # Login/Register forms (with demo login buttons)
β”‚   β”‚   β”œβ”€β”€ dashboard/          # Dashboard components (per-role, with charts)
β”‚   β”‚   β”œβ”€β”€ home/               # Homepage sections (hero, stats, categories, tutors, etc.)
β”‚   β”‚   β”œβ”€β”€ shared/             # Shared components (profile card, logo)
β”‚   β”‚   └── tutors/             # Tutor cards, filters, grid, detail page
β”‚   └── ui/                     # shadcn/ui primitives
β”œβ”€β”€ constants/                  # Role enums, booking statuses
β”œβ”€β”€ hooks/                      # Custom React hooks
β”œβ”€β”€ lib/                        # Auth client, utilities
β”œβ”€β”€ middleware.ts               # Edge middleware (route protection)
β”œβ”€β”€ providers/                  # Theme & context providers
β”œβ”€β”€ routes/                     # Role-based route definitions
β”œβ”€β”€ services/                   # API service layer (tutor, booking, payment, etc.)
└── types/                      # TypeScript type definitions

πŸ—ΊοΈ Page Routes

Public Routes

Route Description
/ Homepage with 8 sections (Hero, Stats, Features...)
/tutors Tutor directory with search, filters, and pagination
/tutors/:id Individual tutor profile with availability & reviews
/about About Us page with values and team
/contact Contact page with form
/login User login (with demo credential buttons)
/register User registration

Protected Dashboard Routes

Route Role Description
/dashboard All Role-specific overview with charts
/dashboard/profile All Edit user profile
/dashboard/bookings All View bookings (role-filtered)
/dashboard/create-booking Student Book a tutor's availability slot
/dashboard/payment/payment-success Student Post-payment confirmation page
/dashboard/tutor-profile Tutor Manage tutor profile
/dashboard/teaching-categories Tutor Manage teaching categories
/dashboard/availability Tutor Create/delete availability slots
/dashboard/manage-tutors Admin Manage all tutors on the platform
/dashboard/manage-users Admin Manage all users (ban, role change)
/dashboard/manage-categories Admin CRUD for teaching categories

πŸ€– AI Chatbot β€” Bridget

A floating AI assistant widget (FloatingChat.tsx) is embedded in both the public and dashboard layouts. It features:

  • Animated open/close FAB button with pulse ring
  • Typing indicator (bouncing dots)
  • Suggested quick-reply questions on first open
  • Unread message badge when closed
  • Context-aware mock responses for tutors, subjects, booking, and pricing questions
  • Ready for OpenRouter AI integration β€” replace the getMockResponse() function with a live API call

βœ… Getting Started

Prerequisites

1. Clone & Install

git clone https://github.com/Rezwan66/skillbridge-frontend.git
cd skillbridge-frontend
npm install

2. Configure Environment Variables

Create a .env file in the project root:

# BACKEND_URL=https://skillbridge-backend-phi.vercel.app
BACKEND_URL=http://localhost:5000
FRONTEND_URL=http://localhost:3000

# NEXT_PUBLIC_BACKEND=https://skillbridge-backend-phi.vercel.app
NEXT_PUBLIC_BACKEND=http://localhost:5000
NEXT_PUBLIC_FRONTEND=http://localhost:3000

# API_URL=https://skillbridge-backend-phi.vercel.app
API_URL=http://localhost:5000
# AUTH_URL=https://skillbridge-backend-phi.vercel.app/api/auth
AUTH_URL=http://localhost:5000/api/auth

NEXT_PUBLIC_BACKEND_URL=http://localhost:5000
# NEXT_PUBLIC_BACKEND_URL=https://skillbridge-backend-phi.vercel.app

3. Run the Development Server

npm run dev

The app will start at http://localhost:3000.


πŸ§ͺ Useful Commands

Command Description
npm run dev Start development server with hot reload
npm run build Build for production
npm run start Start production server
npm run lint Run ESLint

πŸ” Authentication Flow

  1. Users register with name, email, password, and role (Student or Tutor).
  2. Login creates a session cookie via Better Auth.
  3. Demo Login buttons on the login page auto-fill credentials for Student, Tutor, and Admin roles.
  4. Edge Middleware intercepts all /dashboard/* routes, validates the session against the backend, and enforces role-based access.
  5. Protected route redirects preserve the intended destination through ?redirectPath= query parameters β€” even across the Register β†’ Login chain.

πŸš€ Deployment

Deploy to Vercel with zero configuration:

  1. Push to GitHub
  2. Import into Vercel
  3. Set environment variables (point API_URL and AUTH_URL to your deployed backend)
  4. Deploy

Check out the Next.js deployment docs for more details.


πŸ› οΈ Tech Stack

Layer Technology
Framework Next.js 16 (App Router)
Language TypeScript
Styling Tailwind CSS v4
UI Components shadcn/ui (Radix UI primitives)
Forms TanStack React Form + Zod v4 validation
Authentication Better Auth (client SDK with session cookies)
State/Fetching Next.js Server Actions + Server Components
Notifications Sonner (toasts) + SweetAlert2 (modals)
Carousel Embla Carousel
Theming next-themes (light/dark mode)
Runtime Bun
Deployment Vercel

πŸ“Έ Screenshots

Homepage

Homepage

Student Dashboard

Student Dashboard


✨ Key Features

  • Public Tutor Discovery β€” Browse, search, and filter tutors by name, category, rating, and hourly rate with a sticky sidebar filter panel.
  • Role-Based Dashboards β€” Three parallel dashboard layouts using Next.js parallel routes: @student, @tutor, and @admin, each with tailored views.
  • Booking System β€” Students browse tutor availability and book time slots with confirmation modals and real-time status updates.
  • Stripe Checkout β€” Seamless payment flow with redirect to Stripe Checkout (EUR) and a dedicated payment success page with transaction details.
  • Edge Middleware Auth β€” Server-side route protection that validates sessions and enforces role-based access before pages load.
  • Redirect Chain Preservation β€” Login/Register flows preserve the user's intended destination across authentication steps (including the register β†’ login β†’ destination chain).
  • Dark Mode β€” Full light/dark theme toggle powered by next-themes.
  • Responsive Design β€” Fully responsive layout with a collapsible sidebar, mobile sheet navigation, and adaptive grid layouts.
  • Micro-Animations β€” Premium hover effects on tutor cards (lift + image zoom), smooth transitions, and interactive filter states.
  • Dynamic Avatars β€” Integrates the DiceBear API to automatically generate unique, deterministic, and highly colorful vector avatars for students and tutors who do not upload a custom profile picture.

πŸ“ Project Structure

src/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ (auth)/                 # Login & Register pages
β”‚   β”‚   β”œβ”€β”€ login/
β”‚   β”‚   └── register/
β”‚   β”œβ”€β”€ (public)/               # Public pages (homepage, tutors, tutor details)
β”‚   β”‚   β”œβ”€β”€ page.tsx            # Homepage
β”‚   β”‚   └── tutors/
β”‚   β”œβ”€β”€ (dashboard)/            # Protected dashboard (parallel routes)
β”‚   β”‚   β”œβ”€β”€ @admin/             # Admin dashboard views
β”‚   β”‚   β”œβ”€β”€ @student/           # Student dashboard views
β”‚   β”‚   β”œβ”€β”€ @tutor/             # Tutor dashboard views
β”‚   β”‚   └── layout.tsx          # Shared sidebar layout
β”‚   β”œβ”€β”€ globals.css
β”‚   β”œβ”€β”€ layout.tsx              # Root layout (fonts, providers, metadata)
β”‚   └── not-found.tsx           # Custom 404 page
β”œβ”€β”€ actions/                    # Next.js Server Actions
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ layout/                 # App sidebar, navbar, footer, mode toggle
β”‚   β”œβ”€β”€ modules/                # Feature-specific components
β”‚   β”‚   β”œβ”€β”€ authentication/     # Login/Register forms
β”‚   β”‚   β”œβ”€β”€ dashboard/          # Dashboard components (per-role)
β”‚   β”‚   β”œβ”€β”€ home/               # Homepage sections (hero, featured, marquee)
β”‚   β”‚   β”œβ”€β”€ shared/             # Shared components (profile card, logo)
β”‚   β”‚   └── tutors/             # Tutor cards, filters, grid
β”‚   └── ui/                     # shadcn/ui primitives
β”œβ”€β”€ constants/                  # Role enums, booking statuses
β”œβ”€β”€ hooks/                      # Custom React hooks
β”œβ”€β”€ lib/                        # Auth client, utilities
β”œβ”€β”€ middleware.ts               # Edge middleware (route protection)
β”œβ”€β”€ providers/                  # Theme & context providers
β”œβ”€β”€ routes/                     # Role-based route definitions
β”œβ”€β”€ services/                   # API service layer (tutor, booking, payment, etc.)
└── types/                      # TypeScript type definitions

πŸ—ΊοΈ Page Routes

Public Routes

Route Description
/ Homepage with featured tutors and testimonials
/tutors Tutor directory with search and filters
/tutors/:id Individual tutor profile with availabilities
/login User login
/register User registration

Protected Dashboard Routes

Route Role Description
/dashboard All Role-specific overview
/dashboard/edit-profile All Edit user profile
/dashboard/bookings All View bookings (role-filtered)
/dashboard/create-booking Student Book a tutor's availability slot
/dashboard/payment/payment-success Student Post-payment confirmation page
/dashboard/tutor-profile Tutor Manage tutor profile
/dashboard/teaching-categories Tutor Manage teaching categories
/dashboard/availability Tutor Create/delete availability slots
/dashboard/manage-tutors Admin Manage all tutors on the platform
/dashboard/manage-users Admin Manage all users (ban, role change)
/dashboard/manage-categories Admin CRUD for teaching categories

βœ… Getting Started

Prerequisites

1. Clone & Install

git clone https://github.com/Rezwan66/skillbridge-frontend.git
cd skillbridge-frontend
npm install

2. Configure Environment Variables

Create a .env file in the project root:

# BACKEND_URL=https://skillbridge-backend-phi.vercel.app
BACKEND_URL=http://localhost:5000
FRONTEND_URL=http://localhost:3000

# NEXT_PUBLIC_BACKEND=https://skillbridge-backend-phi.vercel.app
NEXT_PUBLIC_BACKEND=http://localhost:5000
NEXT_PUBLIC_FRONTEND=http://localhost:3000

# API_URL=https://skillbridge-backend-phi.vercel.app
API_URL=http://localhost:5000
# AUTH_URL=https://skillbridge-backend-phi.vercel.app/api/auth
AUTH_URL=http://localhost:5000/api/auth

NEXT_PUBLIC_BACKEND_URL=http://localhost:5000
# NEXT_PUBLIC_BACKEND_URL=https://skillbridge-backend-phi.vercel.app

3. Run the Development Server

npm run dev

The app will start at http://localhost:3000.


πŸ§ͺ Useful Commands

Command Description
npm run dev Start development server with hot reload
npm run build Build for production
npm run start Start production server
npm run lint Run ESLint

πŸ” Authentication Flow

  1. Users register with name, email, password, and role (Student or Tutor).
  2. Login creates a session cookie via Better Auth.
  3. Edge Middleware intercepts all /dashboard/* routes, validates the session against the backend, and enforces role-based access.
  4. Protected route redirects preserve the intended destination through ?redirectPath= query parameters β€” even across the Register β†’ Login chain.

πŸš€ Deployment

Deploy to Vercel with zero configuration:

  1. Push to GitHub
  2. Import into Vercel
  3. Set environment variables (point API_URL and AUTH_URL to your deployed backend)
  4. Deploy

Check out the Next.js deployment docs for more details.

About

Nextjs Frontend for Skillbridge Learning Platform

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors