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)
- Host: GitHub
- URL: https://github.com/pritam1717m/medium
- Owner: pritam1717m
- Created: 2025-02-03T09:52:29.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-03-13T17:40:14.000Z (about 2 months ago)
- Last Synced: 2025-03-13T18:41:34.996Z (about 2 months ago)
- Topics: cloudflare, honojs, postgresql, prisma-orm, typescript
- Language: TypeScript
- Homepage: https://medium-seven-delta.vercel.app
- Size: 385 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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;
```