A modern Learning Management System built with Next.js, TypeScript, and Express, organized as a pnpm monorepo.
LMSFrontEnd/
├── apps/
│ ├── web/ # Next.js frontend application
│ │ ├── src/
│ │ │ ├── app/ # App Router pages
│ │ │ ├── components/ # React components
│ │ │ └── lib/ # Utility functions
│ │ ├── package.json
│ │ ├── next.config.js
│ │ ├── tailwind.config.js
│ │ └── tsconfig.json
│ └── api/ # Express.js backend API
│ ├── src/
│ │ ├── controllers/ # Route controllers
│ │ ├── middleware/ # Express middleware
│ │ ├── routes/ # API routes
│ │ ├── services/ # Business logic
│ │ └── utils/ # Utility functions
│ ├── prisma/ # Database schema and migrations
│ ├── package.json
│ └── tsconfig.json
├── packages/
│ ├── ui/ # Shared UI components (shadcn/ui)
│ │ ├── src/
│ │ │ ├── components/ # React components
│ │ │ └── lib/ # Utility functions
│ │ ├── package.json
│ │ ├── tailwind.config.js
│ │ └── tsconfig.json
│ └── types/ # Shared TypeScript types
│ ├── src/
│ │ └── index.ts # Type definitions
│ ├── package.json
│ └── tsconfig.json
├── package.json # Root package.json
├── pnpm-workspace.yaml # pnpm workspace configuration
└── README.md
- Node.js 18+
- pnpm 8+
- PostgreSQL database
-
Clone the repository
git clone <repository-url> cd LMSFrontEnd
-
Install dependencies
pnpm install
-
Set up environment variables
# Copy environment files cp apps/api/env.example apps/api/.env cp apps/web/env.example apps/web/.env # Edit the files with your configuration # - Set up your PostgreSQL database URL # - Configure JWT secrets # - Set NextAuth secrets
-
Set up the database
# Generate Prisma client pnpm db:generate # Push schema to database pnpm db:push
-
Start development servers
# Start all applications pnpm dev # Or start individually: pnpm --filter web dev # Frontend (http://localhost:3000) pnpm --filter api dev # Backend (http://localhost:3001)
pnpm dev- Start all applications in development modepnpm build- Build all applicationspnpm lint- Run linting across all packagespnpm type-check- Run TypeScript type checkingpnpm clean- Clean all build artifacts
pnpm db:generate- Generate Prisma clientpnpm db:push- Push schema changes to databasepnpm db:migrate- Run database migrationspnpm db:studio- Open Prisma Studio
- Next.js 14 - React framework with App Router
- TypeScript - Type safety
- Tailwind CSS - Utility-first CSS framework
- shadcn/ui - Modern UI components
- NextAuth.js - Authentication
- Express.js - Node.js web framework
- TypeScript - Type safety
- Prisma - Database ORM
- PostgreSQL - Database
- JWT - Authentication tokens
- bcryptjs - Password hashing
- @lms/ui - Reusable UI components
- @lms/types - Shared TypeScript types
The application uses PostgreSQL with the following main entities:
- Users - Students, instructors, and admins
- Courses - Learning content with lessons
- Lessons - Individual learning units
- Enrollments - Student course registrations
- Progress - Student lesson completion tracking
The system supports multiple user roles:
- Student - Can enroll in courses and track progress
- Instructor - Can create and manage courses
- Admin - Full system access
Authentication is handled via NextAuth.js with JWT tokens.
The UI package includes pre-built components from shadcn/ui:
- Buttons, inputs, forms
- Cards, modals, dialogs
- Navigation, dropdowns
- Progress indicators
- And more...
- Use TypeScript for all new code
- Follow ESLint configuration
- Use Prettier for code formatting
- Write meaningful commit messages
- Use workspace dependencies (
workspace:*) for internal packages - Keep dependencies up to date
- Use exact versions for critical packages
- Always create migrations for schema changes
- Test migrations on development data first
- Document breaking changes
- Connect your repository
- Set environment variables
- Deploy automatically on push
- Connect your repository
- Set environment variables
- Configure PostgreSQL database
- Deploy automatically on push
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License.
For support and questions:
- Create an issue in the repository
- Check the documentation
- Review existing issues and discussions