feat: Update development server scripts and fix admin dashboard
Some checks failed
ParentFlow CI/CD Pipeline / Backend Tests (push) Has been cancelled
ParentFlow CI/CD Pipeline / Frontend Tests (push) Has been cancelled
ParentFlow CI/CD Pipeline / Security Scanning (push) Has been cancelled
ParentFlow CI/CD Pipeline / Build Docker Images (map[context:maternal-app/maternal-app-backend dockerfile:Dockerfile.production name:backend]) (push) Has been cancelled
ParentFlow CI/CD Pipeline / Build Docker Images (map[context:maternal-web dockerfile:Dockerfile.production name:frontend]) (push) Has been cancelled
ParentFlow CI/CD Pipeline / Deploy to Development (push) Has been cancelled
ParentFlow CI/CD Pipeline / Deploy to Production (push) Has been cancelled
CI/CD Pipeline / Lint and Test (push) Has been cancelled
CI/CD Pipeline / E2E Tests (push) Has been cancelled
CI/CD Pipeline / Build Application (push) Has been cancelled

- Fix start-dev.sh to use npx for correct port binding (3030 for frontend, 3335 for admin)
- Add aggressive port cleanup to ensure ports are always free before starting
- Fix admin dashboard layout to be client component (resolves MUI theme error)
- Bind all services to 0.0.0.0 for external access:
  - Backend: maternal-api.noru1.ro (port 3020)
  - Frontend: maternal.noru1.ro (port 3030)
  - Admin: pfadmin.noru1.ro (port 3335)
This commit is contained in:
Andrei
2025-10-06 23:09:40 +00:00
parent 27e284702b
commit 91b5923da1
2 changed files with 10 additions and 10 deletions

View File

@@ -1,15 +1,11 @@
import type { Metadata } from 'next';
'use client';
import { AppRouterCacheProvider } from '@mui/material-nextjs/v15-appRouter';
import { ThemeProvider } from '@mui/material/styles';
import CssBaseline from '@mui/material/CssBaseline';
import theme from '@/lib/theme';
import './globals.css';
export const metadata: Metadata = {
title: 'ParentFlow Admin Dashboard',
description: 'Admin dashboard for managing ParentFlow application',
};
export default function RootLayout({
children,
}: Readonly<{
@@ -17,6 +13,10 @@ export default function RootLayout({
}>) {
return (
<html lang="en">
<head>
<title>ParentFlow Admin Dashboard</title>
<meta name="description" content="Admin dashboard for managing ParentFlow application" />
</head>
<body>
<AppRouterCacheProvider>
<ThemeProvider theme={theme}>

View File

@@ -152,8 +152,8 @@ EOF
log "Created .env.local for frontend"
fi
# Start frontend in background
HOST=0.0.0.0 PORT=3030 npm run dev > /tmp/frontend-dev.log 2>&1 &
# Start frontend in background (override the port in package.json)
npx next dev -p 3030 -H 0.0.0.0 > /tmp/frontend-dev.log 2>&1 &
FRONTEND_PID=$!
echo $FRONTEND_PID > /tmp/frontend-dev.pid
success "Frontend started (PID: $FRONTEND_PID)"
@@ -179,8 +179,8 @@ EOF
log "Created .env.local for admin dashboard"
fi
# Start admin dashboard in background
HOST=0.0.0.0 PORT=3335 npm run dev > /tmp/admin-dev.log 2>&1 &
# Start admin dashboard in background (use npx to ensure correct port)
npx next dev -p 3335 -H 0.0.0.0 > /tmp/admin-dev.log 2>&1 &
ADMIN_PID=$!
echo $ADMIN_PID > /tmp/admin-dev.pid
success "Admin Dashboard started (PID: $ADMIN_PID)"