A modern web application that crawls product information from Trendyol, transforms it using AI, and allows you to save and manage your product collection.
- Product Crawling: Easily fetch product details from Trendyol URLs
- AI Transformation: Transform product information using OpenAI's GPT-4
- Product Management: Save and view your transformed products
- Modern UI: Clean and responsive interface built with Material-UI
- Multi-language Support: Product details are translated to English
- .NET 9.0 SDK
- Node.js (version 16.0 or later)
- OpenAI API Key
- API Key for authentication
TrendyolProductAPI/ # Backend API project
├── Controllers/ # API endpoints
├── Models/ # Data models
├── Services/ # Business logic
├── Middleware/ # Custom middleware
└── Extensions/ # Extension methods
frontend/ # React frontend
├── src/
│ ├── components/ # React components
│ ├── services/ # API integration
│ └── App.tsx # Main application
git clone <repository-url>
cd <repository-name>- Navigate to the API project:
cd TrendyolProductAPI- Verify .NET version:
dotnet --version
# Should show 9.0.x- Install dependencies:
dotnet restore- Configure API Keys:
Create or update
appsettings.json:
{
"ApiKey": "your-api-key",
"OpenAI": {
"ApiKey": "your-openai-api-key",
"Model": "gpt-4-1106-preview"
}
}- Navigate to the frontend directory:
cd frontend- Install dependencies:
npm install- Update API configuration:
In
src/services/api.ts, update the API key and base URL if needed.
cd TrendyolProductAPI
dotnet runThe API will be available at http://localhost:5121
cd frontend
npm run devThe application will be available at http://localhost:5173
- Click "Add New Product" or navigate to the Crawl page
- Enter a Trendyol product URL (e.g., https://www.trendyol.com/brand/product-p-123456)
- Click "Crawl Product"
- After crawling, you'll see the product details
- Click "Transform Product"
- The AI will:
- Translate to English
- Generate a description
- Assign a quality score
- Save transformed products
- View all products in the list
- Sort by AI score
- View detailed information
POST /api/Product/crawl
- Body: Product URL
- Header: X-API-Key
POST /api/Product/transform/{sku}
- Path: SKU
- Header: X-API-Key
POST /api/Product/save
- Body: Product object
- Header: X-API-Key
GET /api/Product
- Header: X-API-Key
GET /api/Product/{sku}
- Path: SKU
- Header: X-API-Key
- HtmlAgilityPack (1.11.54)
- OpenAI (1.7.2)
- Microsoft.AspNetCore.OpenApi (9.0.0)
- Swashbuckle.AspNetCore (6.5.0)
- React 18
- Material-UI
- React Router
- Axios
cd TrendyolProductAPI
dotnet watch runcd frontend
npm run devThe application includes comprehensive error handling for:
- Invalid URLs
- Network issues
- API rate limits
- Missing products
- Authentication errors
- API Key authentication required for all endpoints
- OpenAI API key stored securely in backend
- CORS configured for frontend access
- Request/Response logging
- Input validation
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is licensed under the MIT License.
The application requires two API keys to function:
-
Application API Key: Used for authenticating requests between the frontend and backend
- Set this in
TrendyolProductAPI/appsettings.jsonasApiKey - Set the same key in
frontend/src/services/api.tsasAPI_KEY
- Set this in
-
OpenAI API Key: Used for AI-powered product transformations
- Set this in
TrendyolProductAPI/appsettings.jsonunderOpenAI:ApiKey
- Set this in
For security:
- Never commit real API keys to version control
- Use the sample configuration file (
appsettings.sample.json) as a template - Keep your API keys secure and rotate them regularly