You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The LMS (Learning Management System) is an advanced platform designed for both students and educators to facilitate online learning. Developed with modern technologies like JavaScript, Node.js, Express, MongoDB, and React, this system aims to deliver a seamless educational experience. The LMS is equipped with features that support course creation, management, and delivery, making it a comprehensive solution for online education.
๐ฆ Features
Browse & Filter Courses: Users can explore and find courses that match their interests and needs.
Purchase Courses using Stripe: Secure and reliable payment processing integrated with Stripe.
Progress Tracking: Students can mark chapters as completed or uncompleted and track their progress.
Student Dashboard: A personalized dashboard for students to manage their courses and track progress.
Teacher Mode: Tools and features specifically designed for educators to create and manage their courses.
Course Creation: Instructors can create new courses and chapters, upload thumbnails, attachments, and videos.
Drag and Drop Chapter Reordering: Easily reorder chapters within a course.
Video Processing and HLS Player: Videos are processed and played using Mux for a smooth viewing experience.
Rich Text Editor: A powerful editor for creating detailed chapter descriptions.
Authentication with Clerk: Secure user authentication and management.
ORM with Prisma: Efficient database interactions using Prisma.
MySQL Database: Reliable data storage with Render.
Course Grid & Card UI: Intuitive and visually appealing UI for course display.
Stripe Integration: Seamless payment processing for purchasing courses.
Teacher Analytics Dashboard: Detailed analytics for teachers to monitor student engagement and performance.
Admin Protection (Optional): Additional security features for admin users.
Deployment: Easy deployment process for making the LMS available online.
Contains the page component for displaying and managing a specific course identified by its ID, including details such as course content, progress, and management options.
Serves as the main page layout or entry point for the root route in the dashboard. It may include overall navigation and high-level dashboard features.
Manages API routes for operations on a specific course identified by courseId, including endpoints for retrieving, updating, or deleting course details.
Manages the API route for unpublishing a specific course identified by courseId. This endpoint is used to change the status of the course, making it unavailable to students.
Handles the API route for initiating a checkout process for a specific course identified by courseId. This endpoint typically involves payment processing and order creation.
Manages the API routes for handling course attachments. This includes operations such as uploading, retrieving, and managing files associated with a specific course identified by courseId.
Manages the API routes for handling operations on a specific attachment within a course. This includes actions like retrieving, updating, or deleting an attachment identified by attachmentId for a given courseId.
Defines API routes for managing course chapters, including operations like creating, updating, and retrieving chapters for a specific course identified by courseId.
Defines API routes for managing a specific chapter within a course, identified by courseId and chapterId. This includes operations such as updating, deleting, and retrieving information for that chapter.
Defines API routes for managing the progress of a specific chapter within a course, identified by courseId and chapterId. This includes tracking and updating progress status for users.
Manages API routes for unpublishing a specific chapter within a course, identified by courseId and chapterId. This typically involves changing the chapter's visibility or status to not available to students.
Handles API routes for publishing a specific chapter within a course, identified by courseId and chapterId. This usually involves updating the chapter's status to make it visible and accessible to students.
Handles API routes for reordering chapters within a specific course, identified by courseId. This involves updating the order of chapters as specified by the user.
Manages API routes for handling webhook events. This could include processing incoming data from external services or systems as specified in the webhook configuration.
Renders the main course page for a specific course identified by courseId. This file handles the display of course details, including course content, instructor information, and student interactions.
Defines the layout structure for the course pages, ensuring consistent presentation and navigation elements for courses identified by courseId. It may include headers, sidebars, and other layout components.
Implements the sidebar for course pages, providing navigation links and additional course-related options. It organizes and presents links to various sections of the course.
Displays the details and contents of a specific chapter within a course, including chapter title, description, and associated resources. It likely manages the layout and presentation of the chapterโs content.
Manages the layout and structure for authentication-related pages. This file likely sets up common elements such as headers, footers, and sidebars for pages related to user authentication. It might also handle routing or conditional rendering based on user authentication status.
Handles the sign-in page for authentication. This file likely includes the form for user login, input validation, and error handling. It may also manage user redirection or display messages based on sign-in status.
Handles the sign-up page for new user registration. This file likely includes the form for creating a new account, input validation, and error handling. It may also manage user redirection or display messages based on the registration status.
Hereโs the updated "Getting Started" section with the details of the dependencies included:
๐ Getting Started
Requirements
Ensure you have the following dependencies installed on your system:
TypeScript: ^5
Node.js: Ensure compatibility with the project's requirements
Prisma: ^5.16.1
Project Dependencies
Core Packages:
Next.js: ^14.2.4
React: ^18
Prisma Client: ^5.16.2
UI & Components:
Radix UI: For UI primitives (e.g., @radix-ui/react-alert-dialog, @radix-ui/react-checkbox, etc.)
Lucide Icons: ^0.400.0
Tailwind CSS: ^3.4.1
Tailwind CSS Animate: ^1.0.7
Class Variance Authority: ^0.7.0
Utilities:
Axios: ^1.7.2
Zod: ^3.23.8
React Hook Form: ^7.44.3
React Dropzone: ^14.2.3
React Hot Toast: ^2.4.1
React Quill: ^2.0.0
Stripe: ^16.2.0
Recharts: ^2.12.7
Query String: ^9.0.0
Uploadthing: ^6.13.2
Development Tools:
ESLint: ^8
ESLint Config Next: 14.2.4
PostCSS: ^8
Prisma CLI: ^5.16.1
TypeScript: ^5
โ๏ธ Installation
Clone the lms Repository:
git clone https://github.com/leonardoo210399/lms
Change to the Project Directory:
cd lms
Install the Dependencies:
npm install
๐ค Running Locally
Development Server:
Start the development server with:
npm run dev
Build for Production:
Build the application for production with:
npm run build
Start Production Server:
Start the production server with:
npm run start
๐งช Testing
To execute tests, run:
npm test
๐ง Linting
Run the linter with:
npm run lint
๐ ๏ธ Post-Install
Generate the Prisma client after installing dependencies with:
npm run postinstall
๐ Environment Variables
To run this project, you will need to add the following environment variables to your .env file:
# Clerk AuthenticationNEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your_keyCLERK_SECRET_KEY=your_key# Clerk Sign-In/Sign-Up URLsNEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-inNEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-upNEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/# Prisma Configuration# This was inserted by `prisma init`:# Environment variables declared in this file are automatically made available to Prisma.# See the documentation for more detail: https://pris.ly/d/prisma-schema#accessing-environment-variables-from-the-schema# Prisma supports the native connection string format for PostgreSQL, MySQL, SQLite, SQL Server, MongoDB and CockroachDB.# See the documentation for all the connection string options: https://pris.ly/d/connection-stringsDATABASE_URL="your_database_url"# UploadThing ConfigurationUPLOADTHING_SECRET=your_keyUPLOADTHING_APP_ID=your_key# Mux ConfigurationMUX_TOKEN_ID=your_keyMUX_TOKEN_SECRET=your_key# Stripe ConfigurationSTRIPE_API_KEY=your_keyNEXT_PUBLIC_APP_URL=http://localhost:3000STRIPE_WEBHOOK_SECRET=your_key# Additional ConfigurationsNEXT_PUBLIC_TEACHER_ID=your_key
๐ Optimizations
๐ ๏ธ Code Refactoring
Modularization: Split large components and functions into smaller, reusable modules to improve readability and maintainability.
Code Cleanup: Removed redundant code, comments, and unused variables to reduce clutter.
Consistent Naming: Adopted a consistent naming convention for variables, functions, and components to improve code clarity.
TypeScript Conversion: Converted JavaScript code to TypeScript for better type safety and error checking.
โก Performance Improvements
Lazy Loading: Implemented lazy loading for components and images to reduce initial load time.
Memoization: Used React's useMemo and useCallback hooks to prevent unnecessary re-renders and optimize performance.
Optimized Queries: Improved database queries with indexing and optimized filtering to enhance data retrieval speed.
Static Asset Caching: Configured caching for static assets to reduce server load and improve load times.
Code Splitting: Utilized dynamic imports to split code into smaller bundles, improving load times for large applications.
Debouncing: Implemented debouncing for search inputs and other frequent user actions to reduce unnecessary API calls.
โฟ Accessibility Enhancements
ARIA Roles: Added ARIA roles to improve accessibility for users relying on screen readers.
Keyboard Navigation: Ensured that all interactive elements are accessible via keyboard navigation.
Alt Text: Provided meaningful alt text for images to enhance the experience for visually impaired users.
Color Contrast: Improved color contrast to ensure readability for users with visual impairments.
Semantic HTML: Used semantic HTML elements (e.g., <header>, <main>, <footer>) to provide better structure and meaning to the content.
Focus Management: Managed focus states to improve navigation for keyboard and screen reader users.
๐ Security Enhancements
Input Validation: Implemented server-side and client-side validation to prevent SQL injection and cross-site scripting (XSS) attacks.
Authentication: Used secure authentication methods and token handling to protect user data.
Environment Variables: Secured sensitive information using environment variables.
HTTPS: Enforced HTTPS for secure data transmission.
๐จ UX/UI Improvements
Responsive Design: Ensured the application is fully responsive and works well on various screen sizes and devices.
Loading Indicators: Added loading indicators to provide feedback during data fetching operations.
Error Handling: Implemented comprehensive error handling to gracefully manage and display error messages to users.
User Feedback: Provided feedback for user actions like form submissions, button clicks, etc.
Improved Forms: Enhanced form usability with clear labels, validation messages, and accessibility improvements.
By implementing these optimizations, the application not only performs better but also provides a more accessible, secure, and user-friendly experience.
๐ Project Roadmap
โบ Initial Setup and Configuration
โบ Implement Course Management
โบ Integrate Payment System with Stripe
โบ Develop Student and Teacher Dashboards
โบ Add Video Processing and HLS Player
โบ Implement Authentication with Clerk
โบ Set Up ORM with Prisma and MySQL
โบ Enhance UX/UI Design
โบ Implement Advanced Analytics for Teachers
โบ Add Admin Protection Features (Optional)
โบ Optimize Performance and Accessibility
โบ Final Testing and Debugging
โบ Deployment and Launch
๐ Acknowledgments
We extend our heartfelt thanks to the following individuals and resources who contributed to the success of this project:
OpenAI: For providing the powerful GPT models that inspired innovative features and solutions.
Mux: For offering exceptional video processing and HLS streaming services that enhanced our multimedia capabilities.
Stripe: For delivering a seamless and reliable payment processing system.
Clerk: For providing robust authentication services that ensure secure user management.
UploadThing: For facilitating smooth file uploads and management.
Prisma: For offering an intuitive ORM to simplify database interactions.
Tailwind CSS: For a versatile utility-first CSS framework that streamlined our styling process.
React and Next.js: For powerful tools that enabled the creation of a dynamic and responsive front-end.
Render.com: For providing a reliable and scalable database solution.
Special Thanks
Our Community: For providing valuable feedback and suggestions that guided the development of this project.
Open Source Contributors: For sharing their knowledge and tools, which greatly accelerated our development process.
Friends and Family: For their continuous support and encouragement throughout the development of this project.