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:
Krikorios
2026-08-23 16:38:41 +03:00
parent fbe92c9d16
commit a0b297285a
75 changed files with 5158 additions and 2837 deletions
+4 -5
View File
@@ -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&apos;re registered as a driver, {user?.firstName || "there"}!
You&apos;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&apos;ll contact you at{" "}
{user?.emailAddresses[0]?.emailAddress} once your account is activated.
{user?.email} once your account is activated.
</Text>
<CustomButton