remove company name
This commit is contained in:
parent
35a5236bbd
commit
a866e5bddc
@ -7,11 +7,11 @@ CORS_ORIGINS=["*"]
|
|||||||
|
|
||||||
# Firestore settings
|
# Firestore settings
|
||||||
FIRESTORE_PROJECT_ID=gen-lang-client-0424120530
|
FIRESTORE_PROJECT_ID=gen-lang-client-0424120530
|
||||||
FIRESTORE_DATABASE_NAME=sereact-imagedb
|
FIRESTORE_DATABASE_NAME=contoso-imagedb
|
||||||
FIRESTORE_CREDENTIALS_FILE=firestore-credentials.json
|
FIRESTORE_CREDENTIALS_FILE=firestore-credentials.json
|
||||||
|
|
||||||
# Google Cloud Storage settings
|
# Google Cloud Storage settings
|
||||||
GCS_BUCKET_NAME=sereact-images
|
GCS_BUCKET_NAME=contoso-images
|
||||||
GCS_CREDENTIALS_FILE=firestore-credentials.json
|
GCS_CREDENTIALS_FILE=firestore-credentials.json
|
||||||
|
|
||||||
# Security settings
|
# Security settings
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
Sereact GmbH
|
Contoso GmbH
|
||||||
Assignment
|
Assignment
|
||||||
|
|
||||||
Image Management API - Coding Challenge
|
Image Management API - Coding Challenge
|
||||||
|
|||||||
@ -186,11 +186,11 @@ Uses Google's Vertex AI multimodal embedding model for generating high-quality i
|
|||||||
|
|
||||||
# Firestore settings
|
# Firestore settings
|
||||||
FIRESTORE_PROJECT_ID=gen-lang-client-0424120530
|
FIRESTORE_PROJECT_ID=gen-lang-client-0424120530
|
||||||
FIRESTORE_DATABASE_NAME=sereact-imagedb
|
FIRESTORE_DATABASE_NAME=contoso-imagedb
|
||||||
FIRESTORE_CREDENTIALS_FILE=firestore-credentials.json
|
FIRESTORE_CREDENTIALS_FILE=firestore-credentials.json
|
||||||
|
|
||||||
# Google Cloud Storage settings
|
# Google Cloud Storage settings
|
||||||
GCS_BUCKET_NAME=sereact-images
|
GCS_BUCKET_NAME=contoso-images
|
||||||
GCS_CREDENTIALS_FILE=firestore-credentials.json
|
GCS_CREDENTIALS_FILE=firestore-credentials.json
|
||||||
|
|
||||||
# Security settings
|
# Security settings
|
||||||
@ -324,7 +324,7 @@ source venv/Scripts/activate && python scripts/run_tests.py all
|
|||||||
|
|
||||||
## API Modules Architecture
|
## 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/
|
src/
|
||||||
|
|||||||
@ -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
|
## Features
|
||||||
|
|
||||||
@ -24,7 +24,7 @@ A modern, responsive web frontend for the SeReact AI-powered image management pl
|
|||||||
|
|
||||||
### Prerequisites
|
### Prerequisites
|
||||||
|
|
||||||
- A running SeReact backend API server
|
- A running Contoso backend API server
|
||||||
- Modern web browser (Chrome, Firefox, Safari, Edge)
|
- Modern web browser (Chrome, Firefox, Safari, Edge)
|
||||||
- Web server to serve static files (optional for development)
|
- 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**:
|
1. **Download/Clone the frontend files**:
|
||||||
```bash
|
```bash
|
||||||
# If you have the full SeReact repository
|
# If you have the full Contoso repository
|
||||||
cd sereact/client
|
cd contoso/client
|
||||||
|
|
||||||
# Or download just the client folder
|
# 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**:
|
1. **Configure API Connection**:
|
||||||
- Click "Configure Now" in the welcome dialog
|
- 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
|
- Enter your API key
|
||||||
- Test the connection
|
- 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:
|
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
|
- **API Key**: Your authentication key for the backend API
|
||||||
|
|
||||||
### Environment Variables
|
### Environment Variables
|
||||||
@ -176,7 +176,7 @@ For proper routing with hash-based navigation, no special server configuration i
|
|||||||
|
|
||||||
### CORS Configuration
|
### 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
|
```python
|
||||||
# In your backend CORS configuration
|
# In your backend CORS configuration
|
||||||
@ -263,8 +263,8 @@ For issues and questions:
|
|||||||
1. Check the browser console for error messages
|
1. Check the browser console for error messages
|
||||||
2. Verify backend API is running and accessible
|
2. Verify backend API is running and accessible
|
||||||
3. Check network connectivity and CORS configuration
|
3. Check network connectivity and CORS configuration
|
||||||
4. Review the SeReact backend documentation
|
4. Review the Contoso backend documentation
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
This frontend client is part of the SeReact project. See the main project license for details.
|
This frontend client is part of the Contoso project. See the main project license for details.
|
||||||
@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>SeReact Debug</title>
|
<title>Contoso Debug</title>
|
||||||
<style>
|
<style>
|
||||||
body { font-family: Arial, sans-serif; margin: 20px; }
|
body { font-family: Arial, sans-serif; margin: 20px; }
|
||||||
button { margin: 5px; padding: 10px; }
|
button { margin: 5px; padding: 10px; }
|
||||||
@ -12,7 +12,7 @@
|
|||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>SeReact Debug Page</h1>
|
<h1>Contoso Debug Page</h1>
|
||||||
|
|
||||||
<div class="debug">
|
<div class="debug">
|
||||||
<h3>Debug Controls</h3>
|
<h3>Debug Controls</h3>
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>SeReact - AI-Powered Image Management</title>
|
<title>Contoso - AI-Powered Image Management</title>
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
|
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
|
||||||
<link href="styles.css" rel="stylesheet">
|
<link href="styles.css" rel="stylesheet">
|
||||||
@ -13,7 +13,7 @@
|
|||||||
<nav class="navbar navbar-expand-lg navbar-dark bg-primary">
|
<nav class="navbar navbar-expand-lg navbar-dark bg-primary">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<a class="navbar-brand" href="#home" onclick="showPage('home'); return false;">
|
<a class="navbar-brand" href="#home" onclick="showPage('home'); return false;">
|
||||||
<i class="fas fa-search me-2"></i>SeReact
|
<i class="fas fa-search me-2"></i>Contoso
|
||||||
</a>
|
</a>
|
||||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
|
||||||
<span class="navbar-toggler-icon"></span>
|
<span class="navbar-toggler-icon"></span>
|
||||||
@ -72,7 +72,7 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="jumbotron bg-light p-5 rounded">
|
<div class="jumbotron bg-light p-5 rounded">
|
||||||
<h1 class="display-4">Welcome to SeReact</h1>
|
<h1 class="display-4">Welcome to Contoso</h1>
|
||||||
<p class="lead">AI-powered image management and semantic search platform</p>
|
<p class="lead">AI-powered image management and semantic search platform</p>
|
||||||
<hr class="my-4">
|
<hr class="my-4">
|
||||||
<p>Upload images, manage your team, and search using natural language queries.</p>
|
<p>Upload images, manage your team, and search using natural language queries.</p>
|
||||||
@ -127,7 +127,7 @@
|
|||||||
<label for="apiBaseUrl" class="form-label">API Base URL</label>
|
<label for="apiBaseUrl" class="form-label">API Base URL</label>
|
||||||
<input type="url" class="form-control" id="apiBaseUrl"
|
<input type="url" class="form-control" id="apiBaseUrl"
|
||||||
placeholder="http://localhost:8000" required>
|
placeholder="http://localhost:8000" required>
|
||||||
<div class="form-text">The base URL of your SeReact API server</div>
|
<div class="form-text">The base URL of your Contoso API server</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label for="apiKey" class="form-label">API Key</label>
|
<label for="apiKey" class="form-label">API Key</label>
|
||||||
|
|||||||
@ -10,7 +10,7 @@ const app = {
|
|||||||
// Initialize the application
|
// Initialize the application
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
console.log('App.js DOMContentLoaded fired');
|
console.log('App.js DOMContentLoaded fired');
|
||||||
console.log('SeReact Frontend v' + app.version + ' - Initializing...');
|
console.log('Contoso Frontend v' + app.version + ' - Initializing...');
|
||||||
|
|
||||||
// Initialize configuration
|
// Initialize configuration
|
||||||
initializeApp();
|
initializeApp();
|
||||||
@ -22,7 +22,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
checkInitialConfiguration();
|
checkInitialConfiguration();
|
||||||
|
|
||||||
app.initialized = true;
|
app.initialized = true;
|
||||||
console.log('SeReact Frontend - Initialization complete');
|
console.log('Contoso Frontend - Initialization complete');
|
||||||
});
|
});
|
||||||
|
|
||||||
// Initialize the application
|
// Initialize the application
|
||||||
@ -98,7 +98,7 @@ function showWelcomeMessage() {
|
|||||||
const modalBody = `
|
const modalBody = `
|
||||||
<div class="text-center mb-4">
|
<div class="text-center mb-4">
|
||||||
<i class="fas fa-rocket fa-3x text-primary mb-3"></i>
|
<i class="fas fa-rocket fa-3x text-primary mb-3"></i>
|
||||||
<h4>Welcome to SeReact!</h4>
|
<h4>Welcome to Contoso!</h4>
|
||||||
<p class="lead">AI-powered image management and semantic search platform</p>
|
<p class="lead">AI-powered image management and semantic search platform</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -135,7 +135,7 @@ function showWelcomeMessage() {
|
|||||||
</button>
|
</button>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const modal = createModal('welcomeModal', 'Welcome to SeReact', modalBody, modalFooter);
|
const modal = createModal('welcomeModal', 'Welcome to Contoso', modalBody, modalFooter);
|
||||||
modal.show();
|
modal.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -366,10 +366,10 @@ window.addEventListener('unhandledrejection', (e) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Export app object for debugging
|
// Export app object for debugging
|
||||||
window.SeReactApp = app;
|
window.ContosoApp = app;
|
||||||
|
|
||||||
// Add helpful console messages
|
// Add helpful console messages
|
||||||
console.log('%cSeReact Frontend', 'color: #0d6efd; font-size: 24px; font-weight: bold;');
|
console.log('%cContoso Frontend', 'color: #0d6efd; font-size: 24px; font-weight: bold;');
|
||||||
console.log('%cVersion: ' + app.version, 'color: #6c757d; font-size: 14px;');
|
console.log('%cVersion: ' + app.version, 'color: #6c757d; font-size: 14px;');
|
||||||
console.log('%cKeyboard Shortcuts:', 'color: #198754; font-size: 16px; font-weight: bold;');
|
console.log('%cKeyboard Shortcuts:', 'color: #198754; font-size: 16px; font-weight: bold;');
|
||||||
console.log('%c Ctrl+K: Search', 'color: #6c757d;');
|
console.log('%c Ctrl+K: Search', 'color: #6c757d;');
|
||||||
|
|||||||
@ -114,11 +114,6 @@ async function displaySearchResults(response, query) {
|
|||||||
<div class="loading-spinner"></div>
|
<div class="loading-spinner"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="position-absolute top-0 end-0 m-2">
|
|
||||||
<span class="badge bg-primary similarity-score">
|
|
||||||
${Math.round(similarity * 100)}% match
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h6 class="card-title">${escapeHtml(truncateText(image.description || 'Untitled', 60))}</h6>
|
<h6 class="card-title">${escapeHtml(truncateText(image.description || 'Untitled', 60))}</h6>
|
||||||
@ -274,7 +269,7 @@ async function shareSearchResults(query) {
|
|||||||
if (navigator.share) {
|
if (navigator.share) {
|
||||||
try {
|
try {
|
||||||
await navigator.share({
|
await navigator.share({
|
||||||
title: 'SeReact Search Results',
|
title: 'Contoso Search Results',
|
||||||
text: text,
|
text: text,
|
||||||
url: url
|
url: url
|
||||||
});
|
});
|
||||||
|
|||||||
@ -43,8 +43,8 @@ function showPage(pageId) {
|
|||||||
updateNavActiveState(pageId);
|
updateNavActiveState(pageId);
|
||||||
|
|
||||||
// Update app state
|
// Update app state
|
||||||
if (window.SeReactApp) {
|
if (window.ContosoApp) {
|
||||||
window.SeReactApp.currentPage = pageId;
|
window.ContosoApp.currentPage = pageId;
|
||||||
}
|
}
|
||||||
app.currentPage = pageId; // Also update the local app state
|
app.currentPage = pageId; // Also update the local app state
|
||||||
|
|
||||||
@ -329,8 +329,8 @@ function initializeUI() {
|
|||||||
console.log('Initial page:', initialPage);
|
console.log('Initial page:', initialPage);
|
||||||
|
|
||||||
// Set initial app state
|
// Set initial app state
|
||||||
if (window.SeReactApp) {
|
if (window.ContosoApp) {
|
||||||
window.SeReactApp.currentPage = initialPage;
|
window.ContosoApp.currentPage = initialPage;
|
||||||
}
|
}
|
||||||
|
|
||||||
showPage(initialPage);
|
showPage(initialPage);
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# SeReact Frontend Client
|
# Contoso Frontend Client
|
||||||
#
|
#
|
||||||
# This is a pure frontend application that runs in the browser.
|
# This is a pure frontend application that runs in the browser.
|
||||||
# No Python dependencies are required.
|
# No Python dependencies are required.
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env python3
|
#!/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
|
import http.server
|
||||||
@ -44,7 +44,7 @@ def main():
|
|||||||
with socketserver.TCPServer((HOST, PORT), CustomHTTPRequestHandler) as httpd:
|
with socketserver.TCPServer((HOST, PORT), CustomHTTPRequestHandler) as httpd:
|
||||||
server_url = f"http://{HOST}:{PORT}"
|
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"📁 Serving files from: {os.getcwd()}")
|
||||||
print(f"🌐 Server running at: {server_url}")
|
print(f"🌐 Server running at: {server_url}")
|
||||||
print(f"📱 Open in browser: {server_url}")
|
print(f"📱 Open in browser: {server_url}")
|
||||||
@ -69,7 +69,7 @@ def main():
|
|||||||
httpd.serve_forever()
|
httpd.serve_forever()
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
print("\n🛑 Server stopped by user")
|
print("\n🛑 Server stopped by user")
|
||||||
print("👋 Thanks for using SeReact!")
|
print("👋 Thanks for using Contoso!")
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
@ -1,4 +1,4 @@
|
|||||||
/* Custom styles for SeReact Frontend */
|
/* Custom styles for Contoso Frontend */
|
||||||
|
|
||||||
:root {
|
:root {
|
||||||
--primary-color: #0d6efd;
|
--primary-color: #0d6efd;
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>SeReact Test</title>
|
<title>Contoso Test</title>
|
||||||
<style>
|
<style>
|
||||||
.page { display: none; padding: 20px; border: 1px solid #ccc; margin: 10px; }
|
.page { display: none; padding: 20px; border: 1px solid #ccc; margin: 10px; }
|
||||||
.page.active { display: block; }
|
.page.active { display: block; }
|
||||||
@ -11,7 +11,7 @@
|
|||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>SeReact Navigation Test</h1>
|
<h1>Contoso Navigation Test</h1>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<button onclick="showPage('home')">Home</button>
|
<button onclick="showPage('home')">Home</button>
|
||||||
|
|||||||
@ -44,7 +44,7 @@ else:
|
|||||||
storage_client = storage.Client()
|
storage_client = storage.Client()
|
||||||
|
|
||||||
# Get bucket name from environment variable
|
# 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
|
# Initialize Qdrant
|
||||||
QDRANT_HOST = os.environ.get('QDRANT_HOST', 'localhost')
|
QDRANT_HOST = os.environ.get('QDRANT_HOST', 'localhost')
|
||||||
|
|||||||
@ -2,9 +2,9 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Configuration
|
# Configuration
|
||||||
IMAGE_NAME="sereact-api"
|
IMAGE_NAME="contoso-api"
|
||||||
REGION="us-central1"
|
REGION="us-central1"
|
||||||
SERVICE_NAME="sereact"
|
SERVICE_NAME="contoso"
|
||||||
|
|
||||||
# Get project ID from terraform.tfvars if it exists, otherwise use gcloud
|
# Get project ID from terraform.tfvars if it exists, otherwise use gcloud
|
||||||
if [ -f "$(dirname "$0")/terraform/terraform.tfvars" ]; then
|
if [ -f "$(dirname "$0")/terraform/terraform.tfvars" ]; then
|
||||||
|
|||||||
1
deployment/terraform/.terraform.tfstate.lock.info
Normal file
1
deployment/terraform/.terraform.tfstate.lock.info
Normal file
@ -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"}
|
||||||
@ -50,11 +50,11 @@ resource "google_firestore_database" "database" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Container Registry - no explicit resource needed, just enable the API
|
# 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
|
# Cloud Run service
|
||||||
resource "google_cloud_run_service" "sereact" {
|
resource "google_cloud_run_service" "contoso" {
|
||||||
name = "sereact"
|
name = "contoso"
|
||||||
location = var.region
|
location = var.region
|
||||||
|
|
||||||
metadata {
|
metadata {
|
||||||
@ -77,7 +77,7 @@ resource "google_cloud_run_service" "sereact" {
|
|||||||
spec {
|
spec {
|
||||||
containers {
|
containers {
|
||||||
# Use our optimized image
|
# 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 {
|
ports {
|
||||||
container_port = 8000
|
container_port = 8000
|
||||||
@ -154,8 +154,8 @@ resource "google_cloud_run_service" "sereact" {
|
|||||||
|
|
||||||
# Make the Cloud Run service publicly accessible
|
# Make the Cloud Run service publicly accessible
|
||||||
resource "google_cloud_run_service_iam_member" "public_access" {
|
resource "google_cloud_run_service_iam_member" "public_access" {
|
||||||
service = google_cloud_run_service.sereact.name
|
service = google_cloud_run_service.contoso.name
|
||||||
location = google_cloud_run_service.sereact.location
|
location = google_cloud_run_service.contoso.location
|
||||||
role = "roles/run.invoker"
|
role = "roles/run.invoker"
|
||||||
member = "allUsers"
|
member = "allUsers"
|
||||||
}
|
}
|
||||||
@ -1,5 +1,5 @@
|
|||||||
output "cloud_run_url" {
|
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"
|
description = "The URL of the deployed Cloud Run service"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -14,7 +14,7 @@ output "firestore_database_id" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
output "container_registry_url" {
|
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"
|
description = "The URL of the Container Registry repository"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -63,7 +63,7 @@ output "cloud_run_qdrant_host_internal" {
|
|||||||
|
|
||||||
output "deployment_summary" {
|
output "deployment_summary" {
|
||||||
value = {
|
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_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
|
qdrant_host_ip = google_compute_instance.vector_db_vm.network_interface[0].access_config[0].nat_ip
|
||||||
firestore_database = var.firestore_db_name
|
firestore_database = var.firestore_db_name
|
||||||
|
|||||||
@ -10,7 +10,7 @@ resource "google_pubsub_topic" "image_processing" {
|
|||||||
|
|
||||||
labels = {
|
labels = {
|
||||||
environment = var.environment
|
environment = var.environment
|
||||||
service = "sereact"
|
service = "contoso"
|
||||||
component = "image-processing"
|
component = "image-processing"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -21,7 +21,7 @@ resource "google_pubsub_topic" "image_processing_dlq" {
|
|||||||
|
|
||||||
labels = {
|
labels = {
|
||||||
environment = var.environment
|
environment = var.environment
|
||||||
service = "sereact"
|
service = "contoso"
|
||||||
component = "image-processing-dlq"
|
component = "image-processing-dlq"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -37,7 +37,7 @@ resource "google_pubsub_subscription" "image_processing_dlq" {
|
|||||||
|
|
||||||
labels = {
|
labels = {
|
||||||
environment = var.environment
|
environment = var.environment
|
||||||
service = "sereact"
|
service = "contoso"
|
||||||
component = "image-processing-dlq"
|
component = "image-processing-dlq"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -2,7 +2,7 @@ project_id = "your-gcp-project-id"
|
|||||||
region = "us-central1"
|
region = "us-central1"
|
||||||
zone = "us-central1-a"
|
zone = "us-central1-a"
|
||||||
storage_bucket_name = "your-app-storage-bucket"
|
storage_bucket_name = "your-app-storage-bucket"
|
||||||
firestore_db_name = "sereact-imagedb"
|
firestore_db_name = "contoso-imagedb"
|
||||||
|
|
||||||
# Vector Database Configuration
|
# Vector Database Configuration
|
||||||
qdrant_api_key = "your-secure-api-key-here" # Optional: leave empty for no authentication
|
qdrant_api_key = "your-secure-api-key-here" # Optional: leave empty for no authentication
|
||||||
|
|||||||
@ -23,7 +23,7 @@ variable "storage_bucket_name" {
|
|||||||
variable "firestore_db_name" {
|
variable "firestore_db_name" {
|
||||||
description = "The name of the Firestore database"
|
description = "The name of the Firestore database"
|
||||||
type = string
|
type = string
|
||||||
default = "sereact-imagedb"
|
default = "contoso-imagedb"
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "environment" {
|
variable "environment" {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
# VM instance for vector database
|
# VM instance for vector database
|
||||||
resource "google_compute_instance" "vector_db_vm" {
|
resource "google_compute_instance" "vector_db_vm" {
|
||||||
name = "sereact-vector-db"
|
name = "contoso-vector-db"
|
||||||
machine_type = "e2-standard-2" # 2 vCPUs, 8GB RAM
|
machine_type = "e2-standard-2" # 2 vCPUs, 8GB RAM
|
||||||
zone = var.zone
|
zone = var.zone
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
# Build and Deployment Scripts
|
# 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
|
## Prerequisites
|
||||||
|
|
||||||
@ -12,7 +12,7 @@ This directory contains scripts for building and deploying the Sereact API appli
|
|||||||
|
|
||||||
### Build Script (`build.sh`)
|
### Build Script (`build.sh`)
|
||||||
|
|
||||||
Builds the Docker image for the Sereact API.
|
Builds the Docker image for the Contoso API.
|
||||||
|
|
||||||
**Usage:**
|
**Usage:**
|
||||||
```bash
|
```bash
|
||||||
@ -30,7 +30,7 @@ REGISTRY=gcr.io/my-project ./scripts/build.sh
|
|||||||
```
|
```
|
||||||
|
|
||||||
**Environment Variables:**
|
**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")
|
- `IMAGE_TAG`: Tag for the Docker image (default: "latest")
|
||||||
- `REGISTRY`: Container registry to use (default: empty, using DockerHub)
|
- `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:
|
All variables from the build script, plus:
|
||||||
- `PROJECT_ID`: Google Cloud project ID (required for Cloud Run deployment)
|
- `PROJECT_ID`: Google Cloud project ID (required for Cloud Run deployment)
|
||||||
- `REGION`: Google Cloud region (default: "us-central1")
|
- `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`)
|
### 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)
|
- `PROJECT_ID`: Google Cloud project ID (required)
|
||||||
- `REGION`: Google Cloud region (default: "us-central1")
|
- `REGION`: Google Cloud region (default: "us-central1")
|
||||||
- `SERVICE_CONFIG`: Path to the service configuration file (default: "deployment/cloud-run/service.yaml")
|
- `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")
|
- `IMAGE_TAG`: Tag for the Docker image (default: "latest")
|
||||||
- `REGISTRY`: Container registry to use (default: "gcr.io")
|
- `REGISTRY`: Container registry to use (default: "gcr.io")
|
||||||
- `BUILD`: Set to "true" to build the image before deployment (default: "false")
|
- `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`)
|
### Frontend Client Script (`client.sh`)
|
||||||
|
|
||||||
Manages the SeReact frontend client development, building, and deployment.
|
Manages the Contoso frontend client development, building, and deployment.
|
||||||
|
|
||||||
**Usage:**
|
**Usage:**
|
||||||
```bash
|
```bash
|
||||||
@ -170,13 +170,13 @@ DEPLOY_TARGET=netlify ./scripts/client.sh deploy
|
|||||||
|
|
||||||
# Scripts Documentation
|
# Scripts Documentation
|
||||||
|
|
||||||
This directory contains utility scripts for the SEREACT application.
|
This directory contains utility scripts for the CONTOSO application.
|
||||||
|
|
||||||
## Database Seeding Scripts
|
## Database Seeding Scripts
|
||||||
|
|
||||||
### `seed_firestore.py`
|
### `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
|
#### 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:
|
2. If not using application default credentials, create a service account key file:
|
||||||
```bash
|
```bash
|
||||||
gcloud iam service-accounts create sereact-app
|
gcloud iam service-accounts create contoso-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 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=sereact-app@YOUR_PROJECT_ID.iam.gserviceaccount.com
|
gcloud iam service-accounts keys create credentials.json --iam-account=contoso-app@YOUR_PROJECT_ID.iam.gserviceaccount.com
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Set environment variables:
|
3. Set environment variables:
|
||||||
@ -233,13 +233,13 @@ python scripts/seed_firestore.py
|
|||||||
The script will create the following data:
|
The script will create the following data:
|
||||||
|
|
||||||
1. **Teams**:
|
1. **Teams**:
|
||||||
- Sereact Development
|
- Contoso Development
|
||||||
- Marketing Team
|
- Marketing Team
|
||||||
- Customer Support
|
- Customer Support
|
||||||
|
|
||||||
2. **Users**:
|
2. **Users**:
|
||||||
- Admin User (team: Sereact Development)
|
- Admin User (team: Contoso Development)
|
||||||
- Developer User (team: Sereact Development)
|
- Developer User (team: Contoso Development)
|
||||||
- Marketing User (team: Marketing Team)
|
- Marketing User (team: Marketing Team)
|
||||||
- Support User (team: Customer Support)
|
- Support User (team: Customer Support)
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Set defaults
|
# Set defaults
|
||||||
IMAGE_NAME=${IMAGE_NAME:-"sereact-api"}
|
IMAGE_NAME=${IMAGE_NAME:-"contoso-api"}
|
||||||
IMAGE_TAG=${IMAGE_TAG:-"latest"}
|
IMAGE_TAG=${IMAGE_TAG:-"latest"}
|
||||||
PROJECT_ID=${PROJECT_ID:-"gen-lang-client-0424120530"}
|
PROJECT_ID=${PROJECT_ID:-"gen-lang-client-0424120530"}
|
||||||
|
|
||||||
|
|||||||
@ -25,7 +25,7 @@ print_color() {
|
|||||||
|
|
||||||
print_header() {
|
print_header() {
|
||||||
echo
|
echo
|
||||||
print_color $CYAN "🚀 SeReact Frontend Client Manager"
|
print_color $CYAN "🚀 Contoso Frontend Client Manager"
|
||||||
echo
|
echo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env python3
|
#!/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
|
This script provides a convenient way to run different types of tests
|
||||||
with proper environment setup and reporting.
|
with proper environment setup and reporting.
|
||||||
@ -159,7 +159,7 @@ def run_coverage_tests():
|
|||||||
|
|
||||||
def main():
|
def main():
|
||||||
"""Main function"""
|
"""Main function"""
|
||||||
parser = argparse.ArgumentParser(description="Run SEREACT API tests")
|
parser = argparse.ArgumentParser(description="Run CONTOSO API tests")
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"test_type",
|
"test_type",
|
||||||
choices=["unit", "integration", "e2e", "all", "coverage"],
|
choices=["unit", "integration", "e2e", "all", "coverage"],
|
||||||
@ -173,7 +173,7 @@ def main():
|
|||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
print("🧪 SEREACT API Test Runner")
|
print("🧪 CONTOSO API Test Runner")
|
||||||
print("=" * 50)
|
print("=" * 50)
|
||||||
|
|
||||||
# Check environment unless skipped
|
# Check environment unless skipped
|
||||||
|
|||||||
@ -141,7 +141,7 @@ async def seed_teams():
|
|||||||
|
|
||||||
teams_data = [
|
teams_data = [
|
||||||
{
|
{
|
||||||
"name": "Sereact Development",
|
"name": "Contoso Development",
|
||||||
"description": "Internal development team"
|
"description": "Internal development team"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -169,23 +169,23 @@ async def seed_users(team_ids):
|
|||||||
|
|
||||||
users_data = [
|
users_data = [
|
||||||
{
|
{
|
||||||
"email": "admin@sereact.com",
|
"email": "admin@contoso.com",
|
||||||
"name": "Admin User",
|
"name": "Admin User",
|
||||||
"team_id": team_ids[0],
|
"team_id": team_ids[0],
|
||||||
"is_admin": True
|
"is_admin": True
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"email": "developer@sereact.com",
|
"email": "developer@contoso.com",
|
||||||
"name": "Developer User",
|
"name": "Developer User",
|
||||||
"team_id": team_ids[0]
|
"team_id": team_ids[0]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"email": "marketing@sereact.com",
|
"email": "marketing@contoso.com",
|
||||||
"name": "Marketing User",
|
"name": "Marketing User",
|
||||||
"team_id": team_ids[1]
|
"team_id": team_ids[1]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"email": "support@sereact.com",
|
"email": "support@contoso.com",
|
||||||
"name": "Support User",
|
"name": "Support User",
|
||||||
"team_id": team_ids[2]
|
"team_id": team_ids[2]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
echo "Stopping Sereact API server..."
|
echo "Stopping Contoso API server..."
|
||||||
|
|
||||||
# Find and kill uvicorn processes
|
# Find and kill uvicorn processes
|
||||||
PIDS=$(ps aux | grep "uvicorn main:app" | grep -v grep | awk '{print $2}')
|
PIDS=$(ps aux | grep "uvicorn main:app" | grep -v grep | awk '{print $2}')
|
||||||
|
|||||||
@ -5,7 +5,7 @@ from pydantic import AnyHttpUrl, field_validator
|
|||||||
|
|
||||||
class Settings(BaseSettings):
|
class Settings(BaseSettings):
|
||||||
# Project settings
|
# Project settings
|
||||||
PROJECT_NAME: str = "SEREACT - Secure Image Management API"
|
PROJECT_NAME: str = "CONTOSO - Secure Image Management API"
|
||||||
API_V1_STR: str = "/api/v1"
|
API_V1_STR: str = "/api/v1"
|
||||||
|
|
||||||
# Environment
|
# Environment
|
||||||
@ -66,7 +66,7 @@ class Settings(BaseSettings):
|
|||||||
|
|
||||||
# Firestore settings
|
# Firestore settings
|
||||||
FIRESTORE_PROJECT_ID: str = os.getenv("FIRESTORE_PROJECT_ID", "")
|
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")
|
FIRESTORE_CREDENTIALS_FILE: str = os.getenv("FIRESTORE_CREDENTIALS_FILE", "firestore-credentials.json")
|
||||||
|
|
||||||
# Google Cloud Storage settings
|
# Google Cloud Storage settings
|
||||||
|
|||||||
@ -39,7 +39,7 @@ async def test_create_collection(client: TestClient, admin_api_key: tuple, test_
|
|||||||
"description": "A collection for testing images",
|
"description": "A collection for testing images",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"category": "test",
|
"category": "test",
|
||||||
"project": "sereact"
|
"project": "contoso"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@ -480,7 +480,7 @@ async def test_collection_export(client: TestClient, admin_api_key: tuple):
|
|||||||
json={
|
json={
|
||||||
"name": "Export Collection",
|
"name": "Export Collection",
|
||||||
"description": "Collection for export testing",
|
"description": "Collection for export testing",
|
||||||
"metadata": {"category": "test", "project": "sereact"}
|
"metadata": {"category": "test", "project": "contoso"}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
collection_id = collection_response.json()["id"]
|
collection_id = collection_response.json()["id"]
|
||||||
|
|||||||
@ -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:
|
This file provides shared fixtures and configuration for:
|
||||||
- Unit tests (with mocked dependencies)
|
- Unit tests (with mocked dependencies)
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
"""Integration tests package for SEREACT database layer"""
|
"""Integration tests package for CONTOSO database layer"""
|
||||||
@ -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:
|
These tests cover the complete user workflows described in the README:
|
||||||
1. Use pre-seeded API key for authentication
|
1. Use pre-seeded API key for authentication
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user