Coder Social home page Coder Social logo

next13-lms-platform's Introduction

Build an LMS Platform: Next.js 13, React, Stripe, Mux, Prisma, Tailwind, MySQL | Full Course 2023

Copy of Copy of Copy of Copy of Fullstack Twitter Clone (9)

This is a repository for Build an LMS Platform: Next.js 13, React, Stripe, Mux, Prisma, Tailwind, MySQL | Full Course 2023

VIDEO TUTORIAL

Key Features:

  • Browse & Filter Courses
  • Purchase Courses using Stripe
  • Mark Chapters as Completed or Uncompleted
  • Progress Calculation of each Course
  • Student Dashboard
  • Teacher mode
  • Create new Courses
  • Create new Chapters
  • Easily reorder chapter position with drag n’ drop
  • Upload thumbnails, attachments and videos using UploadThing
  • Video processing using Mux
  • HLS Video player using Mux
  • Rich text editor for chapter description
  • Authentication using Clerk
  • ORM using Prisma
  • MySQL database using Planetscale

Prerequisites

Node version 18.x.x

Cloning the repository

git clone https://github.com/AntonioErdeljac/next13-lms-platform.git

Install packages

npm i

Setup .env file

NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=
CLERK_SECRET_KEY=
NEXT_PUBLIC_CLERK_SIGN_IN_URL=
NEXT_PUBLIC_CLERK_SIGN_UP_URL=
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=
NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=

DATABASE_URL=

UPLOADTHING_SECRET=
UPLOADTHING_APP_ID=

MUX_TOKEN_ID=
MUX_TOKEN_SECRET=

STRIPE_API_KEY=
NEXT_PUBLIC_APP_URL=http://localhost:3000
STRIPE_WEBHOOK_SECRET=

NEXT_PUBLIC_TEACHER_ID=

Setup Prisma

Add MySQL Database (I used PlanetScale)

npx prisma generate
npx prisma db push

Start the app

npm run dev

Available commands

Running commands with npm npm run [command]

command description
dev Starts a development instance of the app

next13-lms-platform's People

Contributors

antonioerdeljac avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

next13-lms-platform's Issues

Redirection Loop in Dashboard Route for Unauthenticated Users

The current implementation in the Dashboard route seems to create a redirection loop when users are not authenticated. The logic checks for userId and redirects unauthenticated users back to the root ("/") route, which leads to a loop when the root route is the dashboard for authenticated users.

it doesnt throw any error in dev mode but it does for me when deploying.

const { userId } = auth()

  if (!userId) {
    return redirect("/") 
  }

onChange property is missing on Combobox in category-form.tsx for shadcn combobox

In the file /app/(dashboard)/(routes)/teacher/courses/[courseId]/_components/category-form.tsx

The following line gives an error but does not prevent the application from running:
<Combobox options={...options} {...field} />

Property 'onChange' is missing in type '{ options: any; }' but required in type 'ComboboxProps'.ts(2741)

Since we are spreading the {...field} I guess this should be covered. The application works fine when I run pnpm run dev, but not when I run pnpm build

Error: Unauthorized when uploading an image at chapter UploadThing & Image Form

Hi there,
I am working on this LMS project which is awesome by the way and I am up to chapter UploadThing & Image Form. I have followed all the steps including adding env secret and app id for UploadThing but when I try to upload an image...

I get the following error: any ideas?

[UT] UploadThing dev server is now running!
Error: Unauthorized
    at handleAuth (webpack-internal:///(rsc)/./app/api/uploadthing/core.ts:15:41)
    at Object.eval [as middleware] (webpack-internal:///(rsc)/./app/api/uploadthing/core.ts:26:23)
    at eval (webpack-internal:///(rsc)/./node_modules/uploadthing/dist/chunk-LQBAB5WK.mjs:335:58)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.POST (webpack-internal:///(rsc)/./node_modules/uploadthing/dist/chunk-66XXRAVC.mjs:285:26)
    at async /Users/benjaminwaller/Projects/LMS-next/lms/node_modules/next/dist/compiled/next-server/app-route.runtime.dev.js:1:66877

Any ideas of a cause or for a solution?

Best regards,
Ben

Connecting to PlanetScale without ?sslaccept=strict leads to suboptimal error message

Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Datasource "db": MySQL database "blue-educational" at "aws.connect.psdb.cloud"

Error: Schema engine error:
unknown error: Code: UNAVAILABLE
server does not allow insecure connections, client must use SSL/TLS

This issue might appear on doing the npx prisma db push command.
To solve it you need to add "?sslaccept=strict" at the end of the planetscale URL in .env file

Configure vscode for tsx files

Hey Antonio, first, thanks so much for your great tutorials!

I keep on getting eslint errors in vscode for .tsx files, like this (see the errors in red):

image

Do you know how to configure vscode/eslint to avoid this?

teacher payment

Hi Antonio! Thank you so much for your work. I was wondering how you would implement a teacher payment for this? Did I miss that part where the teachers get paid for their course?

upload course img error

When i upload course img then error is Error parsing JSON, got '' and in terminal i got error TypeError: Cannot read properties of undefined (reading 'url')

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.