mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-28 10:17:44 +02:00
feat(search): implement mana-search microservice
Central search microservice for all ManaCore apps featuring: - NestJS API on port 3021 - SearXNG meta-search engine integration (40+ search engines) - Redis caching layer for search results and extracted content - Content extraction with markdown conversion - Prometheus metrics for monitoring API Endpoints: - POST /api/v1/search - Web search with categories/engines - POST /api/v1/extract - Content extraction from URLs - POST /api/v1/extract/bulk - Bulk extraction - GET /health - Health check - GET /metrics - Prometheus metrics Search categories: general, news, science, it, images, videos Supported engines: Google, Bing, DuckDuckGo, Wikipedia, arXiv, GitHub, StackOverflow, and many more. https://claude.ai/code/session_01Rk3YVJCU3nM8uvVPghRz6r
This commit is contained in:
parent
590529c547
commit
bd72b4d6d5
35 changed files with 2219 additions and 0 deletions
31
services/mana-search/src/extract/extract.controller.ts
Normal file
31
services/mana-search/src/extract/extract.controller.ts
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
import { Controller, Post, Body, Logger } from '@nestjs/common';
|
||||
import { ExtractService } from './extract.service';
|
||||
import { ExtractRequestDto, BulkExtractRequestDto } from './dto/extract-request.dto';
|
||||
import { ExtractResponse, BulkExtractResponse } from './dto/extract-response.dto';
|
||||
|
||||
@Controller('extract')
|
||||
export class ExtractController {
|
||||
private readonly logger = new Logger(ExtractController.name);
|
||||
|
||||
constructor(private readonly extractService: ExtractService) {}
|
||||
|
||||
/**
|
||||
* Extract content from a URL
|
||||
* POST /api/v1/extract
|
||||
*/
|
||||
@Post()
|
||||
async extract(@Body() request: ExtractRequestDto): Promise<ExtractResponse> {
|
||||
this.logger.log(`Extract request: ${request.url}`);
|
||||
return this.extractService.extract(request);
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract content from multiple URLs
|
||||
* POST /api/v1/extract/bulk
|
||||
*/
|
||||
@Post('bulk')
|
||||
async bulkExtract(@Body() request: BulkExtractRequestDto): Promise<BulkExtractResponse> {
|
||||
this.logger.log(`Bulk extract request: ${request.urls.length} URLs`);
|
||||
return this.extractService.bulkExtract(request);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue