diff --git a/.env.example b/.env.example
index cb88c95..c59d788 100644
--- a/.env.example
+++ b/.env.example
@@ -1 +1,2 @@
-DATABASE_URL=local.db
\ No newline at end of file
+DATABASE_URL=local.db
+JWT_SECRET=yoursecret
\ No newline at end of file
diff --git a/README.md b/README.md
index c514f4f..d331ece 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
PHp*
-[Prisma](https://www.prisma.io/) + [Hono](https://hono.dev/) + [pnpm](https://pnpm.io/)
+[Prisma](https://www.prisma.io/) + [Hono](https://hono.dev/) + [pnpm](https://pnpm.io/)
[](https://github.com/bedtime-coders/phpstack/blob/main/LICENSE)
[](https://www.prisma.io/)
@@ -13,9 +13,9 @@
-## PHp*: Prisma + Hono + pnpm
+## PHp\*: Prisma + Hono + pnpm
-**PHp*** is a collection of bleeding-edge technologies to build modern web applications.
+**PHp\*** is a collection of bleeding-edge technologies to build modern web applications.
Including:
@@ -37,19 +37,27 @@ Including:
cp .env.example .env
```
-3. Push the database schema to the database
+3. Start the database
+
+ ```bash
+ pnpm db:dev
+ ```
+
+4. Update the .env file with your database URL given by the previous step, and your own JWT secret
+
+5. Push the database schema to the database
```bash
pnpm db:push
```
-4. Start the server
+6. Start the server
```bash
pnpm dev
```
-5. (Optional) Start the [database studio](https://www.prisma.io/studio)
+7. (Optional) Start the [database studio](https://www.prisma.io/studio)
```bash
pnpm db:studio
```
@@ -80,4 +88,4 @@ See [CONTRIBUTING.md](./CONTRIBUTING.md) for more information, including how to
---
-*no relation to [PHP](https://www.php.net), the scripting language
+\*no relation to [PHP](https://www.php.net), the scripting language
diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml
index 6302fcd..cab241c 100644
--- a/pnpm-workspace.yaml
+++ b/pnpm-workspace.yaml
@@ -1,3 +1,7 @@
onlyBuiltDependencies:
- - '@prisma/engines'
+ - "@prisma/engines"
- prisma
+
+packages:
+ - "php"
+ - "php/src"
diff --git a/src/articles/articles.schema.ts b/src/articles/articles.schema.ts
new file mode 100644
index 0000000..4f4de7b
--- /dev/null
+++ b/src/articles/articles.schema.ts
@@ -0,0 +1,31 @@
+import { z } from "@hono/zod-openapi";
+
+export const CreateArticle = z.object({
+ article: z.object({
+ title: z.string(),
+ description: z.string(),
+ body: z.string(),
+ tagList: z.array(z.string()).optional(),
+ }),
+});
+
+export const UpdateArticle = z.object({
+ article: z.object({
+ title: z.string().optional(),
+ description: z.string().optional(),
+ body: z.string().optional(),
+ }),
+});
+
+export const FavoriteArticle = z.object({
+ slug: z.string(),
+});
+
+export const UnfavoriteArticle = z.object({
+ slug: z.string(),
+});
+
+export type CreateArticle = z.infer;
+export type UpdateArticle = z.infer;
+export type FavoriteArticle = z.infer;
+export type UnfavoriteArticle = z.infer;