Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Qureshi30/EduHaven

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

join our group on discord

This project is now OFFICIALLY accepted for:

GSSOC

Eduhaven

image

Overview

EduHaven is a platform designed to assist students by providing a productivity-focused environment. It aims to provide a space where students can Learn and grow together by socialising with friends. It incorporates real-time collaboration, task management, analytics, AI-chatbot, note-making, gamification and more.

Features :

  • User Dashboard (Home Page)

    Study and break timer, stats summary, notes management, goal setting with deadlines, integrated calendar, and study tools like AI chat, calculator, converter, and graph.

  • Real-Time Study Rooms

    Create or join study rooms with friends, use video/audio controls, manage permissions, and chat for discussions.

  • Realtime Stats

    Track study time, streaks, global and friend ranks, badges, goal completion, and friends' analytics.

  • Realtime Chat

    Chat with peers, share notes and study materials, send private messages, and see online/offline presence.

  • Friends and Social Features

    Add friends, invite them to rooms, track their status, and share goals and progress.

  • Gamification

    Earn badges and rewards, maintain streaks, climb leaderboards, and play games to refresh your mind.

Tech Stack

  • Frontend: React.js, Tailwind, Zustand, Tansack-query
  • Backend: Node.js with Express
  • Database: MongoDB, Cloudinary
  • Real-Time Communication: Socket.IO, WebRTC

Folder Structure

πŸ“¦EduHaven/
β”œβ”€ πŸ“‚.github/                   # πŸ”§ GitHub workflows, issue & PR templates
β”‚
β”œβ”€ πŸ“‚ client/                   # Frontend (React + Vite) =============================
β”‚  β”œβ”€ πŸ“‚ src/                   # Main frontend source code
β”‚  β”‚  β”œβ”€ πŸ“‚ api/                # API call functions (fetch, axios, etc.)
β”‚  β”‚  β”œβ”€ πŸ“‚ assets/             # Images, fonts, icons (bundled in app)
β”‚  β”‚  β”œβ”€ πŸ“‚ Auth/               # Authentication pages (login, signup, OTP, password, etc)
β”‚  β”‚  β”œβ”€ πŸ“‚ components/         # Reusable UI components (buttons, popups, dropdowns etc.)
β”‚  β”‚  β”œβ”€ πŸ“‚ contexts/           # React Context providers (global state)
β”‚  β”‚  β”œβ”€ πŸ“‚ hooks/              # Custom React hooks (useAuth, useFetch, etc.)
β”‚  β”‚  β”œβ”€ πŸ“‚ lib/
β”‚  β”‚  β”œβ”€ πŸ“‚ pages/              # Route-level pages (Home, stats, chat, notes, etc )
β”‚  β”‚  β”œβ”€ πŸ“‚ queries/            # Data fetching/mutations (Tanstack Query, etc.)
β”‚  β”‚  β”œβ”€ πŸ“‚ routes/             # Route definitions (React Router setup)
β”‚  β”‚  β”œβ”€ πŸ“‚ stores/             # State management (Zustand)
β”‚  β”‚  β”œβ”€ πŸ“‚ utils/              # Helper utilities (axios, error handlers, etc.)
β”‚  β”‚  β”œβ”€ πŸ“„ App.jsx             # Root React component
β”‚  β”‚  β”œβ”€ πŸ“„ index.css           # Global styles
β”‚  β”‚  └─ πŸ“„ main.jsx            # Entry point of app
β”‚  β”‚
β”‚  β”œβ”€ πŸ“‚ public/                # Static assets (served directly)
β”‚  β”‚  β”œβ”€ πŸ“‚ EduhavenBadges/     # Badge images
β”‚  β”‚  β”œβ”€ πŸ“‚ sounds/             # Audio files
β”‚  β”‚  └─ πŸ“„ .......             # Other media files
β”‚  β”‚
β”‚  β”œβ”€ πŸ“„ .env.example           # Example frontend env variables
β”‚  β”œβ”€ πŸ“„ .env.extension         # Browser extension config
β”‚  β”œβ”€ πŸ“„ vite.config.js
β”‚  β”œβ”€ πŸ“„ tailwind.config.js
β”‚  └─ πŸ“„ package.json           # Frontend dependencies & scripts
β”‚
β”œβ”€ πŸ“‚ server/                   # Backend (Node.js + Express) ===========================
β”‚  β”œβ”€ πŸ“‚ Controller/            # Request handlers
β”‚  β”œβ”€ πŸ“‚ Routes/                # API routes
β”‚  β”œβ”€ πŸ“‚ Model/                 # Database models/schemas
β”‚  β”œβ”€ πŸ“‚ Database/              # Database connection/setup
β”‚  β”œβ”€ πŸ“‚ Middlewares/           # Express middlewares
β”‚  β”œβ”€ πŸ“‚ Socket/                # WebSocket functionality
β”‚  β”œβ”€ πŸ“‚ security/              # Security configurations
β”‚  β”œβ”€ πŸ“‚ utils/                 # Helper functions
β”‚  β”œβ”€ πŸ“„ .env.example           # Example backend env variables
β”‚  β”œβ”€ πŸ“„ index.js               # Backend entry point
β”‚  └─ πŸ“„ API_DOCS.md            # You can view list of all endpoints here
β”‚
β”œβ”€ πŸ“„ CONTRIBUTING.md           # Contribution guidelines
β”œβ”€ πŸ“„ CODE_OF_CONDUCT.md        # Code of conduct
β”œβ”€ πŸ“„ .prettierrc.json          # Code formatting rules
└─ πŸ“„ LEARN.md                  # Reference / learning notes

Installation and Setup

  • Make sure you've joined our discord server so you can connect in case you face any issues.
  • Prerequisites: Node.js, MongoDB, Git

Steps to Run Locally

  1. After forking the repository, Clone the forked repository:

    git clone https://github.com/<your-username>/EduHaven.git
    cd EduHaven
    
  2. Install dependencies:

    # Install backend dependencies
    cd Server
    npm install
    
    # Install frontend dependencies
    cd ../Client
    npm install
  3. Set up environment variables:

    • for frontend:

      • create a .env file in the /Client directory, and copy all the contents from .env.example.
    • for backend:

      • Create a .env file in the /Server directory.
      • Follow the instructions provided in .env.example file to create a new .env file for backend.

    πŸ”΄ make sure the contents of .env.example file must remain untouched.

  4. Start the development servers:

    # Start backend server
    cd Server
    npm run dev
    
    # Start frontend server
    cd ../Client
    npm run dev

Troubleshooting

MongoDB not connecting β€” MongoNetworkError. Use local service or Atlas; example connect:

// Server/Database/Db.js
const mongoose = require('mongoose');
const uri = process.env.MONGO_URI || 'mongodb://localhost:27017/eduhaven';
mongoose.connect(uri, { useNewUrlParser:true, useUnifiedTopology:true })
  .then(()=>console.log('MongoDB connected'))
  .catch(err=>{ console.error('MongoDB error:', err.message); process.exit(1); });

CORS blocked β€” "blocked by CORS policy". Enable CORS and set client origin:

// Server/index.js (before routes)
const cors = require('cors');
app.use(cors({ origin: process.env.CLIENT_URL || '*', credentials: true }));

OAuth / infinite loading β€” spinner never returns. Clear browser storage for localhost and verify GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET and exact redirect URI in .env and provider console.

Contribution Guidelines

  1. You must get assigned to the issue before you start working on it. leave comment to get issue assigned.
  2. Code must be properly formatted. (use preetier configuration provided)
  3. Commits should generally be minimal
  4. The body of the commit message should explain why and how the change was made.It should provide clear context for all changes mage that will help both a reviewer now, and a developer looking at your changes a year later, understand the motivation behind your decisions.

We welcome contributions to make EduHaven better for students everywhere! Here’s how you can contribute:

  1. Fork the repository.
  2. Create a new branch for your feature/bugfix:
    git checkout -b feature-name
  3. Make your changes and test them thoroughly.
  • For frontend changes, also run:
    npm run build
    and verify there are no build errors.
  1. Commit and push your changes:
    git add .
    git commit -m "Add a brief description of your changes"
    git push origin feature-name
  2. Before pushing frontend changes, run npm run build locally to ensure the project builds successfully. Catch & solve any potential deployment issues early, if any.
  3. Create a Pull Request (PR) with a detailed explanation of your changes.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Special thanks to contributors for their efforts in building EduHaven.
  • Inspired by productivity tools and online collaborative platforms.

Preventing Backend Cold Starts

The backend is hosted on Render Free Tier and may go to sleep after short inactivity.
We;re keeping it alive using cron-job.org to ping the backend every 1 minute. For full details, see KEEP_ALIVE.md.

For any further queries, feel free to reach out on our Discord group. Let’s make learning fun and productive!

About

EduHaven: A Student-Centric Learning Platform

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 90.7%
  • TypeScript 5.3%
  • CSS 3.2%
  • HTML 0.8%