Skip to content

Repository files navigation

StudyHive 🐝

"Where Students Thrive Together"

A clean, community-driven academic platform for students to access past questions, quizzes, notes, and collaborate with peers to study effectively.

StudyHive TypeScript TailwindCSS

✨ Features

πŸ“š Academic Resources

  • Past Questions Library - Access years of past exam questions organized by course and semester
  • Community Notes - Rich-text notes with voting, saving, and commenting
  • Interactive Quizzes - Timed quizzes with instant feedback and explanations

🎯 Navigation & Organization

  • Level-based Hierarchy - 100L β†’ 200L β†’ 300L β†’ 400L
  • Course Organization - Browse courses by department and credit units
  • Smart Search - Global search with keyboard shortcut (⌘K)

πŸ‘₯ Community Features

  • Voting System - Upvote/downvote notes to surface quality content
  • Comments - Discuss and clarify concepts with peers
  • Leaderboard - Compete for top contributor status
  • Request System - Request missing study materials

🎨 UI/UX

  • Notion-like Interface - Clean, minimalistic design
  • Dark Mode Support - Easy on the eyes during late-night study sessions
  • Responsive Design - Works on desktop and mobile
  • Resizable Sidebar - Customize your workspace

πŸš€ Getting Started

Prerequisites

  • Node.js 16.8 or later
  • npm, yarn, or pnpm

Installation

  1. Clone the repository:
git clone <your-repo-url>
cd notion-clone-nextjs
  1. Install dependencies:
npm install
  1. Run the development server:
npm run dev
  1. Open your browser: Navigate to http://localhost:3000

πŸ“ Project Structure

β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ (main)/                    # Main application
β”‚   β”‚   └── (routes)/
β”‚   β”‚       β”œβ”€β”€ levels/            # Levels browsing
β”‚   β”‚       β”œβ”€β”€ courses/[courseId] # Course details with resources
β”‚   β”‚       β”œβ”€β”€ notes/[noteId]     # Note viewer with comments
β”‚   β”‚       β”œβ”€β”€ quizzes/[quizId]   # Interactive quiz
β”‚   β”‚       β”œβ”€β”€ leaderboard/       # Rankings
β”‚   β”‚       β”œβ”€β”€ requests/          # Resource requests
β”‚   β”‚       └── saved/             # Saved notes
β”‚   β”œβ”€β”€ (marketing)/               # Landing page
β”‚   └── (public)/                  # Public preview pages
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ modals/                    # Modal dialogs
β”‚   β”œβ”€β”€ providers/                 # Context providers
β”‚   └── ui/                        # shadcn/ui components
β”œβ”€β”€ hooks/                         # Custom React hooks
└── lib/
    β”œβ”€β”€ api/                       # Axios client & service layers
    β”œβ”€β”€ utils.ts                   # Helper functions
    └── query-client.ts            # React Query client

🎨 Design System

Colors

  • Primary: Amber/Orange gradient (#f59e0b β†’ #ea580c)
  • Background: #f7f7f7 (light) / #1F1F1F (dark)
  • Cards: #ffffff (light) / dark variants
  • Accent Colors:
    • Blue for quizzes
    • Green for success states
    • Purple for special features

Typography

  • Font: Plus Jakarta Sans (via Next.js font optimization)
  • Headings: Bold, clear hierarchy
  • Body: Clean, readable text

Components

Built on shadcn/ui with custom styling:

  • Buttons with amber accent
  • Cards with hover effects
  • Dialog modals
  • Dropdown menus
  • Command palette (search)

πŸ”§ Data Structure

User Roles

Role Permissions
Student Browse, download, create notes, vote, comment, save
Rep Upload PQs, create quizzes, moderate notes
Admin Full access, manage users, platform analytics

Core Entities

  • Levels β†’ Contains courses
  • Courses β†’ Contains resources (PQs, Notes, Quizzes)
  • Community Notes β†’ Rich text with voting/comments
  • Quizzes β†’ Timed MCQ assessments
  • Requests β†’ Student requests for materials

Reputation System

reputation = (noteUpvotes Γ— 2) + saves + quizScores + comments - downvotes

πŸ› οΈ Tech Stack

Layer Technology
Framework Next.js 13 (App Router)
Language TypeScript
Styling Tailwind CSS
UI Components shadcn/ui
State Zustand
Notifications Sonner
Icons Lucide React

πŸ“ Available Scripts

npm run dev      # Start development server
npm run build    # Build for production
npm start        # Start production server
npm run lint     # Run ESLint

πŸ”Œ API Integration

StudyHive now talks directly to the backend defined by NEXT_PUBLIC_API_BASE_URL (defaults to http://localhost:5000).
All modules use the shared Axios client in lib/api/client.ts, with token refresh + error handling baked in. Service files live in lib/api/services/* and are consumed via React Query hooks for caching and optimistic updates.

Required Backend Features

  • /api/auth/* for authentication + token refresh
  • /api/levels, /api/courses for academic hierarchy
  • /api/community-notes, /api/past-questions, /api/quizzes, /api/requests
  • /api/upload/presigned-url for the two-step R2 upload flow

Update .env.local if your API runs elsewhere:

NEXT_PUBLIC_API_BASE_URL=http://localhost:5000

🚧 Current Limitations

  • Requires the StudyHive API to be running locally (or configure NEXT_PUBLIC_API_BASE_URL)
  • Some admin-only workflows are stubbed in the UI until server endpoints are finalized
  • Real-time updates (websocket/pusher) are not implemented yet

πŸ“„ API Endpoints (Future Backend)

POST /auth/signup
POST /auth/login
POST /auth/refresh

GET  /levels
GET  /levels/:id/courses
GET  /courses/:id

GET  /pq/:courseId
POST /pq

GET  /notes/:courseId
POST /notes
POST /notes/:id/upvote
POST /notes/:id/save

GET  /quiz/:courseId
POST /quiz/attempt

POST /requests
GET  /requests

GET  /leaderboard

🀝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“œ License

This project is open source and available for learning and building your own projects.

πŸ™ Acknowledgements


StudyHive - Where students thrive together 🐝

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages