feat: Initialize Next.js project with Prisma, Tailwind CSS, and API routes for device management and testing.
This commit is contained in:
BIN
prisma/dev.db
Normal file
BIN
prisma/dev.db
Normal file
Binary file not shown.
37
prisma/migrations/20251223024517_init/migration.sql
Normal file
37
prisma/migrations/20251223024517_init/migration.sql
Normal file
@@ -0,0 +1,37 @@
|
||||
-- CreateTable
|
||||
CREATE TABLE "Device" (
|
||||
"id" TEXT NOT NULL PRIMARY KEY,
|
||||
"serialNumber" TEXT NOT NULL,
|
||||
"macAddress" TEXT NOT NULL,
|
||||
"name" TEXT DEFAULT 'Unnamed Device',
|
||||
"status" TEXT NOT NULL DEFAULT 'PENDING',
|
||||
"lastHeartbeat" DATETIME,
|
||||
"uptime" INTEGER,
|
||||
"temperature" REAL,
|
||||
"activeSlot" TEXT NOT NULL DEFAULT 'A',
|
||||
"firmwareVersion" TEXT NOT NULL DEFAULT '1.0.0',
|
||||
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" DATETIME NOT NULL
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "Test" (
|
||||
"id" TEXT NOT NULL PRIMARY KEY,
|
||||
"deviceId" TEXT NOT NULL,
|
||||
"timestamp" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"type" TEXT NOT NULL,
|
||||
"status" TEXT NOT NULL,
|
||||
"hdmi5v" BOOLEAN NOT NULL,
|
||||
"edid1080p" BOOLEAN,
|
||||
"edid4k120" BOOLEAN,
|
||||
"diodeResults" TEXT,
|
||||
"rawOutput" TEXT,
|
||||
"summary" TEXT NOT NULL,
|
||||
CONSTRAINT "Test_deviceId_fkey" FOREIGN KEY ("deviceId") REFERENCES "Device" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
|
||||
);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "Device_serialNumber_key" ON "Device"("serialNumber");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "Device_macAddress_key" ON "Device"("macAddress");
|
||||
3
prisma/migrations/migration_lock.toml
Normal file
3
prisma/migrations/migration_lock.toml
Normal file
@@ -0,0 +1,3 @@
|
||||
# Please do not edit this file manually
|
||||
# It should be added in your version-control system (e.g., Git)
|
||||
provider = "sqlite"
|
||||
42
prisma/schema.prisma
Normal file
42
prisma/schema.prisma
Normal file
@@ -0,0 +1,42 @@
|
||||
// This is your Prisma schema file,
|
||||
// learn more about it in the docs: https://pris.ly/d/prisma-schema
|
||||
|
||||
generator client {
|
||||
provider = "prisma-client-js"
|
||||
}
|
||||
|
||||
datasource db {
|
||||
provider = "sqlite"
|
||||
url = env("DATABASE_URL")
|
||||
}
|
||||
|
||||
model Device {
|
||||
id String @id @default(cuid())
|
||||
serialNumber String @unique
|
||||
macAddress String @unique
|
||||
name String? @default("Unnamed Device")
|
||||
status String @default("PENDING") // PENDING, ENROLLED, OFFLINE
|
||||
lastHeartbeat DateTime?
|
||||
uptime Int? // in seconds
|
||||
temperature Float?
|
||||
activeSlot String @default("A") // A or B
|
||||
firmwareVersion String @default("1.0.0")
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
tests Test[]
|
||||
}
|
||||
|
||||
model Test {
|
||||
id String @id @default(cuid())
|
||||
deviceId String
|
||||
device Device @relation(fields: [deviceId], references: [id])
|
||||
timestamp DateTime @default(now())
|
||||
type String // HDMI_OFFLINE, HDMI_ONLINE
|
||||
status String // PASS, FAIL, WARNING
|
||||
hdmi5v Boolean
|
||||
edid1080p Boolean?
|
||||
edid4k120 Boolean?
|
||||
diodeResults String? // JSON string of pin-by-pin results
|
||||
rawOutput String? // Any extra log data from the device
|
||||
summary String // Executive summary of the result
|
||||
}
|
||||
Reference in New Issue
Block a user