Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/fabogit/fastify-prisma-zod-swagger

Fastify REST API, Prisma orm to manage db schema & migrations
https://github.com/fabogit/fastify-prisma-zod-swagger

docker-compose fastify postgresql prisma swagger typescript zod

Last synced: about 1 month ago
JSON representation

Fastify REST API, Prisma orm to manage db schema & migrations

Awesome Lists containing this project

README

        

# fastify-prisma-zod-swagger

if there is no `package.json` file:

- `npm init -y`

- `npm i typescript`

- `npx tsc --init `

- `npm i prisma @prisma/client fastify fastify-zod zod zod-to-json-schema fastify-jwt fastify-swagger `

- `npm i -D ts-node-dev typescript @types/node`

- `npm run dev`

### Initialise prisma

`npx prisma init --datasource-provider postgresql`

### Turn your database schema into a Prisma schema

`npx prisma db pull`

### Generate prisma client

`npx prisma generate`

### Migrate the schema

`npx prisma migrate dev --name init`