Skip to content

CoderIshibuki/webxemphim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🎬 WebFilm — Nền Tảng Xem Phim Trực Tuyến

Nền tảng xem phim trực tuyến full-stack với giao diện hiện đại, hệ thống quản trị đầy đủ và streaming video tích hợp.


📌 Giới thiệu

WebFilm là ứng dụng web xem phim trực tuyến được xây dựng theo kiến trúc Client – Server tách biệt. Backend cung cấp REST API bằng ASP.NET Core, Frontend là giao diện thuần HTML/CSS/JavaScript. Dự án hỗ trợ quản lý phim, tập phim, người dùng, bình luận và có trang quản trị dành cho Admin.


✨ Tính năng nổi bật

👤 Người dùng

  • Đăng ký / Đăng nhập tài khoản (mật khẩu được mã hóa BCrypt)
  • Xem danh sách phim, tìm kiếm theo tên & diễn viên
  • Lọc phim theo thể loại, quốc gia, diễn viên, năm phát hành
  • Xem chi tiết phim, danh sách tập, streaming video trực tiếp
  • Bình luận trên từng bộ phim

🛡️ Admin

  • Dashboard thống kê: tổng phim, tập phim, người dùng
  • Top 5 phim xem nhiều nhất
  • Thêm / sửa / xóa phim và tập phim
  • Quản lý người dùng: xem danh sách, phân quyền, xóa tài khoản
  • Quản lý bình luận: xem toàn bộ và xóa bình luận vi phạm
  • Nhật ký hệ thống (System Log): ghi lại mọi thao tác của Admin

🗂️ Cấu trúc dự án

webxemphim/
├── webfilm/                  # Backend — ASP.NET Core Web API
│   ├── Controllers/
│   │   ├── MoviesController.cs    # API phim, tập phim, bình luận, tìm kiếm
│   │   ├── AdminController.cs     # API quản trị (CRUD phim, user, log)
│   │   └── AuthController.cs      # API đăng ký / đăng nhập
│   ├── Models/
│   │   ├── Movie.cs               # Model phim
│   │   ├── Episode.cs             # Model tập phim
│   │   ├── User.cs                # Model người dùng
│   │   ├── Comment.cs             # Model bình luận
│   │   ├── ActorProfile.cs        # Model diễn viên
│   │   └── SystemLog.cs           # Model nhật ký hệ thống
│   ├── Data/
│   │   └── AppDbContext.cs        # Entity Framework DbContext
│   ├── Migrations/                # EF Core Migrations
│   ├── appsettings.json           # Cấu hình kết nối SQL Server
│   ├── Program.cs                 # Cấu hình ứng dụng & middleware
│   ├── Dockerfile                 # Docker image cho backend
│   └── WebFilm.csproj
│
├── webfilm_ui/               # Frontend — HTML / CSS / JavaScript
│   ├── index.html                 # Trang chủ
│   ├── detail.html                # Trang chi tiết phim & xem phim
│   ├── genres.html                # Trang duyệt theo thể loại
│   ├── filter.html                # Trang lọc phim
│   ├── search.html                # Trang kết quả tìm kiếm
│   ├── countries.html             # Trang duyệt theo quốc gia
│   ├── actors.html                # Trang danh sách diễn viên
│   ├── admin.html                 # Trang quản trị Admin
│   ├── themes.html                # Trang chủ đề / giao diện
│   └── assets/
│       ├── css/style.css          # Stylesheet chính
│       └── js/app.js              # Logic JavaScript chính
│
└── listfilm/                 # Thư mục chứa file video (local storage)

🛠️ Công nghệ sử dụng

Thành phần Công nghệ
Backend ASP.NET Core (.NET 10), C#
ORM Entity Framework Core 10
Cơ sở dữ liệu Microsoft SQL Server
Bảo mật mật khẩu BCrypt.Net-Next
API Docs ASP.NET OpenAPI
Frontend HTML5, CSS3, JavaScript (Vanilla)
Icons Font Awesome 6
Container Docker

