Demo project. NestJS v11 backend service that fetches data from all available SkillsMP APIs.
All SkillsMP APIs Implemented:
- ✅ Keyword Search (
GET /skills/search) - Search skills using text queries with pagination - ✅ AI Semantic Search (
GET /skills/ai-search) - AI-powered semantic search (Cloudflare AI)
# Install dependencies
npm install
# Setup environment variables
cp .env.example .env
# Edit .env with your API keySKILLSMP_API_KEY=sk_live_your_api_key_here
SKILLSMP_API_URL=https://skillsmp.com/api/v1
PORT=3000# Development
npm run start:dev
# Production
npm run build
npm run start:prodSearch skills using keywords with pagination.
Parameters:
| Param | Type | Required | Description |
|---|---|---|---|
q |
string | ✅ | Search query |
page |
number | ❌ | Page number (default: 1) |
limit |
number | ❌ | Items per page (default: 20, max: 100) |
sortBy |
string | ❌ | Sort: stars or recent |
Example:
curl "http://localhost:3000/skills/search?q=SEO&page=1&limit=20&sortBy=stars"Response:
{
"success": true,
"data": {
"skills": [
{
"id": "123",
"name": "SEO Optimizer",
"description": "Optimize your website",
"stars": 45,
"updatedAt": "2024-01-15T10:30:00Z"
}
],
"pagination": {
"page":1,
"limit": 20,
"total": 150
}
}
}AI semantic search powered by Cloudflare AI.
Parameters:
| Param | Type | Required | Description |
|---|---|---|---|
q |
string | ✅ | AI search query |
Example:
curl "http://localhost:3000/skills/ai-search?q=How+to+create+a+web+scraper"Response:
{
"success": true,
"data": {
"data": [
{
"file_id": "...",
"score": 0.72,
"skill": {
"id": "456",
"name": "Web Scraper Pro",
"description": "Advanced web scraping with AI",
"stars": 78
}
}
]
}
}Tests API endpoints with debug logging.
npm run test:e2eManual testing script using curl commands with full request/response logging.
Purpose: Test all endpoints using bash curl commands with complete debug output, including request URLs(api) and response data/error for developers to integrate and verify.
Usage:
# Start server first
npm run start:dev
# Run bash test script
./test/e2e_bash.test.shWhat it logs:
- Full request URL with all parameters
- HTTP response status
- Response success flag
- Returned data (count, pagination, first result)
- Error details (if applicable)
Note: Review debug logs to verify full request URLs and responses.
GET /skills/search (5 tests):
- Required parameter only
- With pagination (page, limit)
- With all parameters combined
- Empty results when no matches
- Invalid sortBy value handling
GET /skills/ai-search (4 tests):
- Valid query
- Short query
- Long query
- Missing query parameter
All errors follow this format:
{
"success": false,
"error": {
"code": "INVALID_API_KEY",
"message": "The provided API key is invalid"
}
}Error Codes:
| Code | HTTP | Description |
|---|---|---|
MISSING_API_KEY |
401 | API key not provided |
INVALID_API_KEY |
401 | Invalid API key |
MISSING_QUERY |
400 | Missing required query parameter |
INTERNAL_ERROR |
500 | Internal server error |
# Build
npm run build
# Format
npm run format
# Lint
npm run lint
# Test
npm run testsrc/modules/skills/
├── skills.controller.ts # HTTP endpoints
├── skills.service.ts # SkillsMP API client
├── skills.dto.ts # TypeScript types
└── skills.module.ts # NestJS module
UNLICENSED