Skip to content

zaikaman2/WebThanhNhac

Repository files navigation

🎡 KienVocal - Online Vocal Training Platform

Next.js TypeScript Tailwind CSS Supabase PayOS

πŸš€ Modern online vocal training platform

Professional vocal training website by instructor Dinh Trung Kien - with 30+ years of teaching experience


🌟 Key Features

🎯 Online Learning

  • πŸ“š Structured Courses: Basic course (14 lessons) and intermediate level with detailed content
  • πŸŽ₯ High-Quality Videos: Seamless learning with integrated Vimeo player
  • πŸ“– Progress Tracking: System to mark completed lessons
  • πŸ’¬ Interactive Comments: Students can discuss and ask questions on each lesson

πŸ€– Smart AI Assistant

  • πŸ’­ Chatbot Consultation: 24/7 student support using Google Gemini AI
  • 🎯 Personalized Support: Answers questions about vocal techniques and courses
  • πŸ“ž Contact Information: Provides instructor information and schedules

πŸ’³ Payment & Management

  • πŸ’Έ Online Payment: PayOS integration supporting multiple payment methods
  • πŸ‘€ Account Management: Registration, login, and personal information management
  • πŸ” High Security: Secure user authentication with Supabase Auth

πŸ“ Educational Content

  • πŸ“° Vocal Blog: In-depth articles on singing techniques and methods
  • πŸ’‘ Practical Knowledge: Experience sharing from professional instructors
  • πŸ“± Responsive Design: User-friendly interface across all devices

πŸ› οΈ Tech Stack

Frontend - User Interface

  • ⚑ Next.js 15.0.3 - Modern React framework with App Router
  • 🎨 Tailwind CSS - Utility-first CSS framework
  • πŸ“± Responsive Design - Multi-device compatible design
  • 🎭 Lucide React - Beautiful icon library
  • πŸ”₯ React Hot Toast - User notifications

Backend & Database

  • πŸ—ƒοΈ Supabase - Cloud backend platform
  • πŸ”’ Supabase Auth - Secure authentication system
  • πŸ“Š PostgreSQL - Powerful relational database
  • πŸ” Prisma ORM - Type-safe database management tool

Integrations & AI

  • πŸ€– Google Gemini AI - Artificial intelligence for chatbot
  • πŸŽ₯ Vimeo Player - High-quality video streaming
  • πŸ’³ PayOS - Vietnamese payment gateway
  • πŸ“§ Email Templates - Automated email sending

πŸ—οΈ System Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚     Users       β”‚ ←→ β”‚   Next.js Web   β”‚ ←→ β”‚    Supabase     β”‚
β”‚  (Web/Mobile)   β”‚    β”‚   Application   β”‚    β”‚    Backend      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚                        β”‚
                              ↓                        ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Google Gemini  β”‚    β”‚      PayOS      β”‚    β”‚   PostgreSQL    β”‚
β”‚   AI Chatbot    β”‚    β”‚    Payment      β”‚    β”‚    Database     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚
                              ↓
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚  Vimeo Player   β”‚
                    β”‚  Video Learning β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“Š Database Schema

Core Tables

Table Description Features
Course Course management Dynamic pricing, multiple course types
Instructor Instructor information Achievements, detailed biography
Testimonial Student reviews User feedback system
Purchases Orders Payment status tracking

Interactive Tables

Table Description Features
profiles User information Personal account management
lesson_comments Lesson comments Hierarchical discussions with likes
videos Video management Vimeo ID integration

πŸš€ Getting Started

System Requirements

Node.js >= 18.0.0
npm >= 8.0.0
Supabase account (free)

Project Installation

# 1. Clone the repository
git clone https://github.com/zaikaman/webthanhnhac.git
cd webthanhnhac

# 2. Install dependencies
npm install

# 3. Setup environment variables
cp .env.example .env.local
# Configure Supabase, PayOS, and Google AI API

# 4. Run development server
npm run dev

Environment Variables

# Supabase Configuration
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
SUPABASE_SERVICE_KEY=your_service_key

# Google AI for Chatbot
NEXT_PUBLIC_GOOGLE_API_KEY=your_google_gemini_api_key

# PayOS for Payment
PAYOS_CLIENT_ID=your_payos_client_id
PAYOS_API_KEY=your_payos_api_key
PAYOS_CHECKSUM_KEY=your_payos_checksum_key

# Vimeo for Videos
VIMEO_ACCESS_TOKEN=your_vimeo_access_token

πŸ“ Project Structure

webthanhnhac/
β”œβ”€β”€ πŸ“‚ src/
β”‚   β”œβ”€β”€ πŸ“‚ app/                    # Main application (Next.js App Router)
β”‚   β”‚   β”œβ”€β”€ πŸ“‚ api/               # API endpoints
β”‚   β”‚   β”œβ”€β”€ πŸ“‚ auth/              # Authentication pages (login/register)
β”‚   β”‚   β”œβ”€β”€ πŸ“‚ courses/           # Course pages
β”‚   β”‚   β”œβ”€β”€ πŸ“‚ learn/             # Learning pages (videos)
β”‚   β”‚   β”œβ”€β”€ πŸ“‚ blog/              # Vocal blog
β”‚   β”‚   └── πŸ“‚ payment/           # Payment pages
β”‚   β”œβ”€β”€ πŸ“‚ components/            # Reusable React components
β”‚   β”‚   β”œβ”€β”€ πŸ“‚ home/              # Homepage components
β”‚   β”‚   β”œβ”€β”€ πŸ“‚ learn/             # Learning section
β”‚   β”‚   β”œβ”€β”€ πŸ“‚ shared/            # Shared UI components
β”‚   β”‚   └── πŸ“‚ layout/            # Header, Footer
β”‚   β”œβ”€β”€ πŸ“‚ lib/                   # Utility libraries
β”‚   β”œβ”€β”€ πŸ“‚ hooks/                 # Custom React hooks
β”‚   β”œβ”€β”€ πŸ“‚ contexts/              # React contexts
β”‚   └── πŸ“‚ content/               # Blog content (Markdown)
β”œβ”€β”€ πŸ“‚ public/                    # Static assets (images, icons)
└── πŸ“„ README.md                  # Project documentation

🎯 Technical Highlights

πŸ€– Smart AI Chatbot

// Google Gemini AI integration for 24/7 consultation
const genAI = new GoogleGenerativeAI(apiKey)
const response = await genAI.generateContent(userQuery)

// Smart response formatting
const formatResponse = (text: string) => {
  const sections = text.split('***').map(section => section.trim())
  return sections.map(section => formatSection(section))
}

πŸ’³ PayOS Payment System

// PayOS integration for Vietnamese payments
const createPaymentLink = async (courseData) => {
  const paymentLink = await payOS.createPaymentLink({
    orderCode: Number(String(Date.now()).slice(-6)),
    amount: courseData.price,
    description: courseData.title,
    returnUrl: `/payment/success`,
    cancelUrl: `/payment/cancel`
  })
}

πŸŽ₯ Custom Video Player

// Vimeo player with progress tracking
const VideoPlayer = ({ videoId, courseType, lessonId }) => {
  const handleTimeUpdate = (currentTime: number) => {
    // Update learning progress in real-time
    updateUserProgress(courseType, lessonId, currentTime)
  }
  
  const handleVideoComplete = () => {
    // Mark lesson as completed
    markLessonCompleted(courseType, lessonId)
  }
}

πŸ“ˆ Performance & Optimization

Website Speed

  • ⚑ LCP: < 2.5s (Largest Contentful Paint)
  • 🎯 FID: < 100ms (First Input Delay)
  • πŸ“ CLS: < 0.1 (Cumulative Layout Shift)

SEO Optimization

  • πŸ” Dynamic meta tags for each page
  • πŸ“± Mobile-first responsive design
  • πŸ—ΊοΈ Automatic XML sitemap generation
  • πŸ€– Structured data markup

Analytics & Monitoring

  • πŸ“Š Vercel Analytics integration
  • ⚑ Speed Insights performance tracking
  • πŸ‘₯ User behavior monitoring

πŸ”’ Security

  • πŸ›‘οΈ Row Level Security (RLS) on Supabase
  • πŸ” JWT Authentication for API protection
  • πŸ”’ Input validation and data sanitization
  • πŸ’³ Secure payments with PCI compliance

πŸš€ Deployment

Vercel (Recommended)

# Deploy to Vercel
npm i -g vercel
vercel --prod

Production Setup

# Production environment variables
NEXT_PUBLIC_SUPABASE_URL=production_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=production_key
# ... other production configs

🀝 Contributing

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

πŸ“ž Contact

πŸ‘¨β€πŸ’» Developer Information
πŸ“§ Email: zaikaman123@gmail.com
πŸ”— LinkedIn: https://www.linkedin.com/in/%C4%91inh-ph%C3%BAc-th%E1%BB%8Bnh-2561b5274/
πŸ™ GitHub: https://github.com/zaikaman
πŸ’Ό Portfolio: https://dinhphucthinh.vercel.app/


🎡 KienVocal - Vocal Instructor
πŸ‘¨β€πŸŽ€ Instructor: Dinh Trung Kien
πŸ“ž Phone: 0903100887
πŸ“§ Email: kienalai@gmail.com
πŸ† Experience: 30+ years in vocal training
🎯 Achievement: 1000+ successful students


πŸ“Š Project Statistics

  • 🎯 Feature Completion: 95%+
  • πŸ“¦ Bundle Size: Optimized < 500KB
  • ⚑ Load Time: < 3 seconds
  • πŸ”„ Uptime: 99.9%
  • πŸ‘₯ Users: Growing daily

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.


⭐ Star this repository if you find it helpful!

πŸ”” Watch for updates and new features

Made with ❀️ in Vietnam πŸ‡»πŸ‡³


πŸš€ Live Website

About

A website made for selling vocal courses

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages