http://localhost:3000
- GET
/api/v1/health- Kiểm tra trạng thái ứng dụng
- POST
/api/v1/auth/register- Đăng ký tài khoản mới - POST
/api/v1/auth/login- Đăng nhập - POST
/api/v1/auth/google- Đăng nhập với Google - POST
/api/v1/auth/refresh- Làm mới token - GET
/api/v1/auth/me- Lấy thông tin user hiện tại - POST
/api/v1/auth/logout- Đăng xuất
- GET
/api/v1/users- Lấy danh sách tất cả users - GET
/api/v1/users/:id- Lấy thông tin user theo ID - POST
/api/v1/users- Tạo user mới - PUT
/api/v1/users/:id- Cập nhật thông tin user - DELETE
/api/v1/users/:id- Xóa user
- GET
/api/v1/projects- Lấy danh sách projects của user hiện tại - POST
/api/v1/projects- Tạo project mới - GET
/api/v1/projects/:id- Lấy thông tin chi tiết project - DELETE
/api/v1/projects/:id- Xóa project
- GET
/api/v1/projects/:projectId/resources/check-name?name=xxx- Kiểm tra tên resource có sẵn trong project - POST
/api/v1/projects/:projectId/resources- Tạo resource mới trong project - GET
/api/v1/projects/:projectId/resources- Lấy danh sách resources của project - GET
/api/v1/resources/:resourceId- Lấy chi tiết resource - DELETE
/api/v1/resources/:resourceId- Xóa resource
POST /api/v1/auth/register
Content-Type: application/json
{
"email": "user@example.com",
"password": "password123",
"name": "John Doe"
}POST /api/v1/auth/login
Content-Type: application/json
{
"email": "user@example.com",
"password": "password123"
}GET /api/v1/auth/me
Authorization: Bearer YOUR_ACCESS_TOKENPOST /api/v1/auth/refresh
Content-Type: application/json
{
"refreshToken": "YOUR_REFRESH_TOKEN"
}POST /api/v1/auth/logout
Authorization: Bearer YOUR_ACCESS_TOKENPOST /api/v1/users
Content-Type: application/json
Authorization: Bearer YOUR_ACCESS_TOKEN
{
"email": "newuser@example.com",
"name": "New User"
}POST /api/v1/projects
Content-Type: application/json
Authorization: Bearer YOUR_ACCESS_TOKEN
{
"name": "My New Project"
}GET /api/v1/projects
Authorization: Bearer YOUR_ACCESS_TOKENGET /api/v1/projects/:id
Authorization: Bearer YOUR_ACCESS_TOKENDELETE /api/v1/projects/:id
Authorization: Bearer YOUR_ACCESS_TOKENGET /api/v1/projects/:projectId/resources/check-name?name=users
Authorization: Bearer YOUR_ACCESS_TOKENResponse khi available:
{
"available": true
}Response khi không available:
{
"available": false,
"message": "Resource name \"users\" already exists in this project"
}POST /api/v1/projects/:projectId/resources
Content-Type: application/json
Authorization: Bearer YOUR_ACCESS_TOKEN
{
"name": "users"
}Note: Name phải tuân theo format chuẩn API endpoint (lowercase, alphanumeric + hyphens/underscores). Name phải unique trong project. Nếu trùng sẽ nhận lỗi 409 Conflict.
GET /api/v1/projects/:projectId/resources
Authorization: Bearer YOUR_ACCESS_TOKENGET /api/v1/resources/:resourceId
Authorization: Bearer YOUR_ACCESS_TOKENDELETE /api/v1/resources/:resourceId
Authorization: Bearer YOUR_ACCESS_TOKEN