Skip to content

ByteCrister/next-learn

Repository files navigation

Next Learn

Next.js React TypeScript MongoDB License

A comprehensive study planning and course management platform with hierarchical roadmaps, assessments, and scheduling tools.

Features β€’ Quick Start β€’ Documentation β€’ Tech Stack


πŸ“‹ Overview

Next Learn is a full-stack educational web platform that helps students and educators organize study materials, create learning roadmaps, and manage assessments and routines β€” all within an authenticated, user-friendly system.

Core Capabilities

  • Structured Content: Subjects β†’ Roadmaps β†’ Chapters with rich text editing
  • Assessment System: Exams with automated grading and history tracking
  • Scheduling Tools: Study routines, event calendars, and dashboards
  • Authentication: Secure JWT-based login with Google OAuth integration

✨ Features

πŸ“š Educational Content Management

  • Create and organize subjects with titles, codes, and metadata
  • Build course roadmaps using the TipTap rich text editor
  • Nest chapters inside roadmaps for detailed learning paths
  • Write personal notes and attach external resources

πŸ“ Assessment System

  • Create and edit exams with multiple question types
  • Support for timed exams and auto-submission
  • Instant grading and score tracking
  • Historical results and analytics dashboard

πŸ“… Scheduling & Organization

  • Custom study routines and recurring events
  • Interactive calendar with color-coded deadlines
  • Centralized dashboard for quick overviews

πŸ” Authentication & Security

  • NextAuth.js with credentials and Google OAuth providers
  • Configurable session expiry (24h or 30 days)
  • JWT tokens with secure cookie handling
  • Middleware-based route protection

πŸš€ Quick Start

Prerequisites

  • Node.js β‰₯ 18.x
  • MongoDB (Local or Atlas)
  • npm, yarn, pnpm, or bun

Installation

# Clone the repository
git clone https://github.com/ByteCrister/next-learn.git
cd next-learn

# Install dependencies
npm install

Environment Configuration

Create a .env.local file in the root:

# Database
MONGODB_URI=mongodb://localhost:27017/next-learn
# or MongoDB Atlas:
# MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/next-learn

# Authentication
NEXTAUTH_SECRET=your-secret-key-here
NEXTAUTH_URL=http://localhost:3000

# Google OAuth
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret

Run the Development Server

This is a Next.js project bootstrapped with [create-next-app](https://nextjs.org/docs/app/api-reference/c

Getting Started

First, run the development server:

npm run dev

Then open: http://localhost:3000

Production Build

npm run build
npm start

πŸ› οΈ Tech Stack

Frontend

Technology Version Purpose
Next.js 15.4.5 App Router + SSR
React 19.1.0 UI library
TypeScript 5.x Type safety
Tailwind CSS 4.x Styling
TipTap 3.0.9 Rich text editing
Zustand 5.0.7 State management
Radix UI Latest Accessible UI primitives
Material-UI 7.2.0 UI components
Framer Motion 12.23.12 Animations

Backend

Technology Version Purpose
Next.js API Routes 15.4.5 Backend API
MongoDB 8.17.0 Database
Mongoose 8.17.0 ODM
NextAuth.js 4.24.11 Authentication
bcryptjs 3.0.2 Password hashing
jsonwebtoken 9.0.2 JWT handling

Additional Libraries

  • Validation: Zod, Yup
  • Forms: React Hook Form, Formik
  • HTTP: Axios
  • Calendar: react-big-calendar
  • Notifications: react-toastify
  • DnD: @dnd-kit

πŸ“ Project Structure

next-learn/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ layout.tsx
β”‚   β”‚   β”œβ”€β”€ page.tsx
β”‚   β”‚   β”œβ”€β”€ dashboard/
β”‚   β”‚   β”œβ”€β”€ subjects/
β”‚   β”‚   β”œβ”€β”€ exams/
β”‚   β”‚   β”œβ”€β”€ routines/
β”‚   β”‚   └── api/
β”‚   β”‚       β”œβ”€β”€ auth/
β”‚   β”‚       β”œβ”€β”€ subjects/
β”‚   β”‚       β”œβ”€β”€ roadmaps/
β”‚   β”‚       β”œβ”€β”€ exams/
β”‚   β”‚       β”œβ”€β”€ results/
β”‚   β”‚       └── dashboard/
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ ui/
β”‚   β”‚   β”œβ”€β”€ subjects/
β”‚   β”‚   β”œβ”€β”€ Editor/
β”‚   β”‚   └── providers/
β”‚   β”œβ”€β”€ models/
β”‚   β”‚   β”œβ”€β”€ User.ts
β”‚   β”‚   β”œβ”€β”€ Subject.ts
β”‚   β”‚   β”œβ”€β”€ CourseRoadmap.ts
β”‚   β”‚   β”œβ”€β”€ Exam.ts
β”‚   β”‚   └── ExamResult.ts
β”‚   β”œβ”€β”€ store/
β”‚   β”‚   β”œβ”€β”€ useDashboardStore.ts
β”‚   β”‚   β”œβ”€β”€ useSubjectsStore.ts
β”‚   β”‚   └── useEventsStore.ts
β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   β”œβ”€β”€ auth/
β”‚   β”‚   β”œβ”€β”€ api/
β”‚   β”‚   └── helpers/
β”‚   └── config/
β”‚       └── ConnectDB.ts
β”œβ”€β”€ public/
β”œβ”€β”€ package.json
β”œβ”€β”€ tailwind.config.js
β”œβ”€β”€ tsconfig.json
└── .env.local

πŸ”§ Configuration

Database Models

Model Purpose
User Authentication and profile data
Subject Top-level educational categories
CourseRoadmap Structured course paths
Exam Assessment definitions
ExamResult Scores and submissions
Event Calendar events and reminders

Authentication Flow

  • Credentials Provider: Email/password via bcrypt

  • Google OAuth: Secure sign-in via NextAuth

  • Session Lifetimes:

    • Default: 24 hours
    • With β€œRemember Me”: 30 days

State Management

  • useDashboardStore: Profile & content stats
  • useSubjectsStore: Subject/roadmap data
  • useEventsStore: Calendar events

πŸ“š API Endpoints

Authentication

  • POST /api/auth/signin β€” Login
  • POST /api/auth/signout β€” Logout
  • GET /api/auth/session β€” Session info

Subjects

  • GET /api/subjects β€” List subjects
  • POST /api/subjects β€” Create
  • PUT /api/subjects/:id β€” Update
  • DELETE /api/subjects/:id β€” Delete

Roadmaps

  • GET /api/roadmaps β€” Retrieve
  • POST /api/roadmaps β€” Create
  • PUT /api/roadmaps/:id β€” Update
  • DELETE /api/roadmaps/:id β€” Delete

Exams

  • GET /api/exams β€” List
  • POST /api/exams β€” Create
  • POST /api/exams/join β€” Participate
  • GET /api/results β€” View results

Public

  • GET /api/view/subject β€” Public subject view
  • GET /api/view/notes β€” Shared notes view

🎨 Styling

  • Framework: Tailwind CSS
  • Fonts: Inter (primary), Sora (secondary)
  • Theme: Dark/light with custom palette
  • Enhancements: Typography plugin, smooth animations

πŸ”’ Security

  • JWT-based authentication
  • Bcrypt password hashing
  • Route-level access control
  • User data isolation per session
  • CSRF and HTTPS enforced
  • Secrets stored in .env.local

🚒 Deployment

Using Vercel (Recommended)

  1. Push to GitHub
  2. Import into Vercel
  3. Set environment variables
  4. Deploy automatically

Manual Deployment

npm run build
npm start

Requirements:

  • Node.js β‰₯ 18
  • MongoDB connection string
  • Configured environment variables

πŸ“ Development Scripts

npm run dev       # Development (Turbopack)
npm run build     # Production build
npm start         # Start production server
npm run lint      # Lint codebase

🀝 Contributing

This is a private project, but internal contributors can:

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

πŸ“„ License

This project is private and proprietary. All rights reserved Β© ByteCrister.


πŸ› Roadmap

  • Real-time collaboration
  • Mobile application
  • Roadmap export feature
  • Advanced analytics dashboard
  • Notification & alert system

πŸ“ž Support

For inquiries or bug reports:

  • Open a GitHub issue
  • Contact the development team directly

πŸ™ Acknowledgments


Made by ByteCrister & Adil

About

NextLearn is a comprehensive study planning and course management web application built with Next.js 15, React 19, and MongoDB that helps users organize educational content through hierarchical roadmaps, take timed assessments with automatic grading, and manage study schedules.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages