From 8c50344a258664ed75f6dffcb5e92df6b3364da9 Mon Sep 17 00:00:00 2001 From: SRIRAM-PURANIK <135975743+SRIRAM-PURANIK@users.noreply.github.com> Date: Wed, 19 Aug 2026 21:06:54 +0530 Subject: [PATCH] Implement blogging application with auth, posts, comments and admin panel --- .gitignore | Bin 480 -> 556 bytes SOLUTION.md | 42 ++ app/[username]/[slug]/CommentSection.tsx | 119 +++++ app/[username]/[slug]/page.tsx | 48 ++ app/[username]/page.tsx | 75 ++++ app/admin/DeletePostButton.tsx | 20 + app/admin/edit/[id]/EditPostForm.tsx | 66 +++ app/admin/edit/[id]/page.tsx | 20 + app/admin/new/page.tsx | 64 +++ app/admin/page.tsx | 59 +++ app/api/auth/login/route.ts | 37 ++ app/api/auth/logout/route.ts | 7 + app/api/auth/signup/route.ts | 70 +++ app/api/comments/[id]/route.ts | 34 ++ app/api/comments/route.ts | 27 ++ app/api/posts/[id]/route.ts | 50 +++ app/api/posts/route.ts | 38 ++ app/login/page.tsx | 73 ++++ app/page.tsx | 128 +++--- app/signup/page.tsx | 90 ++++ lib/auth.ts | 37 ++ lib/prisma.ts | 11 + lib/slug.ts | 8 + package-lock.json | 413 +++++++++++++++++- package.json | 5 + .../20260819124025_init/migration.sql | 41 ++ prisma/migrations/migration_lock.toml | 3 + prisma/schema.prisma | 48 ++ 28 files changed, 1568 insertions(+), 65 deletions(-) create mode 100644 SOLUTION.md create mode 100644 app/[username]/[slug]/CommentSection.tsx create mode 100644 app/[username]/[slug]/page.tsx create mode 100644 app/[username]/page.tsx create mode 100644 app/admin/DeletePostButton.tsx create mode 100644 app/admin/edit/[id]/EditPostForm.tsx create mode 100644 app/admin/edit/[id]/page.tsx create mode 100644 app/admin/new/page.tsx create mode 100644 app/admin/page.tsx create mode 100644 app/api/auth/login/route.ts create mode 100644 app/api/auth/logout/route.ts create mode 100644 app/api/auth/signup/route.ts create mode 100644 app/api/comments/[id]/route.ts create mode 100644 app/api/comments/route.ts create mode 100644 app/api/posts/[id]/route.ts create mode 100644 app/api/posts/route.ts create mode 100644 app/login/page.tsx create mode 100644 app/signup/page.tsx create mode 100644 lib/auth.ts create mode 100644 lib/prisma.ts create mode 100644 lib/slug.ts create mode 100644 prisma/migrations/20260819124025_init/migration.sql create mode 100644 prisma/migrations/migration_lock.toml create mode 100644 prisma/schema.prisma diff --git a/.gitignore b/.gitignore index 5ef6a520780202a1d6addd833d800ccb1ecac0bb..67a2bf4ab5fe3ec3a0dfd2931f904f85154657bf 100644 GIT binary patch literal 556 zcmZWmL2kq#49poRf1uh+ccs9+=l)D}Y{@ zbA7XRfi;^MdD%weQ?#xy`W33hnNmTThY4G%r&M%I1+*K}#`;;-d)f4=S0^1H0|g+D zP?3dQ}%-3y3`pFBd;Oei2JCus4b+pk8 zl|`+L@kuIfh65+~Wb?6)Z=sb2kuO&x{g(>K*Bnc|h8iEx!?wn<XqE*GLN`J1UMcHxwlk2diy_!tutujY Mo#{e1c73P1FW-o(!~g&Q literal 480 zcmZWl%WeZ947~d*sB&pnTDbSzKgb6}EO=R0yae7T`TLqp)2iwP>=_2n_@vH=YGbbb z-Ixty)q!~17wt+iwlTSg-B8G-Q4aG;qg88ZDwT%HE@fx+q}4%dfRplAF?-C8u!G6P z<0TcpiyDlsxxzT~1p01UHWR!&ifY+y^5)sbJy8B>8%DJKm%d`_RD_p-jGe_H7*_ +

Comments ({comments.length})

+ + {currentUserId ? ( +
+