This directory contains Bruno API collections for testing VRecommendSystem endpoints.
Bruno is a fast, git-friendly, open-source API client. This collection provides ready-to-use API requests for all VRecommendSystem endpoints.
Download and install Bruno from: https://www.usebruno.com/
- Launch Bruno
- Click "Open Collection"
- Navigate to this directory (
vrecom_api/) - Click "Select Folder"
The collection uses the following default URLs:
- API Server:
http://localhost:2030 - AI Server:
http://localhost:9999
Update the URLs in individual requests if your ports differ.
vrecom_api/
├── api_server/ # API Server endpoints
│ ├── auth/ # Authentication (Google OAuth)
│ │ ├── login_google.bru
│ │ ├── check_auth_status.bru
│ │ └── logout.bru
│ ├── recommendations/ # Get recommendations
│ │ └── recommend.bru
│ └── ping.bru # Health check
│
└── ai_server/ # AI Server endpoints
├── models/ # Model management
│ ├── create_model.bru
│ ├── list_models.bru
│ ├── get_model_info.bru
│ └── delete_model.bru
├── tasks/ # Task scheduler
│ ├── add_model_task.bru
│ ├── list_tasks.bru
│ ├── remove_model_task.bru
│ ├── rename_task.bru
│ └── update_task_interval.bru
├── data_chefs/ # Data pipelines
│ ├── create_data_chef_from_csv.bru
│ ├── create_data_chef_from_sql.bru
│ ├── list_data_chefs.bru
│ ├── get_data_chef.bru
│ └── delete_data_chef.bru
├── scheduler/ # Scheduler control
│ ├── stop_scheduler.bru
│ └── restart_scheduler.bru
├── metrics/ # System metrics
│ ├── get_total_running_tasks.bru
│ ├── get_total_activated_tasks.bru
│ ├── get_total_activating_models.bru
│ ├── get_scheduler_status.bru
│ └── get_server_logs.bru
├── recommendations/ # Get recommendations
│ └── recommend.bru
├── health.bru # Health check
└── main.bru # Root endpoint
# Start all services with Docker
./docker-start.sh up
# Or start individually
cd backend/api_server && go run main.go
cd backend/ai_server && poetry run server- API Server:
GET http://localhost:2030/api/v1/ping - AI Server:
GET http://localhost:9999/api/v1/health
Use ai_server/models/create_model.bru:
{
"model_id": "my_model",
"model_type": "svd",
"model_config": {
"n_factors": 100,
"n_epochs": 20,
"lr_all": 0.005,
"reg_all": 0.02
}
}Use ai_server/data_chefs/create_data_chef_from_csv.bru or SQL variant.
Use ai_server/tasks/add_model_task.bru:
{
"task_name": "daily_training",
"model_id": "my_model",
"interactions_data_chef_id": "interactions_chef",
"interval": "daily"
}Use ai_server/recommendations/recommend.bru:
GET /api/v1/recommend/user123/my_model/10
The API Server uses Google OAuth for authentication:
- Access
auth/login_google.bruto initiate OAuth flow - Complete Google authentication in browser
- Session cookie will be stored automatically
- Use
auth/check_auth_status.bruto verify session
The AI Server requires authentication token in request headers:
Authorization: Bearer <your-token>
POST /api/v1/create_model
{
"model_id": "svd_model",
"model_type": "svd",
"model_config": {
"n_factors": 100,
"n_epochs": 20
}
}POST /api/v1/create_model
{
"model_id": "nmf_model",
"model_type": "nmf",
"model_config": {
"n_factors": 50,
"n_epochs": 15
}
}POST /api/v1/create_data_chef_from_csv
{
"data_chef_id": "csv_interactions",
"file_path": "/data/interactions.csv",
"user_column": "user_id",
"item_column": "item_id",
"rating_column": "rating"
}POST /api/v1/add_model_task
{
"task_name": "hourly_training",
"model_id": "my_model",
"interactions_data_chef_id": "interactions_chef",
"interval": "hourly"
}Available intervals for scheduled tasks:
hourly: Every hourdaily: Every day at midnightweekly: Every weekmonthly: Every month- Custom cron expressions
- Total running tasks:
GET /api/v1/get_total_running_tasks - Active models:
GET /api/v1/get_total_activating_models - Scheduler status:
GET /api/v1/get_scheduler_status - Server logs:
GET /api/v1/get_server_logs?limit=100
Access Prometheus metrics at: http://localhost:9090
- Verify services are running:
./docker-start.sh status - Check port configuration in
.env - View service logs:
./docker-start.sh logs <service_name>
- Ensure you've completed OAuth flow for API Server
- Check token is present in request headers for AI Server
- Verify Redis is running for session storage
- Check data chef is properly configured
- Verify CSV/database connection
- Review AI Server logs:
./docker-start.sh logs ai_server
- Environment Variables: Use Bruno's environment feature to switch between dev/staging/prod
- Collections: Organize related requests into folders
- Pre-request Scripts: Add authentication token generation if needed
- Tests: Add response assertions for automated testing
- Version Control: Bruno collections are git-friendly - commit them!