⚙️ Cài đặt & Chạy dự án

Yêu cầu


1. Clone repository

git clone https://github.com/CoderIshibuki/webxemphim.git
cd webxemphim

2. Cấu hình Backend

Mở file webfilm/appsettings.json và chỉnh chuỗi kết nối nếu cần:

{
  "ConnectionStrings": {
    "DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=WebFilmDb;Trusted_Connection=True;TrustServerCertificate=True;"
  }
}

3. Chạy Migration & khởi động Backend

cd webfilm

# Tạo database từ migrations
dotnet ef database update

# Chạy API server
dotnet run

API sẽ chạy tại: https://localhost:7xxx hoặc http://localhost:5xxx

4. Chạy Frontend

Mở thư mục webfilm_ui/ bằng bất kỳ static server nào, ví dụ:

# Dùng VS Code Live Server, hoặc:
cd webfilm_ui
npx serve .

Sau đó truy cập http://localhost:3000 (hoặc port tương ứng) trên trình duyệt.


🐳 Chạy bằng Docker

cd webfilm
docker build -t webfilm-api .
docker run -p 8080:8080 webfilm-api

🔌 API Endpoints

🎞️ Phim — /api/movies

Method Endpoint Mô tả
GET /api/movies Lấy danh sách tất cả phim
GET /api/movies/{id} Lấy chi tiết một phim
GET /api/movies/search?q=... Tìm kiếm phim theo tên / diễn viên
GET /api/movies/filter?category=&genre=&country=&actor= Lọc phim
GET /api/movies/play/{id} Stream video phim
GET /api/movies/{id}/episodes Lấy danh sách tập
GET /api/movies/{id}/comments Lấy bình luận của phim
POST /api/movies/{id}/comments Đăng bình luận
GET /api/movies/actors Lấy danh sách tất cả diễn viên

🔐 Xác thực — /api/auth

Method Endpoint Mô tả
POST /api/auth/register Đăng ký tài khoản
POST /api/auth/login Đăng nhập

🛡️ Admin — /api/admin

Method Endpoint Mô tả
GET /api/admin/dashboard/stats Thống kê tổng quan
GET /api/admin/users Danh sách người dùng
PUT /api/admin/users/{id}/role Cập nhật quyền người dùng
DELETE /api/admin/users/{id} Xóa người dùng
POST /api/admin/movies Thêm phim mới
PUT /api/admin/movies/{id} Sửa thông tin phim
DELETE /api/admin/movies/{id} Xóa phim
GET /api/admin/movies/{movieId}/episodes Lấy danh sách tập (admin)
POST /api/admin/movies/{movieId}/episodes Thêm tập phim
DELETE /api/admin/episodes/{id} Xóa tập phim
GET /api/admin/comments Xem toàn bộ bình luận
DELETE /api/admin/comments/{id} Xóa bình luận
GET /api/admin/logs Xem nhật ký hệ thống

📸 Giao diện

Trang Mô tả
index.html Trang chủ với hero banner & danh sách phim nổi bật
detail.html Chi tiết phim, player video, danh sách tập, bình luận
genres.html Duyệt phim theo thể loại
filter.html Lọc phim đa tiêu chí
actors.html Danh sách diễn viên & phim liên quan
countries.html Phân loại phim theo quốc gia
admin.html Bảng điều khiển quản trị toàn diện

🗄️ Database Schema

Movies         — Thông tin phim (title, genre, country, category, actors, ...)
Episodes       — Tập phim (movieId, episodeNumber, videoUrl)
Users          — Tài khoản (username, passwordHash, role)
Comments       — Bình luận (movieId, username, content)
SystemLogs     — Nhật ký Admin (action, details, timestamp)

🙏 Tác giả

Được phát triển bởi [Phát Trần]

Nếu thấy dự án hữu ích, hãy ⭐ Star để ủng hộ nhé!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors