API Gateway: - main.py with FastAPI app, CORS, health endpoints - WhatsApp routes: accounts CRUD, conversations, messages, internal events - WhatsApp schemas for request/response validation Frontend: - Login page with register option for first admin - MainLayout with sidebar navigation and user dropdown - Dashboard with statistics cards (accounts, conversations) - WhatsApp Accounts page with QR modal for connection - Inbox page with conversation list and real-time chat Full feature set for Fase 1 Foundation complete. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
26 lines
686 B
TypeScript
26 lines
686 B
TypeScript
import { Routes, Route, Navigate } from 'react-router-dom';
|
|
import { useAuthStore } from './store/auth';
|
|
import Login from './pages/Login';
|
|
import MainLayout from './layouts/MainLayout';
|
|
|
|
function PrivateRoute({ children }: { children: React.ReactNode }) {
|
|
const isAuthenticated = useAuthStore((state) => state.isAuthenticated);
|
|
return isAuthenticated ? <>{children}</> : <Navigate to="/login" replace />;
|
|
}
|
|
|
|
export default function App() {
|
|
return (
|
|
<Routes>
|
|
<Route path="/login" element={<Login />} />
|
|
<Route
|
|
path="/*"
|
|
element={
|
|
<PrivateRoute>
|
|
<MainLayout />
|
|
</PrivateRoute>
|
|
}
|
|
/>
|
|
</Routes>
|
|
);
|
|
}
|