feat: Improve Windows deployment and fix production paths
Data Entry App: - Fix shared path finding for both dev and production environments - Add base URL support for IIS subdirectory deployment (/data-entry/) - Use import.meta.env.BASE_URL in router for correct path handling - Add email-validator and python-jose dependencies Deployment Scripts: - Enhance Build-ROA2WEB.ps1 with improved build process - Update ROA2WEB-Console.ps1 with Data Entry support - Improve Publish-And-Deploy.ps1 deployment workflow - Update deploy-config.json with new settings Gitignore: - Add more build cache patterns to ignore - Add temp frontend build directories 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -22,8 +22,26 @@ from fastapi.middleware.cors import CORSMiddleware
|
||||
from fastapi.staticfiles import StaticFiles
|
||||
|
||||
# Add shared modules to path
|
||||
project_root = Path(__file__).parent.parent.parent.parent
|
||||
sys.path.insert(0, str(project_root / "shared"))
|
||||
# Development: data-entry-app/backend/app/main.py -> 4 parents to project root
|
||||
# Production: data-entry-backend/app/main.py -> 3 parents to roa2web root
|
||||
def find_shared_path():
|
||||
"""Find shared folder - works in both dev and production."""
|
||||
current = Path(__file__).parent # app/
|
||||
|
||||
# Try different parent levels to find shared folder
|
||||
for levels in range(1, 6):
|
||||
candidate = current
|
||||
for _ in range(levels):
|
||||
candidate = candidate.parent
|
||||
shared_path = candidate / "shared"
|
||||
if shared_path.exists() and (shared_path / "auth").exists():
|
||||
return shared_path
|
||||
|
||||
# Fallback to original logic
|
||||
return Path(__file__).parent.parent.parent.parent / "shared"
|
||||
|
||||
shared_path = find_shared_path()
|
||||
sys.path.insert(0, str(shared_path))
|
||||
|
||||
from app.config import settings
|
||||
from app.db.database import init_db
|
||||
|
||||
@@ -11,6 +11,7 @@ alembic>=1.13.1
|
||||
# Pydantic
|
||||
pydantic>=2.5.3
|
||||
pydantic-settings>=2.1.0
|
||||
email-validator>=2.1.0
|
||||
|
||||
# File handling
|
||||
python-multipart>=0.0.6
|
||||
@@ -19,6 +20,7 @@ Pillow>=10.2.0
|
||||
|
||||
# Authentication (shared)
|
||||
PyJWT>=2.8.0
|
||||
python-jose[cryptography]>=3.3.0
|
||||
|
||||
# Oracle (for nomenclatures)
|
||||
oracledb>=2.0.1
|
||||
|
||||
@@ -35,7 +35,7 @@ const routes = [
|
||||
]
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHistory(),
|
||||
history: createWebHistory(import.meta.env.BASE_URL),
|
||||
routes
|
||||
})
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@ import { fileURLToPath, URL } from 'node:url'
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [vue()],
|
||||
// Base path for production deployment in IIS subdirectory
|
||||
base: process.env.NODE_ENV === 'production' ? '/data-entry/' : '/',
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
||||
|
||||
Reference in New Issue
Block a user