diff --git a/.env.example b/.env.example index 425c338..1421b3d 100644 --- a/.env.example +++ b/.env.example @@ -7,11 +7,11 @@ CORS_ORIGINS=["*"] # Firestore settings FIRESTORE_PROJECT_ID=gen-lang-client-0424120530 -FIRESTORE_DATABASE_NAME=sereact-imagedb +FIRESTORE_DATABASE_NAME=contoso-imagedb FIRESTORE_CREDENTIALS_FILE=firestore-credentials.json # Google Cloud Storage settings -GCS_BUCKET_NAME=sereact-images +GCS_BUCKET_NAME=contoso-images GCS_CREDENTIALS_FILE=firestore-credentials.json # Security settings diff --git a/ProjectRequirements.md b/ProjectRequirements.md index c209caa..c3781c7 100644 --- a/ProjectRequirements.md +++ b/ProjectRequirements.md @@ -1,4 +1,4 @@ -Sereact GmbH +Contoso GmbH Assignment Image Management API - Coding Challenge diff --git a/README.md b/README.md index 3646127..317646b 100644 --- a/README.md +++ b/README.md @@ -186,11 +186,11 @@ Uses Google's Vertex AI multimodal embedding model for generating high-quality i # Firestore settings FIRESTORE_PROJECT_ID=gen-lang-client-0424120530 - FIRESTORE_DATABASE_NAME=sereact-imagedb + FIRESTORE_DATABASE_NAME=contoso-imagedb FIRESTORE_CREDENTIALS_FILE=firestore-credentials.json # Google Cloud Storage settings - GCS_BUCKET_NAME=sereact-images + GCS_BUCKET_NAME=contoso-images GCS_CREDENTIALS_FILE=firestore-credentials.json # Security settings @@ -324,7 +324,7 @@ source venv/Scripts/activate && python scripts/run_tests.py all ## API Modules Architecture -The SEREACT API is organized into the following key modules to ensure separation of concerns and maintainable code: +The CONTOSO API is organized into the following key modules to ensure separation of concerns and maintainable code: ``` src/ diff --git a/client/README.md b/client/README.md index 6fe6eed..2a762cd 100644 --- a/client/README.md +++ b/client/README.md @@ -1,6 +1,6 @@ -# SeReact Frontend Client +# Contoso Frontend Client -A modern, responsive web frontend for the SeReact AI-powered image management platform. This is a pure frontend application that communicates directly with your SeReact backend API. +A modern, responsive web frontend for the Contoso AI-powered image management platform. This is a pure frontend application that communicates directly with your Contoso backend API. ## Features @@ -24,7 +24,7 @@ A modern, responsive web frontend for the SeReact AI-powered image management pl ### Prerequisites -- A running SeReact backend API server +- A running Contoso backend API server - Modern web browser (Chrome, Firefox, Safari, Edge) - Web server to serve static files (optional for development) @@ -32,8 +32,8 @@ A modern, responsive web frontend for the SeReact AI-powered image management pl 1. **Download/Clone the frontend files**: ```bash - # If you have the full SeReact repository - cd sereact/client + # If you have the full Contoso repository + cd contoso/client # Or download just the client folder ``` @@ -67,7 +67,7 @@ A modern, responsive web frontend for the SeReact AI-powered image management pl 1. **Configure API Connection**: - Click "Configure Now" in the welcome dialog - - Enter your SeReact API base URL (e.g., `http://localhost:8000`) + - Enter your Contoso API base URL (e.g., `http://localhost:8000`) - Enter your API key - Test the connection @@ -82,7 +82,7 @@ A modern, responsive web frontend for the SeReact AI-powered image management pl The frontend stores configuration in browser localStorage: -- **API Base URL**: The URL of your SeReact backend (e.g., `http://localhost:8000`) +- **API Base URL**: The URL of your Contoso backend (e.g., `http://localhost:8000`) - **API Key**: Your authentication key for the backend API ### Environment Variables @@ -176,7 +176,7 @@ For proper routing with hash-based navigation, no special server configuration i ### CORS Configuration -Ensure your SeReact backend API is configured to allow requests from your frontend domain: +Ensure your Contoso backend API is configured to allow requests from your frontend domain: ```python # In your backend CORS configuration @@ -263,8 +263,8 @@ For issues and questions: 1. Check the browser console for error messages 2. Verify backend API is running and accessible 3. Check network connectivity and CORS configuration -4. Review the SeReact backend documentation +4. Review the Contoso backend documentation ## License -This frontend client is part of the SeReact project. See the main project license for details. \ No newline at end of file +This frontend client is part of the Contoso project. See the main project license for details. \ No newline at end of file diff --git a/client/debug.html b/client/debug.html index f0536d3..7941a0b 100644 --- a/client/debug.html +++ b/client/debug.html @@ -3,7 +3,7 @@ - SeReact Debug + Contoso Debug -

SeReact Debug Page

+

Contoso Debug Page

Debug Controls

diff --git a/client/index.html b/client/index.html index 494821b..8c5de90 100644 --- a/client/index.html +++ b/client/index.html @@ -3,7 +3,7 @@ - SeReact - AI-Powered Image Management + Contoso - AI-Powered Image Management @@ -13,7 +13,7 @@
-
- - ${Math.round(similarity * 100)}% match - -
${escapeHtml(truncateText(image.description || 'Untitled', 60))}
@@ -274,7 +269,7 @@ async function shareSearchResults(query) { if (navigator.share) { try { await navigator.share({ - title: 'SeReact Search Results', + title: 'Contoso Search Results', text: text, url: url }); diff --git a/client/js/ui.js b/client/js/ui.js index 25dbcc8..19b4926 100644 --- a/client/js/ui.js +++ b/client/js/ui.js @@ -43,8 +43,8 @@ function showPage(pageId) { updateNavActiveState(pageId); // Update app state - if (window.SeReactApp) { - window.SeReactApp.currentPage = pageId; + if (window.ContosoApp) { + window.ContosoApp.currentPage = pageId; } app.currentPage = pageId; // Also update the local app state @@ -329,8 +329,8 @@ function initializeUI() { console.log('Initial page:', initialPage); // Set initial app state - if (window.SeReactApp) { - window.SeReactApp.currentPage = initialPage; + if (window.ContosoApp) { + window.ContosoApp.currentPage = initialPage; } showPage(initialPage); diff --git a/client/requirements.txt b/client/requirements.txt index 2707298..b8f0316 100644 --- a/client/requirements.txt +++ b/client/requirements.txt @@ -1,4 +1,4 @@ -# SeReact Frontend Client +# Contoso Frontend Client # # This is a pure frontend application that runs in the browser. # No Python dependencies are required. diff --git a/client/serve.py b/client/serve.py index 6c276d2..038c5e1 100644 --- a/client/serve.py +++ b/client/serve.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 """ -Simple HTTP server for serving the SeReact frontend during development. +Simple HTTP server for serving the Contoso frontend during development. """ import http.server @@ -44,7 +44,7 @@ def main(): with socketserver.TCPServer((HOST, PORT), CustomHTTPRequestHandler) as httpd: server_url = f"http://{HOST}:{PORT}" - print(f"๐Ÿš€ SeReact Frontend Development Server") + print(f"๐Ÿš€ Contoso Frontend Development Server") print(f"๐Ÿ“ Serving files from: {os.getcwd()}") print(f"๐ŸŒ Server running at: {server_url}") print(f"๐Ÿ“ฑ Open in browser: {server_url}") @@ -69,7 +69,7 @@ def main(): httpd.serve_forever() except KeyboardInterrupt: print("\n๐Ÿ›‘ Server stopped by user") - print("๐Ÿ‘‹ Thanks for using SeReact!") + print("๐Ÿ‘‹ Thanks for using Contoso!") if __name__ == "__main__": main() \ No newline at end of file diff --git a/client/styles.css b/client/styles.css index 01b3383..6e8908e 100644 --- a/client/styles.css +++ b/client/styles.css @@ -1,4 +1,4 @@ -/* Custom styles for SeReact Frontend */ +/* Custom styles for Contoso Frontend */ :root { --primary-color: #0d6efd; diff --git a/client/test.html b/client/test.html index a4bed01..8e50c5e 100644 --- a/client/test.html +++ b/client/test.html @@ -3,7 +3,7 @@ - SeReact Test + Contoso Test -

SeReact Navigation Test

+

Contoso Navigation Test

diff --git a/deployment/cloud-function/main.py b/deployment/cloud-function/main.py index 8584afa..f0d8f1a 100644 --- a/deployment/cloud-function/main.py +++ b/deployment/cloud-function/main.py @@ -44,7 +44,7 @@ else: storage_client = storage.Client() # Get bucket name from environment variable -GCS_BUCKET_NAME = os.environ.get('GCS_BUCKET_NAME', 'sereact-images') +GCS_BUCKET_NAME = os.environ.get('GCS_BUCKET_NAME', 'contoso-images') # Initialize Qdrant QDRANT_HOST = os.environ.get('QDRANT_HOST', 'localhost') diff --git a/deployment/deploy.sh b/deployment/deploy.sh index a7c36fd..9f34635 100644 --- a/deployment/deploy.sh +++ b/deployment/deploy.sh @@ -2,9 +2,9 @@ set -e # Configuration -IMAGE_NAME="sereact-api" +IMAGE_NAME="contoso-api" REGION="us-central1" -SERVICE_NAME="sereact" +SERVICE_NAME="contoso" # Get project ID from terraform.tfvars if it exists, otherwise use gcloud if [ -f "$(dirname "$0")/terraform/terraform.tfvars" ]; then diff --git a/deployment/terraform/.terraform.tfstate.lock.info b/deployment/terraform/.terraform.tfstate.lock.info new file mode 100644 index 0000000..ac09571 --- /dev/null +++ b/deployment/terraform/.terraform.tfstate.lock.info @@ -0,0 +1 @@ +{"ID":"f7ebd466-aa1e-1c15-bedf-0f9c92044463","Operation":"OperationTypeApply","Info":"","Who":"DESKTOP\\habal@Desktop","Version":"1.10.1","Created":"2025-05-26T16:46:06.4288884Z","Path":"terraform.tfstate"} \ No newline at end of file diff --git a/deployment/terraform/main.tf b/deployment/terraform/main.tf index 4361923..3e65d5c 100644 --- a/deployment/terraform/main.tf +++ b/deployment/terraform/main.tf @@ -50,11 +50,11 @@ resource "google_firestore_database" "database" { } # Container Registry - no explicit resource needed, just enable the API -# You'll push images to gcr.io/${var.project_id}/sereact-api +# You'll push images to gcr.io/${var.project_id}/contoso-api # Cloud Run service -resource "google_cloud_run_service" "sereact" { - name = "sereact" +resource "google_cloud_run_service" "contoso" { + name = "contoso" location = var.region metadata { @@ -77,7 +77,7 @@ resource "google_cloud_run_service" "sereact" { spec { containers { # Use our optimized image - image = "gcr.io/${var.project_id}/sereact-api:${var.image_tag}" + image = "gcr.io/${var.project_id}/contoso-api:${var.image_tag}" ports { container_port = 8000 @@ -154,8 +154,8 @@ resource "google_cloud_run_service" "sereact" { # Make the Cloud Run service publicly accessible resource "google_cloud_run_service_iam_member" "public_access" { - service = google_cloud_run_service.sereact.name - location = google_cloud_run_service.sereact.location + service = google_cloud_run_service.contoso.name + location = google_cloud_run_service.contoso.location role = "roles/run.invoker" member = "allUsers" } \ No newline at end of file diff --git a/deployment/terraform/outputs.tf b/deployment/terraform/outputs.tf index 9b1e6e1..74b9f23 100644 --- a/deployment/terraform/outputs.tf +++ b/deployment/terraform/outputs.tf @@ -1,5 +1,5 @@ output "cloud_run_url" { - value = google_cloud_run_service.sereact.status[0].url + value = google_cloud_run_service.contoso.status[0].url description = "The URL of the deployed Cloud Run service" } @@ -14,7 +14,7 @@ output "firestore_database_id" { } output "container_registry_url" { - value = "gcr.io/${var.project_id}/sereact" + value = "gcr.io/${var.project_id}/contoso" description = "The URL of the Container Registry repository" } @@ -63,7 +63,7 @@ output "cloud_run_qdrant_host_internal" { output "deployment_summary" { value = { - cloud_run_url = google_cloud_run_service.sereact.status[0].url + cloud_run_url = google_cloud_run_service.contoso.status[0].url qdrant_endpoint = "http://${google_compute_instance.vector_db_vm.network_interface[0].access_config[0].nat_ip}:6333" qdrant_host_ip = google_compute_instance.vector_db_vm.network_interface[0].access_config[0].nat_ip firestore_database = var.firestore_db_name diff --git a/deployment/terraform/pubsub.tf b/deployment/terraform/pubsub.tf index 76247f1..412f9b3 100644 --- a/deployment/terraform/pubsub.tf +++ b/deployment/terraform/pubsub.tf @@ -10,7 +10,7 @@ resource "google_pubsub_topic" "image_processing" { labels = { environment = var.environment - service = "sereact" + service = "contoso" component = "image-processing" } } @@ -21,7 +21,7 @@ resource "google_pubsub_topic" "image_processing_dlq" { labels = { environment = var.environment - service = "sereact" + service = "contoso" component = "image-processing-dlq" } } @@ -37,7 +37,7 @@ resource "google_pubsub_subscription" "image_processing_dlq" { labels = { environment = var.environment - service = "sereact" + service = "contoso" component = "image-processing-dlq" } } diff --git a/deployment/terraform/terraform.tfstate b/deployment/terraform/terraform.tfstate index e97d695..fbc19ca 100644 --- a/deployment/terraform/terraform.tfstate +++ b/deployment/terraform/terraform.tfstate @@ -21,21 +21,21 @@ "type": "string" }, "cloud_run_url": { - "value": "https://sereact-p64zpdtkta-uc.a.run.app", + "value": "https://contoso-p64zpdtkta-uc.a.run.app", "type": "string" }, "container_registry_url": { - "value": "gcr.io/gen-lang-client-0424120530/sereact", + "value": "gcr.io/gen-lang-client-0424120530/contoso", "type": "string" }, "deployment_summary": { "value": { - "cloud_run_url": "https://sereact-p64zpdtkta-uc.a.run.app", - "firestore_database": "sereact-imagedb", + "cloud_run_url": "https://contoso-p64zpdtkta-uc.a.run.app", + "firestore_database": "contoso-imagedb", "qdrant_endpoint": "http://35.193.174.125:6333", "qdrant_host_ip": "35.193.174.125", "static_ip_enabled": false, - "storage_bucket": "sereact-images" + "storage_bucket": "contoso-images" }, "type": [ "object", @@ -50,7 +50,7 @@ ] }, "firestore_database_id": { - "value": "projects/gen-lang-client-0424120530/databases/sereact-imagedb", + "value": "projects/gen-lang-client-0424120530/databases/contoso-imagedb", "type": "string" }, "pubsub_dlq_topic_name": { @@ -70,7 +70,7 @@ "type": "string" }, "storage_bucket_name": { - "value": "sereact-images", + "value": "contoso-images", "type": "string" }, "vector_db_vm_external_ip": { @@ -82,7 +82,7 @@ "type": "string" }, "vector_db_vm_name": { - "value": "sereact-vector-db", + "value": "contoso-vector-db", "type": "string" } }, @@ -155,14 +155,14 @@ { "mode": "managed", "type": "google_cloud_run_service", - "name": "sereact", + "name": "contoso", "provider": "provider[\"registry.terraform.io/hashicorp/google\"]", "instances": [ { "schema_version": 2, "attributes": { "autogenerate_revision_name": false, - "id": "locations/us-central1/namespaces/gen-lang-client-0424120530/services/sereact", + "id": "locations/us-central1/namespaces/gen-lang-client-0424120530/services/contoso", "location": "us-central1", "metadata": [ { @@ -173,7 +173,7 @@ "run.googleapis.com/ingress": "all", "run.googleapis.com/ingress-status": "all", "run.googleapis.com/operation-id": "2b1374b6-6b03-4d99-a76c-b8e751f46df0", - "run.googleapis.com/urls": "[\"https://sereact-761163285547.us-central1.run.app\",\"https://sereact-p64zpdtkta-uc.a.run.app\"]", + "run.googleapis.com/urls": "[\"https://contoso-761163285547.us-central1.run.app\",\"https://contoso-p64zpdtkta-uc.a.run.app\"]", "serving.knative.dev/creator": "johnpccd3@gmail.com", "serving.knative.dev/lastModifier": "johnpccd3@gmail.com" }, @@ -185,14 +185,14 @@ "labels": null, "namespace": "gen-lang-client-0424120530", "resource_version": "AAY191YVk4g", - "self_link": "/apis/serving.knative.dev/v1/namespaces/761163285547/services/sereact", + "self_link": "/apis/serving.knative.dev/v1/namespaces/761163285547/services/contoso", "terraform_labels": { "goog-terraform-provisioned": "true" }, "uid": "d8b0e29e-2db1-4f23-8b6c-d7238a9a5f89" } ], - "name": "sereact", + "name": "contoso", "project": "gen-lang-client-0424120530", "status": [ { @@ -216,19 +216,19 @@ "type": "RoutesReady" } ], - "latest_created_revision_name": "sereact-00001-htg", - "latest_ready_revision_name": "sereact-00001-htg", + "latest_created_revision_name": "contoso-00001-htg", + "latest_ready_revision_name": "contoso-00001-htg", "observed_generation": 1, "traffic": [ { "latest_revision": true, "percent": 100, - "revision_name": "sereact-00001-htg", + "revision_name": "contoso-00001-htg", "tag": "", "url": "" } ], - "url": "https://sereact-p64zpdtkta-uc.a.run.app" + "url": "https://contoso-p64zpdtkta-uc.a.run.app" } ], "template": [ @@ -266,7 +266,7 @@ }, { "name": "FIRESTORE_DATABASE_NAME", - "value": "sereact-imagedb", + "value": "contoso-imagedb", "value_from": [] }, { @@ -276,7 +276,7 @@ }, { "name": "GCS_BUCKET_NAME", - "value": "sereact-images", + "value": "contoso-images", "value_from": [] }, { @@ -321,7 +321,7 @@ } ], "env_from": [], - "image": "gcr.io/gen-lang-client-0424120530/sereact-api:latest", + "image": "gcr.io/gen-lang-client-0424120530/contoso-api:latest", "liveness_probe": [], "name": "", "ports": [ @@ -441,17 +441,17 @@ "attributes": { "condition": [], "etag": "BwY191avNJc=", - "id": "v1/projects/gen-lang-client-0424120530/locations/us-central1/services/sereact/roles/run.invoker/allUsers", + "id": "v1/projects/gen-lang-client-0424120530/locations/us-central1/services/contoso/roles/run.invoker/allUsers", "location": "us-central1", "member": "allUsers", "project": "gen-lang-client-0424120530", "role": "roles/run.invoker", - "service": "v1/projects/gen-lang-client-0424120530/locations/us-central1/services/sereact" + "service": "v1/projects/gen-lang-client-0424120530/locations/us-central1/services/contoso" }, "sensitive_attributes": [], "private": "bnVsbA==", "dependencies": [ - "google_cloud_run_service.sereact", + "google_cloud_run_service.contoso", "google_compute_address.vector_db_static_ip", "google_compute_instance.vector_db_vm", "google_project_service.services", @@ -525,9 +525,9 @@ "available_memory": "512M", "binary_authorization_policy": "", "environment_variables": { - "FIRESTORE_DATABASE_NAME": "sereact-imagedb", + "FIRESTORE_DATABASE_NAME": "contoso-imagedb", "FIRESTORE_PROJECT_ID": "gen-lang-client-0424120530", - "GCS_BUCKET_NAME": "sereact-images", + "GCS_BUCKET_NAME": "contoso-images", "GOOGLE_CLOUD_PROJECT": "gen-lang-client-0424120530", "LOG_EXECUTION_ID": "true", "LOG_LEVEL": "INFO", @@ -705,7 +705,7 @@ "interface": "", "kms_key_self_link": "", "mode": "READ_WRITE", - "source": "https://www.googleapis.com/compute/v1/projects/gen-lang-client-0424120530/zones/us-central1-a/disks/sereact-vector-db" + "source": "https://www.googleapis.com/compute/v1/projects/gen-lang-client-0424120530/zones/us-central1-a/disks/contoso-vector-db" } ], "can_ip_forward": false, @@ -722,7 +722,7 @@ "enable_display": false, "guest_accelerator": [], "hostname": "", - "id": "projects/gen-lang-client-0424120530/zones/us-central1-a/instances/sereact-vector-db", + "id": "projects/gen-lang-client-0424120530/zones/us-central1-a/instances/contoso-vector-db", "instance_encryption_key": [], "instance_id": "3665939918038714681", "key_revocation_action_type": "", @@ -733,7 +733,7 @@ "metadata_fingerprint": "nyOcq7EkvZA=", "metadata_startup_script": "#!/bin/bash\n\n# Qdrant Vector Database Installation Script\n# This script installs and configures Qdrant on Ubuntu 22.04\n\nset -e\n\n# Update system packages\napt-get update\napt-get upgrade -y\n\n# Install required packages\napt-get install -y curl wget gnupg2 software-properties-common apt-transport-https ca-certificates\n\n# Install Docker\ncurl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg\necho \"deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable\" | tee /etc/apt/sources.list.d/docker.list \u003e /dev/null\napt-get update\napt-get install -y docker-ce docker-ce-cli containerd.io\n\n# Start and enable Docker\nsystemctl start docker\nsystemctl enable docker\n\n# Create qdrant user and directories\nuseradd -r -s /bin/false qdrant || true\nmkdir -p /opt/qdrant/storage\nmkdir -p /opt/qdrant/config\nchown -R qdrant:qdrant /opt/qdrant\n\n# Create Qdrant configuration file\ncat \u003e /opt/qdrant/config/config.yaml \u003c\u003c EOF\nservice:\n host: 0.0.0.0\n http_port: 6333\n grpc_port: 6334\n enable_cors: true\n\nstorage:\n storage_path: /qdrant/storage\n snapshots_path: /qdrant/snapshots\n on_disk_payload: true\n\ncluster:\n enabled: false\n\ntelemetry:\n disabled: true\n\nlog_level: INFO\nEOF\n\n# Create API key configuration if provided\nif [ -n \"\" ] \u0026\u0026 [ \"\" != \"\" ]; then\ncat \u003e\u003e /opt/qdrant/config/config.yaml \u003c\u003c EOF\n\nservice:\n api_key: \"\"\nEOF\nfi\n\n# Create systemd service for Qdrant\ncat \u003e /etc/systemd/system/qdrant.service \u003c\u003c EOF\n[Unit]\nDescription=Qdrant Vector Database\nAfter=docker.service\nRequires=docker.service\n\n[Service]\nType=simple\nUser=root\nExecStartPre=-/usr/bin/docker stop qdrant\nExecStartPre=-/usr/bin/docker rm qdrant\nExecStart=/usr/bin/docker run --name qdrant \\\n -p 6333:6333 \\\n -p 6334:6334 \\\n -v /opt/qdrant/storage:/qdrant/storage:z \\\n -v /opt/qdrant/config/config.yaml:/qdrant/config/production.yaml:z \\\n qdrant/qdrant:latest\nExecStop=/usr/bin/docker stop qdrant\nRestart=always\nRestartSec=10\n\n[Install]\nWantedBy=multi-user.target\nEOF\n\n# Pull Qdrant Docker image\ndocker pull qdrant/qdrant:latest\n\n# Enable and start Qdrant service\nsystemctl daemon-reload\nsystemctl enable qdrant\nsystemctl start qdrant\n\n# Install monitoring tools\napt-get install -y htop iotop nethogs\n\n# Create a simple health check script\ncat \u003e /opt/qdrant/health_check.sh \u003c\u003c 'EOF'\n#!/bin/bash\nresponse=$(curl -s -o /dev/null -w \"%{http_code}\" http://localhost:6333/health)\nif [ \"$response\" = \"200\" ]; then\n echo \"Qdrant is healthy\"\n exit 0\nelse\n echo \"Qdrant is not responding properly (HTTP $response)\"\n exit 1\nfi\nEOF\n\nchmod +x /opt/qdrant/health_check.sh\n\n# Set up log rotation for Docker logs\ncat \u003e /etc/logrotate.d/docker \u003c\u003c EOF\n/var/lib/docker/containers/*/*.log {\n rotate 7\n daily\n compress\n size=1M\n missingok\n delaycompress\n copytruncate\n}\nEOF\n\n# Configure firewall (ufw)\nufw --force enable\nufw allow ssh\nufw allow 6333/tcp # Qdrant HTTP API\nufw allow 6334/tcp # Qdrant gRPC API\n\n# Create a simple backup script\ncat \u003e /opt/qdrant/backup.sh \u003c\u003c 'EOF'\n#!/bin/bash\nBACKUP_DIR=\"/opt/qdrant/backups\"\nDATE=$(date +%Y%m%d_%H%M%S)\nmkdir -p $BACKUP_DIR\n\n# Create snapshot via API\ncurl -X POST \"http://localhost:6333/snapshots\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"snapshot_name\": \"backup_'$DATE'\"}'\n\n# Copy storage directory\ntar -czf $BACKUP_DIR/qdrant_storage_$DATE.tar.gz -C /opt/qdrant storage/\n\n# Keep only last 7 backups\nfind $BACKUP_DIR -name \"*.tar.gz\" -mtime +7 -delete\n\necho \"Backup completed: $DATE\"\nEOF\n\nchmod +x /opt/qdrant/backup.sh\n\n# Set up daily backup cron job\necho \"0 2 * * * root /opt/qdrant/backup.sh \u003e\u003e /var/log/qdrant_backup.log 2\u003e\u00261\" \u003e\u003e /etc/crontab\n\n# Wait for Qdrant to be ready\necho \"Waiting for Qdrant to start...\"\nfor i in {1..30}; do\n if curl -s http://localhost:6333/health \u003e /dev/null; then\n echo \"Qdrant is ready!\"\n break\n fi\n echo \"Waiting... ($i/30)\"\n sleep 10\ndone\n\n# Create a default collection for image vectors\ncurl -X PUT \"http://localhost:6333/collections/image_vectors\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"vectors\": {\n \"size\": 1408,\n \"distance\": \"Cosine\"\n },\n \"optimizers_config\": {\n \"default_segment_number\": 2\n },\n \"replication_factor\": 1\n }'\n\necho \"Qdrant installation and configuration completed!\"\necho \"Qdrant is accessible at:\"\necho \" HTTP API: http://$(curl -s ifconfig.me):6333\"\necho \" gRPC API: http://$(curl -s ifconfig.me):6334\"\necho \"Health check: /opt/qdrant/health_check.sh\"\necho \"Backup script: /opt/qdrant/backup.sh\" ", "min_cpu_platform": "", - "name": "sereact-vector-db", + "name": "contoso-vector-db", "network_interface": [ { "access_config": [ @@ -781,7 +781,7 @@ } ], "scratch_disk": [], - "self_link": "https://www.googleapis.com/compute/v1/projects/gen-lang-client-0424120530/zones/us-central1-a/instances/sereact-vector-db", + "self_link": "https://www.googleapis.com/compute/v1/projects/gen-lang-client-0424120530/zones/us-central1-a/instances/contoso-vector-db", "service_account": [ { "email": "vector-db-sa@gen-lang-client-0424120530.iam.gserviceaccount.com", @@ -877,10 +877,10 @@ "deletion_policy": "ABANDON", "earliest_version_time": "2025-05-25T14:17:09.893967Z", "etag": "IKfR75n1vo0DMKrW4vCEvY0D", - "id": "projects/gen-lang-client-0424120530/databases/sereact-imagedb", + "id": "projects/gen-lang-client-0424120530/databases/contoso-imagedb", "key_prefix": "", "location_id": "us-central1", - "name": "sereact-imagedb", + "name": "contoso-imagedb", "point_in_time_recovery_enablement": "POINT_IN_TIME_RECOVERY_DISABLED", "project": "gen-lang-client-0424120530", "timeouts": null, @@ -1196,7 +1196,7 @@ "component": "image-processing-dlq", "environment": "dev", "goog-terraform-provisioned": "true", - "service": "sereact" + "service": "contoso" }, "enable_exactly_once_delivery": false, "enable_message_ordering": false, @@ -1210,7 +1210,7 @@ "labels": { "component": "image-processing-dlq", "environment": "dev", - "service": "sereact" + "service": "contoso" }, "message_retention_duration": "2592000s", "name": "image-processing-topic-dlq-subscription", @@ -1222,7 +1222,7 @@ "component": "image-processing-dlq", "environment": "dev", "goog-terraform-provisioned": "true", - "service": "sereact" + "service": "contoso" }, "timeouts": null, "topic": "projects/gen-lang-client-0424120530/topics/image-processing-topic-dlq" @@ -1248,7 +1248,7 @@ "component": "image-processing", "environment": "dev", "goog-terraform-provisioned": "true", - "service": "sereact" + "service": "contoso" }, "id": "projects/gen-lang-client-0424120530/topics/image-processing-topic", "ingestion_data_source_settings": [], @@ -1256,7 +1256,7 @@ "labels": { "component": "image-processing", "environment": "dev", - "service": "sereact" + "service": "contoso" }, "message_retention_duration": "", "message_storage_policy": [], @@ -1267,7 +1267,7 @@ "component": "image-processing", "environment": "dev", "goog-terraform-provisioned": "true", - "service": "sereact" + "service": "contoso" }, "timeouts": null }, @@ -1289,7 +1289,7 @@ "component": "image-processing-dlq", "environment": "dev", "goog-terraform-provisioned": "true", - "service": "sereact" + "service": "contoso" }, "id": "projects/gen-lang-client-0424120530/topics/image-processing-topic-dlq", "ingestion_data_source_settings": [], @@ -1297,7 +1297,7 @@ "labels": { "component": "image-processing-dlq", "environment": "dev", - "service": "sereact" + "service": "contoso" }, "message_retention_duration": "", "message_storage_policy": [], @@ -1308,7 +1308,7 @@ "component": "image-processing-dlq", "environment": "dev", "goog-terraform-provisioned": "true", - "service": "sereact" + "service": "contoso" }, "timeouts": null }, @@ -1396,19 +1396,19 @@ "enabled": false } ], - "id": "sereact-images", + "id": "contoso-images", "labels": {}, "lifecycle_rule": [], "location": "US-CENTRAL1", "logging": [], - "name": "sereact-images", + "name": "contoso-images", "project": "gen-lang-client-0424120530", "project_number": 761163285547, "public_access_prevention": "inherited", "requester_pays": false, "retention_policy": [], "rpo": null, - "self_link": "https://www.googleapis.com/storage/v1/b/sereact-images", + "self_link": "https://www.googleapis.com/storage/v1/b/contoso-images", "soft_delete_policy": [ { "effective_time": "2025-05-24T21:09:21.315Z", @@ -1423,7 +1423,7 @@ "timeouts": null, "uniform_bucket_level_access": true, "updated": "2025-05-24T21:09:21.315Z", - "url": "gs://sereact-images", + "url": "gs://contoso-images", "versioning": [], "website": [] }, diff --git a/deployment/terraform/terraform.tfstate.backup b/deployment/terraform/terraform.tfstate.backup index a988b87..9dc98e3 100644 --- a/deployment/terraform/terraform.tfstate.backup +++ b/deployment/terraform/terraform.tfstate.backup @@ -21,21 +21,21 @@ "type": "string" }, "cloud_run_url": { - "value": "https://sereact-p64zpdtkta-uc.a.run.app", + "value": "https://contoso-p64zpdtkta-uc.a.run.app", "type": "string" }, "container_registry_url": { - "value": "gcr.io/gen-lang-client-0424120530/sereact", + "value": "gcr.io/gen-lang-client-0424120530/contoso", "type": "string" }, "deployment_summary": { "value": { - "cloud_run_url": "https://sereact-p64zpdtkta-uc.a.run.app", - "firestore_database": "sereact-imagedb", + "cloud_run_url": "https://contoso-p64zpdtkta-uc.a.run.app", + "firestore_database": "contoso-imagedb", "qdrant_endpoint": "http://35.193.174.125:6333", "qdrant_host_ip": "35.193.174.125", "static_ip_enabled": false, - "storage_bucket": "sereact-images" + "storage_bucket": "contoso-images" }, "type": [ "object", @@ -50,7 +50,7 @@ ] }, "firestore_database_id": { - "value": "projects/gen-lang-client-0424120530/databases/sereact-imagedb", + "value": "projects/gen-lang-client-0424120530/databases/contoso-imagedb", "type": "string" }, "pubsub_dlq_topic_name": { @@ -70,7 +70,7 @@ "type": "string" }, "storage_bucket_name": { - "value": "sereact-images", + "value": "contoso-images", "type": "string" }, "vector_db_vm_external_ip": { @@ -82,7 +82,7 @@ "type": "string" }, "vector_db_vm_name": { - "value": "sereact-vector-db", + "value": "contoso-vector-db", "type": "string" } }, @@ -155,14 +155,14 @@ { "mode": "managed", "type": "google_cloud_run_service", - "name": "sereact", + "name": "contoso", "provider": "provider[\"registry.terraform.io/hashicorp/google\"]", "instances": [ { "schema_version": 2, "attributes": { "autogenerate_revision_name": false, - "id": "locations/us-central1/namespaces/gen-lang-client-0424120530/services/sereact", + "id": "locations/us-central1/namespaces/gen-lang-client-0424120530/services/contoso", "location": "us-central1", "metadata": [ { @@ -173,7 +173,7 @@ "run.googleapis.com/ingress": "all", "run.googleapis.com/ingress-status": "all", "run.googleapis.com/operation-id": "a9aeb6de-fdd6-43b2-93f8-8b7f72afab4c", - "run.googleapis.com/urls": "[\"https://sereact-761163285547.us-central1.run.app\",\"https://sereact-p64zpdtkta-uc.a.run.app\"]", + "run.googleapis.com/urls": "[\"https://contoso-761163285547.us-central1.run.app\",\"https://contoso-p64zpdtkta-uc.a.run.app\"]", "serving.knative.dev/creator": "johnpccd3@gmail.com", "serving.knative.dev/lastModifier": "johnpccd3@gmail.com" }, @@ -185,14 +185,14 @@ "labels": null, "namespace": "gen-lang-client-0424120530", "resource_version": "AAY19MELEOc", - "self_link": "/apis/serving.knative.dev/v1/namespaces/761163285547/services/sereact", + "self_link": "/apis/serving.knative.dev/v1/namespaces/761163285547/services/contoso", "terraform_labels": { "goog-terraform-provisioned": "true" }, "uid": "8c8be11c-c607-4caa-a65e-c552ec445882" } ], - "name": "sereact", + "name": "contoso", "project": "gen-lang-client-0424120530", "status": [ { @@ -216,19 +216,19 @@ "type": "RoutesReady" } ], - "latest_created_revision_name": "sereact-00001-z4g", - "latest_ready_revision_name": "sereact-00001-z4g", + "latest_created_revision_name": "contoso-00001-z4g", + "latest_ready_revision_name": "contoso-00001-z4g", "observed_generation": 1, "traffic": [ { "latest_revision": true, "percent": 100, - "revision_name": "sereact-00001-z4g", + "revision_name": "contoso-00001-z4g", "tag": "", "url": "" } ], - "url": "https://sereact-p64zpdtkta-uc.a.run.app" + "url": "https://contoso-p64zpdtkta-uc.a.run.app" } ], "template": [ @@ -266,7 +266,7 @@ }, { "name": "FIRESTORE_DATABASE_NAME", - "value": "sereact-imagedb", + "value": "contoso-imagedb", "value_from": [] }, { @@ -276,7 +276,7 @@ }, { "name": "GCS_BUCKET_NAME", - "value": "sereact-images", + "value": "contoso-images", "value_from": [] }, { @@ -321,7 +321,7 @@ } ], "env_from": [], - "image": "gcr.io/gen-lang-client-0424120530/sereact-api:latest", + "image": "gcr.io/gen-lang-client-0424120530/contoso-api:latest", "liveness_probe": [], "name": "", "ports": [ @@ -441,17 +441,17 @@ "attributes": { "condition": [], "etag": "BwY19MG70Fs=", - "id": "v1/projects/gen-lang-client-0424120530/locations/us-central1/services/sereact/roles/run.invoker/allUsers", + "id": "v1/projects/gen-lang-client-0424120530/locations/us-central1/services/contoso/roles/run.invoker/allUsers", "location": "us-central1", "member": "allUsers", "project": "gen-lang-client-0424120530", "role": "roles/run.invoker", - "service": "v1/projects/gen-lang-client-0424120530/locations/us-central1/services/sereact" + "service": "v1/projects/gen-lang-client-0424120530/locations/us-central1/services/contoso" }, "sensitive_attributes": [], "private": "bnVsbA==", "dependencies": [ - "google_cloud_run_service.sereact", + "google_cloud_run_service.contoso", "google_compute_address.vector_db_static_ip", "google_compute_instance.vector_db_vm", "google_project_service.services", @@ -525,9 +525,9 @@ "available_memory": "512M", "binary_authorization_policy": "", "environment_variables": { - "FIRESTORE_DATABASE_NAME": "sereact-imagedb", + "FIRESTORE_DATABASE_NAME": "contoso-imagedb", "FIRESTORE_PROJECT_ID": "gen-lang-client-0424120530", - "GCS_BUCKET_NAME": "sereact-images", + "GCS_BUCKET_NAME": "contoso-images", "GOOGLE_CLOUD_PROJECT": "gen-lang-client-0424120530", "LOG_EXECUTION_ID": "true", "LOG_LEVEL": "INFO", @@ -705,7 +705,7 @@ "interface": "", "kms_key_self_link": "", "mode": "READ_WRITE", - "source": "https://www.googleapis.com/compute/v1/projects/gen-lang-client-0424120530/zones/us-central1-a/disks/sereact-vector-db" + "source": "https://www.googleapis.com/compute/v1/projects/gen-lang-client-0424120530/zones/us-central1-a/disks/contoso-vector-db" } ], "can_ip_forward": false, @@ -722,7 +722,7 @@ "enable_display": false, "guest_accelerator": [], "hostname": "", - "id": "projects/gen-lang-client-0424120530/zones/us-central1-a/instances/sereact-vector-db", + "id": "projects/gen-lang-client-0424120530/zones/us-central1-a/instances/contoso-vector-db", "instance_encryption_key": [], "instance_id": "3665939918038714681", "key_revocation_action_type": "", @@ -733,7 +733,7 @@ "metadata_fingerprint": "nyOcq7EkvZA=", "metadata_startup_script": "#!/bin/bash\n\n# Qdrant Vector Database Installation Script\n# This script installs and configures Qdrant on Ubuntu 22.04\n\nset -e\n\n# Update system packages\napt-get update\napt-get upgrade -y\n\n# Install required packages\napt-get install -y curl wget gnupg2 software-properties-common apt-transport-https ca-certificates\n\n# Install Docker\ncurl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg\necho \"deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable\" | tee /etc/apt/sources.list.d/docker.list \u003e /dev/null\napt-get update\napt-get install -y docker-ce docker-ce-cli containerd.io\n\n# Start and enable Docker\nsystemctl start docker\nsystemctl enable docker\n\n# Create qdrant user and directories\nuseradd -r -s /bin/false qdrant || true\nmkdir -p /opt/qdrant/storage\nmkdir -p /opt/qdrant/config\nchown -R qdrant:qdrant /opt/qdrant\n\n# Create Qdrant configuration file\ncat \u003e /opt/qdrant/config/config.yaml \u003c\u003c EOF\nservice:\n host: 0.0.0.0\n http_port: 6333\n grpc_port: 6334\n enable_cors: true\n\nstorage:\n storage_path: /qdrant/storage\n snapshots_path: /qdrant/snapshots\n on_disk_payload: true\n\ncluster:\n enabled: false\n\ntelemetry:\n disabled: true\n\nlog_level: INFO\nEOF\n\n# Create API key configuration if provided\nif [ -n \"\" ] \u0026\u0026 [ \"\" != \"\" ]; then\ncat \u003e\u003e /opt/qdrant/config/config.yaml \u003c\u003c EOF\n\nservice:\n api_key: \"\"\nEOF\nfi\n\n# Create systemd service for Qdrant\ncat \u003e /etc/systemd/system/qdrant.service \u003c\u003c EOF\n[Unit]\nDescription=Qdrant Vector Database\nAfter=docker.service\nRequires=docker.service\n\n[Service]\nType=simple\nUser=root\nExecStartPre=-/usr/bin/docker stop qdrant\nExecStartPre=-/usr/bin/docker rm qdrant\nExecStart=/usr/bin/docker run --name qdrant \\\n -p 6333:6333 \\\n -p 6334:6334 \\\n -v /opt/qdrant/storage:/qdrant/storage:z \\\n -v /opt/qdrant/config/config.yaml:/qdrant/config/production.yaml:z \\\n qdrant/qdrant:latest\nExecStop=/usr/bin/docker stop qdrant\nRestart=always\nRestartSec=10\n\n[Install]\nWantedBy=multi-user.target\nEOF\n\n# Pull Qdrant Docker image\ndocker pull qdrant/qdrant:latest\n\n# Enable and start Qdrant service\nsystemctl daemon-reload\nsystemctl enable qdrant\nsystemctl start qdrant\n\n# Install monitoring tools\napt-get install -y htop iotop nethogs\n\n# Create a simple health check script\ncat \u003e /opt/qdrant/health_check.sh \u003c\u003c 'EOF'\n#!/bin/bash\nresponse=$(curl -s -o /dev/null -w \"%{http_code}\" http://localhost:6333/health)\nif [ \"$response\" = \"200\" ]; then\n echo \"Qdrant is healthy\"\n exit 0\nelse\n echo \"Qdrant is not responding properly (HTTP $response)\"\n exit 1\nfi\nEOF\n\nchmod +x /opt/qdrant/health_check.sh\n\n# Set up log rotation for Docker logs\ncat \u003e /etc/logrotate.d/docker \u003c\u003c EOF\n/var/lib/docker/containers/*/*.log {\n rotate 7\n daily\n compress\n size=1M\n missingok\n delaycompress\n copytruncate\n}\nEOF\n\n# Configure firewall (ufw)\nufw --force enable\nufw allow ssh\nufw allow 6333/tcp # Qdrant HTTP API\nufw allow 6334/tcp # Qdrant gRPC API\n\n# Create a simple backup script\ncat \u003e /opt/qdrant/backup.sh \u003c\u003c 'EOF'\n#!/bin/bash\nBACKUP_DIR=\"/opt/qdrant/backups\"\nDATE=$(date +%Y%m%d_%H%M%S)\nmkdir -p $BACKUP_DIR\n\n# Create snapshot via API\ncurl -X POST \"http://localhost:6333/snapshots\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"snapshot_name\": \"backup_'$DATE'\"}'\n\n# Copy storage directory\ntar -czf $BACKUP_DIR/qdrant_storage_$DATE.tar.gz -C /opt/qdrant storage/\n\n# Keep only last 7 backups\nfind $BACKUP_DIR -name \"*.tar.gz\" -mtime +7 -delete\n\necho \"Backup completed: $DATE\"\nEOF\n\nchmod +x /opt/qdrant/backup.sh\n\n# Set up daily backup cron job\necho \"0 2 * * * root /opt/qdrant/backup.sh \u003e\u003e /var/log/qdrant_backup.log 2\u003e\u00261\" \u003e\u003e /etc/crontab\n\n# Wait for Qdrant to be ready\necho \"Waiting for Qdrant to start...\"\nfor i in {1..30}; do\n if curl -s http://localhost:6333/health \u003e /dev/null; then\n echo \"Qdrant is ready!\"\n break\n fi\n echo \"Waiting... ($i/30)\"\n sleep 10\ndone\n\n# Create a default collection for image vectors\ncurl -X PUT \"http://localhost:6333/collections/image_vectors\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"vectors\": {\n \"size\": 1408,\n \"distance\": \"Cosine\"\n },\n \"optimizers_config\": {\n \"default_segment_number\": 2\n },\n \"replication_factor\": 1\n }'\n\necho \"Qdrant installation and configuration completed!\"\necho \"Qdrant is accessible at:\"\necho \" HTTP API: http://$(curl -s ifconfig.me):6333\"\necho \" gRPC API: http://$(curl -s ifconfig.me):6334\"\necho \"Health check: /opt/qdrant/health_check.sh\"\necho \"Backup script: /opt/qdrant/backup.sh\" ", "min_cpu_platform": "", - "name": "sereact-vector-db", + "name": "contoso-vector-db", "network_interface": [ { "access_config": [ @@ -781,7 +781,7 @@ } ], "scratch_disk": [], - "self_link": "https://www.googleapis.com/compute/v1/projects/gen-lang-client-0424120530/zones/us-central1-a/instances/sereact-vector-db", + "self_link": "https://www.googleapis.com/compute/v1/projects/gen-lang-client-0424120530/zones/us-central1-a/instances/contoso-vector-db", "service_account": [ { "email": "vector-db-sa@gen-lang-client-0424120530.iam.gserviceaccount.com", @@ -877,10 +877,10 @@ "deletion_policy": "ABANDON", "earliest_version_time": "2025-05-25T11:12:43.126081Z", "etag": "IPjb6fzLvo0DMKrW4vCEvY0D", - "id": "projects/gen-lang-client-0424120530/databases/sereact-imagedb", + "id": "projects/gen-lang-client-0424120530/databases/contoso-imagedb", "key_prefix": "", "location_id": "us-central1", - "name": "sereact-imagedb", + "name": "contoso-imagedb", "point_in_time_recovery_enablement": "POINT_IN_TIME_RECOVERY_DISABLED", "project": "gen-lang-client-0424120530", "timeouts": null, @@ -1196,7 +1196,7 @@ "component": "image-processing-dlq", "environment": "dev", "goog-terraform-provisioned": "true", - "service": "sereact" + "service": "contoso" }, "enable_exactly_once_delivery": false, "enable_message_ordering": false, @@ -1210,7 +1210,7 @@ "labels": { "component": "image-processing-dlq", "environment": "dev", - "service": "sereact" + "service": "contoso" }, "message_retention_duration": "2592000s", "name": "image-processing-topic-dlq-subscription", @@ -1222,7 +1222,7 @@ "component": "image-processing-dlq", "environment": "dev", "goog-terraform-provisioned": "true", - "service": "sereact" + "service": "contoso" }, "timeouts": null, "topic": "projects/gen-lang-client-0424120530/topics/image-processing-topic-dlq" @@ -1248,7 +1248,7 @@ "component": "image-processing", "environment": "dev", "goog-terraform-provisioned": "true", - "service": "sereact" + "service": "contoso" }, "id": "projects/gen-lang-client-0424120530/topics/image-processing-topic", "ingestion_data_source_settings": [], @@ -1256,7 +1256,7 @@ "labels": { "component": "image-processing", "environment": "dev", - "service": "sereact" + "service": "contoso" }, "message_retention_duration": "", "message_storage_policy": [], @@ -1267,7 +1267,7 @@ "component": "image-processing", "environment": "dev", "goog-terraform-provisioned": "true", - "service": "sereact" + "service": "contoso" }, "timeouts": null }, @@ -1289,7 +1289,7 @@ "component": "image-processing-dlq", "environment": "dev", "goog-terraform-provisioned": "true", - "service": "sereact" + "service": "contoso" }, "id": "projects/gen-lang-client-0424120530/topics/image-processing-topic-dlq", "ingestion_data_source_settings": [], @@ -1297,7 +1297,7 @@ "labels": { "component": "image-processing-dlq", "environment": "dev", - "service": "sereact" + "service": "contoso" }, "message_retention_duration": "", "message_storage_policy": [], @@ -1308,7 +1308,7 @@ "component": "image-processing-dlq", "environment": "dev", "goog-terraform-provisioned": "true", - "service": "sereact" + "service": "contoso" }, "timeouts": null }, @@ -1396,19 +1396,19 @@ "enabled": false } ], - "id": "sereact-images", + "id": "contoso-images", "labels": {}, "lifecycle_rule": [], "location": "US-CENTRAL1", "logging": [], - "name": "sereact-images", + "name": "contoso-images", "project": "gen-lang-client-0424120530", "project_number": 761163285547, "public_access_prevention": "inherited", "requester_pays": false, "retention_policy": [], "rpo": null, - "self_link": "https://www.googleapis.com/storage/v1/b/sereact-images", + "self_link": "https://www.googleapis.com/storage/v1/b/contoso-images", "soft_delete_policy": [ { "effective_time": "2025-05-24T21:09:21.315Z", @@ -1423,7 +1423,7 @@ "timeouts": null, "uniform_bucket_level_access": true, "updated": "2025-05-24T21:09:21.315Z", - "url": "gs://sereact-images", + "url": "gs://contoso-images", "versioning": [], "website": [] }, diff --git a/deployment/terraform/terraform.tfvars.example b/deployment/terraform/terraform.tfvars.example index 97db9dc..887cfe7 100644 --- a/deployment/terraform/terraform.tfvars.example +++ b/deployment/terraform/terraform.tfvars.example @@ -2,7 +2,7 @@ project_id = "your-gcp-project-id" region = "us-central1" zone = "us-central1-a" storage_bucket_name = "your-app-storage-bucket" -firestore_db_name = "sereact-imagedb" +firestore_db_name = "contoso-imagedb" # Vector Database Configuration qdrant_api_key = "your-secure-api-key-here" # Optional: leave empty for no authentication diff --git a/deployment/terraform/variables.tf b/deployment/terraform/variables.tf index c545c0c..554061c 100644 --- a/deployment/terraform/variables.tf +++ b/deployment/terraform/variables.tf @@ -23,7 +23,7 @@ variable "storage_bucket_name" { variable "firestore_db_name" { description = "The name of the Firestore database" type = string - default = "sereact-imagedb" + default = "contoso-imagedb" } variable "environment" { diff --git a/deployment/terraform/vm.tf b/deployment/terraform/vm.tf index 3ed6fa2..b8a0109 100644 --- a/deployment/terraform/vm.tf +++ b/deployment/terraform/vm.tf @@ -1,6 +1,6 @@ # VM instance for vector database resource "google_compute_instance" "vector_db_vm" { - name = "sereact-vector-db" + name = "contoso-vector-db" machine_type = "e2-standard-2" # 2 vCPUs, 8GB RAM zone = var.zone diff --git a/scripts/README.md b/scripts/README.md index 4a63906..b00e9f2 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -1,6 +1,6 @@ # Build and Deployment Scripts -This directory contains scripts for building and deploying the Sereact API application. +This directory contains scripts for building and deploying the Contoso API application. ## Prerequisites @@ -12,7 +12,7 @@ This directory contains scripts for building and deploying the Sereact API appli ### Build Script (`build.sh`) -Builds the Docker image for the Sereact API. +Builds the Docker image for the Contoso API. **Usage:** ```bash @@ -30,7 +30,7 @@ REGISTRY=gcr.io/my-project ./scripts/build.sh ``` **Environment Variables:** -- `IMAGE_NAME`: Name for the Docker image (default: "sereact-api") +- `IMAGE_NAME`: Name for the Docker image (default: "contoso-api") - `IMAGE_TAG`: Tag for the Docker image (default: "latest") - `REGISTRY`: Container registry to use (default: empty, using DockerHub) @@ -54,7 +54,7 @@ DEPLOY_TO_CLOUD_RUN=true PROJECT_ID=my-project-id REGION=us-west1 SERVICE_NAME=m All variables from the build script, plus: - `PROJECT_ID`: Google Cloud project ID (required for Cloud Run deployment) - `REGION`: Google Cloud region (default: "us-central1") -- `SERVICE_NAME`: Name for the Cloud Run service (default: "sereact-api") +- `SERVICE_NAME`: Name for the Cloud Run service (default: "contoso-api") ### Cloud Run Deployment Script (`deploy-to-cloud-run.sh`) @@ -76,7 +76,7 @@ PROJECT_ID=my-project-id REGION=us-west1 IMAGE_TAG=v1.0.0 ./scripts/deploy-to-cl - `PROJECT_ID`: Google Cloud project ID (required) - `REGION`: Google Cloud region (default: "us-central1") - `SERVICE_CONFIG`: Path to the service configuration file (default: "deployment/cloud-run/service.yaml") -- `IMAGE_NAME`: Name for the Docker image (default: "sereact-api") +- `IMAGE_NAME`: Name for the Docker image (default: "contoso-api") - `IMAGE_TAG`: Tag for the Docker image (default: "latest") - `REGISTRY`: Container registry to use (default: "gcr.io") - `BUILD`: Set to "true" to build the image before deployment (default: "false") @@ -84,7 +84,7 @@ PROJECT_ID=my-project-id REGION=us-west1 IMAGE_TAG=v1.0.0 ./scripts/deploy-to-cl ### Frontend Client Script (`client.sh`) -Manages the SeReact frontend client development, building, and deployment. +Manages the Contoso frontend client development, building, and deployment. **Usage:** ```bash @@ -170,13 +170,13 @@ DEPLOY_TARGET=netlify ./scripts/client.sh deploy # Scripts Documentation -This directory contains utility scripts for the SEREACT application. +This directory contains utility scripts for the CONTOSO application. ## Database Seeding Scripts ### `seed_firestore.py` -This script initializes and seeds a Google Cloud Firestore database with initial data for the SEREACT application. It creates teams, users, API keys, and sample image metadata. +This script initializes and seeds a Google Cloud Firestore database with initial data for the CONTOSO application. It creates teams, users, API keys, and sample image metadata. #### Requirements @@ -195,9 +195,9 @@ This script initializes and seeds a Google Cloud Firestore database with initial 2. If not using application default credentials, create a service account key file: ```bash - gcloud iam service-accounts create sereact-app - gcloud projects add-iam-policy-binding YOUR_PROJECT_ID --member="serviceAccount:sereact-app@YOUR_PROJECT_ID.iam.gserviceaccount.com" --role="roles/datastore.user" - gcloud iam service-accounts keys create credentials.json --iam-account=sereact-app@YOUR_PROJECT_ID.iam.gserviceaccount.com + gcloud iam service-accounts create contoso-app + gcloud projects add-iam-policy-binding YOUR_PROJECT_ID --member="serviceAccount:contoso-app@YOUR_PROJECT_ID.iam.gserviceaccount.com" --role="roles/datastore.user" + gcloud iam service-accounts keys create credentials.json --iam-account=contoso-app@YOUR_PROJECT_ID.iam.gserviceaccount.com ``` 3. Set environment variables: @@ -233,13 +233,13 @@ python scripts/seed_firestore.py The script will create the following data: 1. **Teams**: - - Sereact Development + - Contoso Development - Marketing Team - Customer Support 2. **Users**: - - Admin User (team: Sereact Development) - - Developer User (team: Sereact Development) + - Admin User (team: Contoso Development) + - Developer User (team: Contoso Development) - Marketing User (team: Marketing Team) - Support User (team: Customer Support) diff --git a/scripts/build.sh b/scripts/build.sh index 58321dc..0596140 100644 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -2,7 +2,7 @@ set -e # Set defaults -IMAGE_NAME=${IMAGE_NAME:-"sereact-api"} +IMAGE_NAME=${IMAGE_NAME:-"contoso-api"} IMAGE_TAG=${IMAGE_TAG:-"latest"} PROJECT_ID=${PROJECT_ID:-"gen-lang-client-0424120530"} diff --git a/scripts/client.sh b/scripts/client.sh index 90766f5..00256d6 100644 --- a/scripts/client.sh +++ b/scripts/client.sh @@ -25,7 +25,7 @@ print_color() { print_header() { echo - print_color $CYAN "๐Ÿš€ SeReact Frontend Client Manager" + print_color $CYAN "๐Ÿš€ Contoso Frontend Client Manager" echo } diff --git a/scripts/run_tests.py b/scripts/run_tests.py index cd93d0b..2ac2236 100644 --- a/scripts/run_tests.py +++ b/scripts/run_tests.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 """ -Test runner script for SEREACT API +Test runner script for CONTOSO API This script provides a convenient way to run different types of tests with proper environment setup and reporting. @@ -159,7 +159,7 @@ def run_coverage_tests(): def main(): """Main function""" - parser = argparse.ArgumentParser(description="Run SEREACT API tests") + parser = argparse.ArgumentParser(description="Run CONTOSO API tests") parser.add_argument( "test_type", choices=["unit", "integration", "e2e", "all", "coverage"], @@ -173,7 +173,7 @@ def main(): args = parser.parse_args() - print("๐Ÿงช SEREACT API Test Runner") + print("๐Ÿงช CONTOSO API Test Runner") print("=" * 50) # Check environment unless skipped diff --git a/scripts/seed_firestore.py b/scripts/seed_firestore.py index dccc620..13dd734 100644 --- a/scripts/seed_firestore.py +++ b/scripts/seed_firestore.py @@ -141,7 +141,7 @@ async def seed_teams(): teams_data = [ { - "name": "Sereact Development", + "name": "Contoso Development", "description": "Internal development team" }, { @@ -169,23 +169,23 @@ async def seed_users(team_ids): users_data = [ { - "email": "admin@sereact.com", + "email": "admin@contoso.com", "name": "Admin User", "team_id": team_ids[0], "is_admin": True }, { - "email": "developer@sereact.com", + "email": "developer@contoso.com", "name": "Developer User", "team_id": team_ids[0] }, { - "email": "marketing@sereact.com", + "email": "marketing@contoso.com", "name": "Marketing User", "team_id": team_ids[1] }, { - "email": "support@sereact.com", + "email": "support@contoso.com", "name": "Support User", "team_id": team_ids[2] } diff --git a/scripts/stop.sh b/scripts/stop.sh index e3ba22d..b786edc 100644 --- a/scripts/stop.sh +++ b/scripts/stop.sh @@ -1,6 +1,6 @@ #!/bin/bash -echo "Stopping Sereact API server..." +echo "Stopping Contoso API server..." # Find and kill uvicorn processes PIDS=$(ps aux | grep "uvicorn main:app" | grep -v grep | awk '{print $2}') diff --git a/src/config/config.py b/src/config/config.py index e3d3d62..26a3f02 100644 --- a/src/config/config.py +++ b/src/config/config.py @@ -5,7 +5,7 @@ from pydantic import AnyHttpUrl, field_validator class Settings(BaseSettings): # Project settings - PROJECT_NAME: str = "SEREACT - Secure Image Management API" + PROJECT_NAME: str = "CONTOSO - Secure Image Management API" API_V1_STR: str = "/api/v1" # Environment @@ -66,7 +66,7 @@ class Settings(BaseSettings): # Firestore settings FIRESTORE_PROJECT_ID: str = os.getenv("FIRESTORE_PROJECT_ID", "") - FIRESTORE_DATABASE_NAME: str = os.getenv("FIRESTORE_DATABASE_NAME", "sereact-db") + FIRESTORE_DATABASE_NAME: str = os.getenv("FIRESTORE_DATABASE_NAME", "contoso-db") FIRESTORE_CREDENTIALS_FILE: str = os.getenv("FIRESTORE_CREDENTIALS_FILE", "firestore-credentials.json") # Google Cloud Storage settings diff --git a/tests/api/test_collections.py b/tests/api/test_collections.py index 740640f..a759a74 100644 --- a/tests/api/test_collections.py +++ b/tests/api/test_collections.py @@ -39,7 +39,7 @@ async def test_create_collection(client: TestClient, admin_api_key: tuple, test_ "description": "A collection for testing images", "metadata": { "category": "test", - "project": "sereact" + "project": "contoso" } } ) @@ -480,7 +480,7 @@ async def test_collection_export(client: TestClient, admin_api_key: tuple): json={ "name": "Export Collection", "description": "Collection for export testing", - "metadata": {"category": "test", "project": "sereact"} + "metadata": {"category": "test", "project": "contoso"} } ) collection_id = collection_response.json()["id"] diff --git a/tests/conftest.py b/tests/conftest.py index c99a2f8..3e4230e 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,5 +1,5 @@ """ -Global test configuration and fixtures for SEREACT tests. +Global test configuration and fixtures for CONTOSO tests. This file provides shared fixtures and configuration for: - Unit tests (with mocked dependencies) diff --git a/tests/integration/__init__.py b/tests/integration/__init__.py index 1a80e7f..787176e 100644 --- a/tests/integration/__init__.py +++ b/tests/integration/__init__.py @@ -1 +1 @@ -"""Integration tests package for SEREACT database layer""" \ No newline at end of file +"""Integration tests package for CONTOSO database layer""" \ No newline at end of file diff --git a/tests/test_e2e.py b/tests/test_e2e.py index 845b693..08e7925 100644 --- a/tests/test_e2e.py +++ b/tests/test_e2e.py @@ -1,5 +1,5 @@ """ -End-to-End Tests for SEREACT API +End-to-End Tests for CONTOSO API These tests cover the complete user workflows described in the README: 1. Use pre-seeded API key for authentication