Related Projects Recommendation
Recommend related projects based on a specified project.
Interface Information
- Endpoint:
GET /api/projects/:id/related - Authentication: Not required
- Content-Type:
application/json
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | number | Yes | Project ID |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| limit | number | No | Number of results, default 5 |
Recommendation Logic
- Based on technology stack similarity
- Based on same category
- Excludes the current project itself
Request Examples
bash
# Get related recommendations for project 1 (default 5)
curl http://localhost:3000/api/projects/1/related
# Get related recommendations for project 1 (10)
curl http://localhost:3000/api/projects/1/related?limit=10Response Example
json
{
"success": true,
"data": [
{
"id": 2,
"title": "E-commerce Management System",
"description": "Vue 3 + Element Plus backend management system",
"coverImage": "https://example.com/project2.jpg",
"techStack": ["Vue.js", "TypeScript", "Element Plus"],
"likeCount": 38,
"viewCount": 189
}
]
}Error Responses
| HTTP Status Code | Description |
|---|---|
| 404 | Project does not exist |
| 500 | Server error |