CelestiumX / CelestiumX/SkillChain-Backend
Develop Service Storage and Basic Search
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
## 📚 Overview
Create a backend service to store freelance services in the PostgreSQL database and enable search functionality using full-text search.
If you need coordination or clarification, use the project’s [[Telegram Group](https://t.me/+YZEXOc_LOzIyYTgx)](https://t.me/+YZEXOc_LOzIyYTgx).
---
## 🔍 Background
This simplifies the MVP implementation by relying solely on PostgreSQL, enabling faster development and avoiding the complexity of integrating an external search engine.
---
## 🛠 Requirements
- Create a `ServiceManager` service in `src/services/service`
- Implement the following methods:
- `createService(data: ServiceInput)` — Saves a new service in the database
- `searchServices(query: string)` — Searches using PostgreSQL's full-text search
- Add full-text indexes on `name`, `description`, and `tags`
- Enable pagination (limit/offset)
- Add basic filters (e.g., service type, country, price)
---
## 🔧 Implementation Plan
### 1. Create Feature Branch
```bash
git checkout -b feature-service-manager-[issue-number]
```
### 2. Schema and Indexing
- Add full-text indexes to `services` table columns: `name`, `description`, `tags`
- Ensure schema supports all necessary fields for filtering
### 3. Create & Store Services
- Implement `createService(data: ServiceInput)` method
- Validate and sanitize input before insertion
### 4. Full-Text Search
- Use PostgreSQL’s `to_tsvector` and `plainto_tsquery` for basic matching
- Support partial matches and ordering by relevance
### 5. Pagination and Filters
- Implement `limit` and `offset`
- Support filters like `type`, `country`, `priceRange`
### 6. Testing
- Unit tests for creation and search (≥ 90% coverage)
- Test edge cases: no results, malformed queries, pagination limits
### 7. Commit and Push
```bash
git add .
git commit -m "Feature: ServiceManager with full-text search and storage"
git push origin feature-service-manager-[issue-number]
```
---
## ✅ Definition of Done
- [ ] Services can be created and stored successfully
- [ ] Search returns relevant results
- [ ] Pagination and filters work as expected
- [ ] Unit test coverage ≥ 90%
- [ ] Pull request meets template standards
---
## 📆 Timeframe
3 days
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.