Phase 1 scaffold: auth for all apps
- Backend: Fastify with two listeners (public + internal), routes, services, DB migration + seed - client_app: Flutter with BLoC, all auth screens (welcome, display name, register, OTP, force-register) - mitra_app: Flutter with BLoC, OTP-only login - control_center: React + Vite, email/password login, mitra/user management, anonymity settings - Docs: phase1 plan, API contract, client app mockup - CLAUDE.md and shared memory for all subprojects Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
27
control_center/src/App.jsx
Normal file
27
control_center/src/App.jsx
Normal file
@@ -0,0 +1,27 @@
|
||||
import { Routes, Route, Navigate } from 'react-router-dom'
|
||||
import { useAuth } from './core/auth/AuthContext'
|
||||
import LoginPage from './pages/login/LoginPage'
|
||||
import MitrasPage from './pages/mitras/MitrasPage'
|
||||
import UsersPage from './pages/users/UsersPage'
|
||||
import SettingsPage from './pages/settings/SettingsPage'
|
||||
import Layout from './components/Layout'
|
||||
|
||||
const ProtectedRoute = ({ children }) => {
|
||||
const { user, loading } = useAuth()
|
||||
if (loading) return <div>Loading...</div>
|
||||
return user ? children : <Navigate to="/login" replace />
|
||||
}
|
||||
|
||||
export default function App() {
|
||||
return (
|
||||
<Routes>
|
||||
<Route path="/login" element={<LoginPage />} />
|
||||
<Route path="/" element={<ProtectedRoute><Layout /></ProtectedRoute>}>
|
||||
<Route index element={<Navigate to="/mitras" replace />} />
|
||||
<Route path="mitras" element={<MitrasPage />} />
|
||||
<Route path="users" element={<UsersPage />} />
|
||||
<Route path="settings" element={<SettingsPage />} />
|
||||
</Route>
|
||||
</Routes>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user