Skip to content

Instantly share code, notes, and snippets.

@duiliogp
Last active December 20, 2022 17:09
Show Gist options
  • Save duiliogp/49db5673d2616756f6f2fa816214816c to your computer and use it in GitHub Desktop.
Save duiliogp/49db5673d2616756f6f2fa816214816c to your computer and use it in GitHub Desktop.

CLI

React

New project

npm create vite
npx create-expo-app -t
npx react-native init MyApp --template react-native-template-typescript

Utils

npm install react-icons --save
ESLint
npm install eslint

Prisma

Init

npm install prisma typescript ts-node @types/node --save-dev
npx prisma init

.env

DATABASE_URL="mysql://USER:PASSWORD@HOST:PORT/DBNAME"

schema.prisma

model Post {
  id       Int  @id @default(autoincrement())
  title    String  @db.VarChar(255)
  content  String?
  author   User    @relation(fields: [authorId], references: [id])
  authorId Int
}


model User {
  id    Int      @id @default(autoincrement())
  name  String?
  posts Post[]
}

Create Migration

npx prisma migrate dev --name CreateEmployee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment