Refactor API routes and remove unused endpoints

- Deleted the following API routes:
  - `upload-cover`
  - `truyen/[id]/chapters`
  - `truyen/[id]/comments`
  - `truyen/[id]/rate`
  - `truyen/suggest`
  - `user/bookmarks`
  - `user/recommendations`
  - `user/settings`

- Updated `chapter-client.tsx` and `novel-client.tsx` to handle error messages more gracefully.
- Adjusted pagination logic in `tim-kiem/page.tsx` to improve user experience.
- Added support for additional search parameters in the search functionality.
- Introduced API rewrites in `next.config.mjs` to route requests to a reader API.
This commit is contained in:
2026-03-30 11:35:03 +07:00
parent ffd177718f
commit f9bb247ff1
33 changed files with 178 additions and 4842 deletions
+5
View File
@@ -41,6 +41,9 @@ MONGODB_URI="mongodb://user:password@localhost:27017/reader?authSource=admin"
NEXTAUTH_SECRET="your-super-secret-key"
NEXTAUTH_URL="http://localhost:3000"
# API backend dùng chung cho web + mobile
READER_API_ORIGIN="http://localhost:8000"
# Cấu hình Google Login
GOOGLE_CLIENT_ID="your_google_client_id"
GOOGLE_CLIENT_SECRET="your_google_client_secret"
@@ -80,6 +83,8 @@ pnpm dev
```
Truy cập vào [http://localhost:3000](http://localhost:3000) để xem ứng dụng.
Lưu ý: các endpoint user-facing đã migrate (`/api/genres`, `/api/novels/*`, `/api/truyen/*`, `/api/chapters/*`, `/api/user/*`, `/api/auth/mobile-login`) sẽ được proxy sang `READER_API_ORIGIN`.
---
## 🏗 Hướng dẫn Build