Skip to content

durdana3105/peer-learning

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1,597 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Peer Learning Platform

Peer Learning Banner

A modern peer-to-peer learning platform where students can connect, collaborate, share knowledge, and grow together through interactive learning sessions, real-time messaging, AI assistance, and community engagement.


React TypeScript Tailwind CSS Supabase PostgreSQL License


Table of Contents


Features

Authentication System

  • Secure Signup & Login
  • Protected Routes
  • User Session Management

User Profiles

  • Personalized User Profiles
  • Skills & Interests Showcase
  • Learning Preferences

Peer Discovery

  • Find peers based on skills
  • Connect with learners worldwide
  • Smart matching system

Learning Sessions

  • Create study sessions
  • Join collaborative learning groups
  • Interactive peer discussions

Real-Time Chat

  • Instant messaging system
  • Community interaction
  • Smooth communication experience

AI-Powered Assistance

  • AI chatbot for learning support
  • Smart recommendations
  • Enhanced user guidance

Leaderboard System

  • Rankings based on activity.
  • Community engagement rewards.
  • Motivation through gamification.

Personalized Dashboard

  • Track learning progress
  • Session overview
  • Activity management

Modern Responsive UI

  • Fully responsive design
  • Mobile-friendly interface
  • Smooth user experience

Screenshots

Application Preview

Home Page

Home Page


Authentication

Login Page


Become a Mentor

Become a Mentor


AI Assistant

AI Assistant


Demo Video

demo.1.mp4

Problem Statement

Many students struggle to find suitable learning partners, mentors, and collaborative study environments.

The Peer Learning Platform solves this challenge by enabling students to connect, collaborate, and learn together through peer-to-peer knowledge sharing and community interaction.


Tech Stack

Category Technologies
Frontend React 18, TypeScript, Vite
UI & Styling Tailwind CSS, Radix UI, Shadcn UI, Framer Motion
Backend Node.js, Express.js
Database Supabase, PostgreSQL
Authentication Supabase Authentication
State Management & Data Fetching TanStack React Query
Forms & Validation React Hook Form, Zod
Charts & Data Visualization Chart.js, React Chart.js 2, Recharts
API Communication Axios
AI Integration OpenRouter API
Video Conferencing Jitsi React SDK
Testing Vitest, Playwright, Supertest, Testing Library
Code Quality ESLint
Deployment Vercel

System Architecture

graph TD
    subgraph Client [Client Side]
        UI[React Frontend]
    end

    subgraph SupabasePlatform [Supabase Platform]
        Auth[Authentication]
        DB[(PostgreSQL Database)]
        Realtime[Real-Time Chat System]
    end

    subgraph NodeBackend [Custom Backend]
        AIAssistant[AI Integration API]
    end

    subgraph ExternalServices [External Services]
        OpenRouter[OpenRouter / OpenAI API]
    end

    UI <-->|JWT Auth & User Sessions| Auth
    UI <-->|CRUD Operations| DB
    UI <-->|WebSockets| Realtime
    UI -->|Ask AI / Summarize| AIAssistant
    
    AIAssistant -->|Verify Token| Auth
    AIAssistant <-->|Generate Text| OpenRouter
Loading

##Architecture Overview

The Peer Learning Platform follows a modern full-stack architecture designed to provide scalability, maintainability, and real-time collaboration.

Frontend Layer

  • Built using React 18, TypeScript, and Vite.
  • Uses reusable UI components powered by Shadcn UI and Radix UI.
  • Handles routing, state management, authentication, and user interactions.
  • Uses TanStack React Query for efficient server-state management.

Backend Layer

  • Built with Node.js and Express.js.
  • Processes API requests.
  • Handles AI assistant communication.
  • Performs request validation and middleware processing.

Database Layer

  • Supabase provides:
    • PostgreSQL database
    • Authentication
    • Real-time subscriptions
    • Row Level Security (RLS)

AI Integration

The backend securely communicates with the OpenRouter API using direct HTTP requests, keeping API keys server-side while providing intelligent learning assistance.

Request Flow

User
   |
   ?
React Frontend
   |
   ?
Express Backend
   |
   +--------------? AI APIs
   |
   ?
Supabase
   |
   ?
PostgreSQL Database

This layered architecture keeps the frontend, backend, and database responsibilities well separated, making the project easier to maintain and extend.


Project Structure

peer-learning-platform/
|
+-- .github/                  # GitHub workflows, issue & PR templates
+-- .gssoc/                   # GSSoC related resources and documentation
+-- assets/                   # Static assets used across the project
+-- docs/                     # Technical documentation (API, Database, etc.)
+-- public/                   # Public static files served directly
|
+-- src/                      # Frontend source code
|   +-- assets/               # Images, icons and static resources
|   +-- components/           # Reusable React components
|   |   +-- chat/             # Chat related UI components
|   |   +-- dashboard/        # Dashboard components
|   |   +-- mentor/           # Mentor related components
|   |   +-- recommendations/  # Recommendation system UI
|   |   +-- resources/        # Learning resources components
|   |   +-- ui/               # Shared UI components (Shadcn/Radix)
|   |   +-- whiteboard/       # Collaborative whiteboard components
|   |
|   +-- config/              # Application configuration
|   +-- contexts/            # React Context providers
|   +-- hooks/               # Custom React hooks
|   +-- integrations/        # Supabase and third-party integrations
|   +-- lib/                 # Shared libraries and helper logic
|   +-- pages/               # Application pages and routes
|   +-- screenshots/         # README screenshots and application previews
|   +-- test/                # Frontend tests
|   +-- types/               # TypeScript type definitions
|   +-- utils/               # Utility/helper functions
|   +-- App.tsx              # Root React component
|   +-- main.tsx             # Application entry point
|
+-- backend/                 # Backend server
|   +-- controllers/         # Request handling logic
|   +-- middlewares/         # Authentication & request middleware
|   +-- routers/             # API route definitions
|   +-- tests/               # Backend tests
|   +-- utils/               # Backend utility functions
|   +-- validation/          # Request validation schemas
|   +-- app.js               # Express application
|   +-- server.js            # Server entry point
|
+-- supabase/                # Database configuration and migrations
+-- package.json             # Project dependencies and scripts
+-- vite.config.ts           # Vite configuration
+-- tailwind.config.ts       # Tailwind CSS configuration
+-- tsconfig.json            # TypeScript configuration
+-- CONTRIBUTING.md          # Contribution guidelines
+-- TROUBLESHOOTING.md       # Common issues and fixes
+-- README.md                # Project documentation

Where should you make changes?

The table below helps contributors quickly locate the correct directory based on the feature they want to work on.

If you want to... Modify this location
Create a new page src/pages/
Build reusable UI components src/components/ui/
Modify chat functionality src/components/chat/
Improve dashboard features src/components/dashboard/
Work on mentor-related features src/components/mentor/
Add recommendation features src/components/recommendations/
Update the collaborative whiteboard src/components/whiteboard/
Add custom React Hooks src/hooks/
Manage global state or contexts src/contexts/
Configure Supabase integration src/integrations/
Add helper or utility functions src/utils/
Add backend API endpoints backend/routers/
Implement backend business logic backend/controllers/
Create middleware backend/middlewares/
Add request validation backend/validation/
Write backend tests backend/tests/
Update technical documentation docs/

Installation & Setup

1Clone the Repository

git clone https://github.com/durdana3105/peer-learning.git

2Navigate to Project Directory

cd peer-learning

3Install Dependencies

npm install

4Configure Environment Variables

A .env.example file is provided in the root of the repository with all required variable names and placeholder values. Copy it to .env before running the project:

cp .env.example .env

Then fill in your actual values in .env. You can get your Supabase credentials from https://supabase.com/dashboard.

Create a .env file in the root directory and add:

VITE_SUPABASE_URL=your_supabase_url
VITE_SUPABASE_ANON_KEY=your_supabase_anon_key

5Start Development Server

npm run dev

Technical Documentation

For deeper technical insights, please refer to our dedicated documentation:


Development Workflow

Follow the workflow below when contributing to the project:

Issue Assignment
        |
        ?
Fork the Repository
        |
        ?
Clone Repository
        |
        ?
Create a Feature Branch
        |
        ?
Install Dependencies
        |
        ?
Implement Changes
        |
        ?
Run Tests & Lint
        |
        ?
Commit Changes
        |
        ?
Push Branch
        |
        ?
Open Pull Request
        |
        ?
Code Review
        |
        ?
Merge into Main Branch

Development Process

  1. Fork the repository.
  2. Clone it to your local machine.
  3. Create a new feature or bug-fix branch.
  4. Install all required dependencies.
  5. Implement your changes following the project structure.
  6. Run linting and tests before committing.
  7. Commit your changes with a meaningful commit message.
  8. Push the branch to GitHub.
  9. Open a Pull Request for review.
  10. Address review comments (if any) and wait for approval.

Deployment

This project can be easily deployed on:

  • Vercel
  • Netlify
  • Render

Build Command

npm run build

Troubleshooting

If you encounter issues during setup, installation, or configuration, please refer to our Troubleshooting Guide for solutions to common problems.


Feature Roadmap

Our development roadmap is structured to provide clear visibility into the project's priorities and progress.

Completed ?

  • Secure Authentication: Email/Password and OAuth integration.
  • Real-Time Chat & Study Sessions: Live messaging and collaborative learning environments.
  • Gamification System: XP, levels, leaderboards, and streak counts.

In Progress - Session Scheduling: Plan study sessions ahead of time. (Target: Q3)

  • AI-based Peer Recommendations: Smart matching system for peers. (Target: Q3)

Planned - Video Calling Integration: Seamless face-to-face peer collaboration. (Target: Q4)

  • Real-time Notifications: Alerts for new messages and upcoming sessions. (Target: Q4)
  • Mentor Matching System: Dedicated workflows for connecting students with mentors. (Target: Q1 2027)
  • Multi-language Support: Expanding accessibility for a global audience. (Target: Q1 2027)
  • Dedicated Mobile App: Native applications for iOS and Android. (Target: 2027)

Contributing

Contributions are welcome ## Steps to Contribute

  1. Fork the repository
  2. Create a new branch
git checkout -b feature-name
  1. Make your changes
  2. Commit your changes
git commit -m "Add your message"
  1. Push to GitHub
git push origin feature-name
  1. Open a Pull Request ---

Contributors

Thanks to all the amazing people who contribute to Peer Learning

Contributors


Author

Durdana Sultana

Computer Science (AI & ML) Student


Support

If you like this project, please give it a ? on GitHub.

FAQ

Q: How do I set up the project locally?

A: Clone the repo, install dependencies, copy .env.example to .env, fill in Supabase values, then run the development server.

git clone https://github.com/durdana3105/peer-learning.git
cd peer-learning
npm install
cp .env.example .env
# Update .env with your Supabase values
npm run dev

Note: This project standardizes on npm. The committed lockfile is package-lock.json, and CI/deployment run npm ci. Please do not commit lockfiles from other package managers (e.g. bun.lock, bun.lockb, yarn.lock, pnpm-lock.yaml).

Q: What environment variables are required?

A: Your frontend needs VITE_SUPABASE_URL and VITE_SUPABASE_ANON_KEY (or supported aliases such as NEXT_PUBLIC_SUPABASE_URL / NEXT_PUBLIC_SUPABASE_ANON_KEY).

The backend uses SUPABASE_URL and either SUPABASE_SERVICE_ROLE_KEY or SUPABASE_ANON_KEY as well as OPENROUTER_API_KEY for AI chat and SITE_URL where applicable.

Q: How should I configure Supabase?

A: Create a Supabase project and copy the project URL and anon key into .env. Enable Supabase Auth, add the required authentication providers, and make sure your auth redirect URL matches your local or deployed site.

Q: How can I deploy this project?

A: This repository is configured for Vercel deployment. Deploy the frontend and backend to Vercel, then add the same Supabase environment variables to your Vercel project settings.

For local deployment, ensure your .env variables are correct and run npm run dev for development or npm run build then npm run preview for production preview.

Q: Why does authentication fail even though I set up Supabase?

A: Common causes:

  • .env variables are missing, wrong, or not loaded.
  • The site URL in Supabase Auth settings does not match your local URL (http://localhost:5173) or deployed URL.
  • OAuth provider callback URLs are not configured correctly.

Verify the keys and URLs carefully in both Supabase and the app.

Q: What should I do if the app still fails to start?

A: Check these steps:

  • Confirm .env.example was copied to .env and values were filled.
  • Run npm install again after deleting node_modules if dependencies appear broken.
  • Make sure your Node.js version is compatible with the repo (CI uses Node 20.x).
  • Look for console errors from the frontend or backend and verify the Supabase credentials.

License

This project is licensed under the MIT License.


Empowering Students Through Collaborative Learning Made with by the Open Source Community

# TODO: [bug]: validation error message doesn't clear after fixing the issue (skills & experience steps) (#1614)

About

Peer Learning Platform : An AI-powered collaborative learning platform where students can connect with peers, share knowledge, solve doubts, join study sessions, and learn together through real-time interaction and smart recommendations.

Resources

License

Code of conduct

Contributing

Stars

34 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors