An intelligent online learning platform powered by AI that enables users to create, explore, and learn from AI-generated courses.
- AI-Powered Course Generation: Automatically generate course structure and content using AI
- User Authentication: Secure sign-up and sign-in with Clerk
- Course Management: Create, edit, and manage courses with ease
- Course Enrollment: Browse and enroll in courses from the exploration section
- Interactive Learning: View course content with chapter-based navigation
- User Dashboard: Personalized workspace with your created and enrolled courses
- Billing Integration: Built-in billing and subscription management
- Responsive Design: Fully responsive UI for desktop and mobile devices
- Framework: Next.js 14+ with App Router
- Styling: Tailwind CSS with custom components
- Database: Drizzle ORM with PostgreSQL
- Authentication: Clerk
- UI Components: Custom component library with shadcn/ui patterns
- Form Handling: React forms with validation
- Middleware: Custom Next.js middleware for protected routes
- Node.js 18+
- npm or yarn package manager
- PostgreSQL database
- Clerk API keys (for authentication)
# Clone the repository
git clone <repository-url>
cd online-ai-platform
# Install dependencies
npm install
# or
yarn install
# or
pnpm installCreate a .env.local file in the root directory and add:
# Clerk Authentication
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your_key_here
CLERK_SECRET_KEY=your_secret_here
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up
# Database
DATABASE_URL=your_postgresql_url
# API Configuration
NEXT_PUBLIC_API_URL=http://localhost:3000# Run migrations
npm run db:push
# or
yarn db:pushnpm run dev
# or
yarn dev
# or
pnpm devOpen http://localhost:3000 in your browser to see the application.
app/
├── (auth)/ # Authentication pages
│ ├── sign-in/
│ └── sign-up/
├── api/ # API routes
│ ├── courses/
│ ├── enroll-course/
│ ├── generate-course-content/
│ ├── generate-course-layout/
│ └── user/
├── course/ # Course viewing
│ ├── _components/
│ └── [courseId]/
└── workspace/ # User dashboard
├── _components/
├── billing/
├── edit-course/
├── explore/
├── my-learning/
├── profile/
└── view-course/
components/ # Reusable UI components
config/ # Configuration files (DB, Schema)
context/ # React Context for state management
hooks/ # Custom React hooks
lib/ # Utility functions
public/ # Static assets
Users can create new courses and let AI generate the course structure and content automatically.
Browse and discover courses created by other users in the explore section.
Access your created and enrolled courses from a centralized workspace.
Manage user profile, preferences, and account settings.
Organized course content with chapter navigation for better learning experience.
POST /api/courses- Create a new coursePOST /api/enroll-course- Enroll in a coursePOST /api/generate-course-layout- Generate course structurePOST /api/generate-course-content- Generate course contentGET /api/user- Get user details
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
For issues and questions, please open an issue on the GitHub repository.