Add self-hosted auth, admin API, and owner web dashboard
- Replace Clerk with self-hosted JWT auth (register/login/verify, bcrypt passwords, Gmail OTP with console fallback) - Add lib/db.ts pg pool + transaction helpers; seed script migrates legacy Clerk-era schema (drop clerk_id, enforce UUID ids and unique email) - Add owner-gated admin API: stats, users, drivers CRUD, rides - Add dashboard/ Vite React owner dashboard (login, overview, users, fleet, rides) with dev-server proxy to avoid Expo CORS middleware - Add scripts/set-owner.mjs for role management
This commit is contained in:
@@ -1,16 +1,15 @@
|
||||
import { useClerk, useUser } from "@clerk/clerk-expo";
|
||||
import { Image, Text, View } from "react-native";
|
||||
import { SafeAreaView } from "react-native-safe-area-context";
|
||||
|
||||
import { CustomButton } from "@/components/custom-button";
|
||||
import { images } from "@/constants";
|
||||
import { useSession } from "@/lib/session";
|
||||
|
||||
// Placeholder driver home. The driver experience (going online, accepting
|
||||
// rides) is not built yet — drivers are registered here and managed in the
|
||||
// database for now.
|
||||
const DriverHome = () => {
|
||||
const { user } = useUser();
|
||||
const { signOut } = useClerk();
|
||||
const { signOut, user } = useSession();
|
||||
|
||||
return (
|
||||
<SafeAreaView className="flex-1 bg-white justify-center items-center px-7">
|
||||
@@ -21,12 +20,12 @@ const DriverHome = () => {
|
||||
/>
|
||||
|
||||
<Text className="text-2xl font-JakartaBold text-center">
|
||||
You're registered as a driver, {user?.firstName || "there"}!
|
||||
You're registered as a driver, {user?.name || "there"}!
|
||||
</Text>
|
||||
|
||||
<Text className="text-base text-general-200 font-Jakarta text-center mt-3">
|
||||
Driver mode is coming soon. We'll contact you at{" "}
|
||||
{user?.emailAddresses[0]?.emailAddress} once your account is activated.
|
||||
{user?.email} once your account is activated.
|
||||
</Text>
|
||||
|
||||
<CustomButton
|
||||
|
||||
Reference in New Issue
Block a user