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

https://github.com/pritam1717m/medium

A full stack blog application using React, Hono, Cloudflare and Prisma(PostgreSQL)
https://github.com/pritam1717m/medium

cloudflare honojs postgresql prisma-orm typescript

Last synced: about 2 months ago
JSON representation

A full stack blog application using React, Hono, Cloudflare and Prisma(PostgreSQL)

Awesome Lists containing this project

README

        

# @rafael1717/common
This package provides Zod validation schemas for authentication and blog-related operations. It ensures that API inputs meet the required structure and types before processing.

# Installation

```js
npm i @rafael1717/common
```
# Validation Schemas
+ Validates user signup details:
```js
const result = signUpBody.safeParse({
name: "John Doe",
email: "[email protected]",
password: "securePassword123",
});
```
+ Validates user login details:
```js
const result = signInBody.safeParse({
email: "[email protected]",
password: "securePassword123",
});
```
+ Validates blog creation input:
```js
const result = createBlogInput.safeParse({
title: "My First Blog",
content: "This is my first blog post."
});
```
+ Validates blog update input:
```js
const result = updateBlogInput.safeParse({
id: "123",
title: "Updated Blog Title",
content: "Updated blog content."
});
```
# TypeScript Support
+ This package provides TypeScript types inferred from Zod schemas:
```ts
type SignUpInput = zod.infer;
type SignInInput = zod.infer;
type CreateBlogInput = zod.infer;
type UpdateBlogInput = zod.infer;
```