source-code/
portofolio-backend
Public
codeCodeinfoIssues 0call_splitPull Requestsplay_circleActions
portofolio-backend/prisma/schema.prisma
text74 lines1.9 KB
// 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  = "postgresql"
  url       = env("DATABASE_URL")
  directUrl = env("DIRECT_URL")
}

model User {
  id       Int    @id @default(autoincrement())
  email    String @unique
  password String
}

model SiteConfig {
  id        Int      @id @default(autoincrement())
  key       String   @unique
  value     String // Stores JSON stringified data
  createdAt DateTime @default(now())
  updatedAt DateTime @updatedAt
}

enum ProjectSource {
  GITHUB
  CMS
}

model Project {
  id            Int           @id @default(autoincrement())
  title         String
  brief         String        // one-liner description
  description   String        // 2-3 paragraf
  tags          String[]      // array of strings
  coverImage    String?       // URL gambar
  order         Int           @default(0)
  featured      Boolean       @default(false)
  hasSourceCode Boolean       @default(false)
  liveUrl       String?       // optional live demo URL
  source        ProjectSource @default(CMS)
  githubRepo    String?       // repo name kalau source = GITHUB
  hidden        Boolean       @default(false)
  createdAt     DateTime      @default(now())
  updatedAt     DateTime      @updatedAt
}

model Experience {
  id          Int               @id @default(autoincrement())
  role        String
  company     String
  period      String
  description String
  order       Int               @default(0)
  skills      ExperienceSkill[]
}

model ExperienceSkill {
  id           Int        @id @default(autoincrement())
  name         String
  experienceId Int
  experience   Experience @relation(fields: [experienceId], references: [id], onDelete: Cascade)
}

model Skill {
  id     Int    @id @default(autoincrement())
  name   String
  color  String
  text   String
}

About

Fullstack portfolio backend built with NestJS, Prisma, and PostgreSQL. Features JWT authentication, throttler rate limits, cache management, and automated GitHub repository synchronization.

TypeScriptNestJSPostgreSQLPrisma

Contributors

1