Home / File/ note.server.ts — ui Source File

note.server.ts — ui Source File

Architecture documentation for note.server.ts, a typescript file in the ui codebase. 2 imports, 0 dependents.

Entity Profile

Dependency Diagram

graph LR
  62fec141_1f2c_3dbb_0c78_55df1f858117["note.server.ts"]
  0e9e6e0c_89c3_710e_bf21_50ad9d751025["client"]
  62fec141_1f2c_3dbb_0c78_55df1f858117 --> 0e9e6e0c_89c3_710e_bf21_50ad9d751025
  7b14a427_4501_6a47_9ad1_843ac38610ff["db.server"]
  62fec141_1f2c_3dbb_0c78_55df1f858117 --> 7b14a427_4501_6a47_9ad1_843ac38610ff
  style 62fec141_1f2c_3dbb_0c78_55df1f858117 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import type { User, Note } from "@prisma/client";

import { prisma } from "~/db.server";

export function getNote({
  id,
  userId,
}: Pick<Note, "id"> & {
  userId: User["id"];
}) {
  return prisma.note.findFirst({
    select: { id: true, body: true, title: true },
    where: { id, userId },
  });
}

export function getNoteListItems({ userId }: { userId: User["id"] }) {
  return prisma.note.findMany({
    where: { userId },
    select: { id: true, title: true },
    orderBy: { updatedAt: "desc" },
  });
}

export function createNote({
  body,
  title,
  userId,
}: Pick<Note, "body" | "title"> & {
  userId: User["id"];
}) {
  return prisma.note.create({
    data: {
      title,
      body,
      user: {
        connect: {
          id: userId,
        },
      },
    },
  });
}

export function deleteNote({
  id,
  userId,
}: Pick<Note, "id"> & { userId: User["id"] }) {
  return prisma.note.deleteMany({
    where: { id, userId },
  });
}

Subdomains

Dependencies

  • client
  • db.server

Frequently Asked Questions

What does note.server.ts do?
note.server.ts is a source file in the ui codebase, written in typescript. It belongs to the FrameworkTooling domain, SchemaValidation subdomain.
What functions are defined in note.server.ts?
note.server.ts defines 4 function(s): createNote, deleteNote, getNote, getNoteListItems.
What does note.server.ts depend on?
note.server.ts imports 2 module(s): client, db.server.
Where is note.server.ts in the architecture?
note.server.ts is located at packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/models/note.server.ts (domain: FrameworkTooling, subdomain: SchemaValidation, directory: packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/models).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free