simondbm / dev-docs

Documentation for the technologies I learn and use

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Git Commands

Clone the repo

git clone <repo>

When you want to start a new feature, create a new branch

git branch <new-branch>

Check to see if the new branch was created

git branch

To switch to the new branch

git checkout <branch-name>

Alternatively the git checkout command accepts a -b argument that will create the new branch and immediately switch

git checkout -b <branch-name>

Making a pull request

Commit the branch with a descriptive message

git commit -a -m "Added a cool new feature"

Push to the branch

git push origin <branch-name>

Docker

Install Docker Desktop

docker --version

Bash

Bash Scripting

Change directory, make a new directory - javascript, and list the contents of the current directory

cd /path/
mkdir javascript
ls
  javascript

Delete a directory

rm -r directory-name

Project working directory

pwd

Copy a file to directory

cp main.js javascript 

Powershell

Rename a directory

Rename-Item "directory"

Supply values for the following parameters: NewName:

new-directory

Prisma

Install the dependancies

npm i --save-dev prisma typescript ts-node @types/node nodemon

Create tsconfig.json

{
  "compilerOptions": {
    "sourceMap": true,
    "outDir": "dist",
    "strict": true,
    "lib":["esnext"],
    "esModuleInterop": true,
  }
}
start a new prisma project with postgresql
 npx prisma init --datasource-provider postgresql

Initialize the prisma client will create the following

prisma/schema.prisma .env .gitignore

Update the schema.prisma file to include models and run the command. The command will create prisma/migrations/timesatmp/migrations.sql

npx prisma migrate dev --name init

Install the Prisma Client

npm i @prisma/client

To manually generate the client run

npx prisma generate

Prisma commands

npx prisma format

To log all of your prisma queries

const prisma = new PrismaClient({ log: ["query"] });

Vercel

To link environment variables

vercel link
vercel env pull env.local

About

Documentation for the technologies I learn and use