feat(global): initialize project and framework structure, dockerize

This commit is contained in:
h
2025-09-02 00:03:50 +03:00
parent 3194237f5f
commit 2e9bfc888f
26 changed files with 422 additions and 113 deletions

View File

@@ -0,0 +1,31 @@
-- CreateTable
CREATE TABLE "public"."MainLedger" (
"id" SERIAL NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
"reference" VARCHAR(128) NOT NULL,
"amount" DECIMAL(18,6) NOT NULL,
"currency" VARCHAR(16) NOT NULL,
"description" TEXT,
"metadata" JSONB,
CONSTRAINT "MainLedger_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "public"."Registry" (
"id" SERIAL NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
"key" VARCHAR(128) NOT NULL,
"value" JSONB NOT NULL,
"description" TEXT,
CONSTRAINT "Registry_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE INDEX "MainLedger_reference_idx" ON "public"."MainLedger"("reference");
-- CreateIndex
CREATE UNIQUE INDEX "Registry_key_key" ON "public"."Registry"("key");

View 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 = "postgresql"

View File

@@ -3,7 +3,6 @@
generator client {
provider = "prisma-client-js"
output = "../app/generated/prisma"
}
datasource db {
@@ -11,18 +10,26 @@ datasource db {
url = env("DATABASE_URL")
}
model User {
id Int @id @default(autoincrement())
email String @unique
name String?
posts Post[]
/// The Main Ledger stores immutable financial or event entries.
model MainLedger {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
reference String @db.VarChar(128)
amount Decimal @db.Decimal(18, 6)
currency String @db.VarChar(16)
description String?
metadata Json?
@@index([reference])
}
model Post {
id Int @id @default(autoincrement())
title String
content String?
published Boolean @default(false)
author User @relation(fields: [authorId], references: [id])
authorId Int
/// The Registry holds key→value configuration and descriptors.
model Registry {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
key String @unique @db.VarChar(128)
value Json
description String?
}