├── .eslintrc.json ├── public ├── 12.jpg ├── laptop.jpg ├── rayi-christian-wicaksono-6PF6DaiWz48-unsplash.jpg ├── vercel.svg └── next.svg ├── src ├── app │ ├── favicon.ico │ ├── (pages) │ │ ├── [userId] │ │ │ ├── [postId] │ │ │ │ ├── layout.tsx │ │ │ │ ├── error.tsx │ │ │ │ ├── edit │ │ │ │ │ └── page.tsx │ │ │ │ └── page.tsx │ │ │ └── page.tsx │ │ ├── setting │ │ │ ├── [settingParams] │ │ │ │ └── page.tsx │ │ │ ├── layout.tsx │ │ │ └── page.tsx │ │ ├── new │ │ │ ├── page.tsx │ │ │ └── layout.tsx │ │ ├── layout.tsx │ │ ├── dashboard │ │ │ ├── layout.tsx │ │ │ ├── page.tsx │ │ │ └── [filter] │ │ │ │ └── page.tsx │ │ ├── search │ │ │ ├── layout.tsx │ │ │ └── page.tsx │ │ ├── tags │ │ │ └── page.tsx │ │ └── page.tsx │ ├── global-error.tsx │ ├── api │ │ ├── tags │ │ │ ├── route.ts │ │ │ └── addTagInPost │ │ │ │ └── route.ts │ │ ├── auth │ │ │ ├── logout │ │ │ │ └── route.ts │ │ │ ├── login │ │ │ │ └── route.ts │ │ │ └── signup │ │ │ │ └── route.ts │ │ ├── users │ │ │ ├── [username] │ │ │ │ └── route.ts │ │ │ ├── follow │ │ │ │ └── route.ts │ │ │ └── me │ │ │ │ └── route.ts │ │ ├── dashboard │ │ │ ├── [filter] │ │ │ │ └── route.ts │ │ │ └── route.ts │ │ ├── comment │ │ │ ├── reply │ │ │ │ └── route.ts │ │ │ └── route.ts │ │ ├── posts │ │ │ ├── saved │ │ │ │ └── route.ts │ │ │ ├── route.ts │ │ │ └── [postId] │ │ │ │ └── route.ts │ │ └── search │ │ │ └── route.ts │ ├── layout.tsx │ ├── not-found.tsx │ ├── globals.css │ └── (auth) │ │ ├── signin │ │ └── page.tsx │ │ └── signup │ │ └── page.tsx ├── utils │ ├── getPublicIdCloudinary.ts │ ├── constants.ts │ ├── uploadImageToCloudinary.ts │ ├── deleteFileFromCloudinary.ts │ ├── convertImageTobase64.ts │ ├── getDataFromToken.ts │ └── utils.ts ├── components │ ├── Loading.tsx │ ├── search │ │ ├── SearchNotMatch.tsx │ │ ├── SearchPostLoop.tsx │ │ └── SearchInput.tsx │ ├── Icon.tsx │ ├── Analytics.tsx │ ├── GetCurrentUser.tsx │ ├── Providers.tsx │ ├── comments │ │ ├── CommentCard.tsx │ │ ├── AddReply.tsx │ │ ├── CommentOption.tsx │ │ ├── AddComment.tsx │ │ └── Comments.tsx │ ├── Footer.tsx │ ├── AuthModal.tsx │ ├── dashboard │ │ ├── Count.tsx │ │ ├── Filter.tsx │ │ └── Posts.tsx │ ├── posts │ │ ├── DeletePostModal.tsx │ │ ├── PostArticle.tsx │ │ ├── UserProfileCard.tsx │ │ └── PostCard.tsx │ ├── navbar │ │ ├── SideNav.tsx │ │ ├── Navbar.tsx │ │ └── NavbarProfile.tsx │ ├── RightAside.tsx │ └── profile │ │ └── ProfileDetails.tsx ├── lib │ ├── config │ │ ├── cloudinary.ts │ │ └── site.ts │ ├── validation │ │ ├── signInSchema.ts │ │ ├── editProfileSchema.ts │ │ └── signUpSchema.ts │ ├── db.ts │ └── types.ts ├── hooks │ ├── reduxHooks.ts │ └── useQueryString.tsx ├── redux │ ├── userSlice.ts │ ├── commonSlice.ts │ ├── editorSlice.ts │ ├── store.ts │ ├── authSlice.ts │ └── dashboardSlice.ts └── middleware.ts ├── postcss.config.js ├── next.config.js ├── editorjs.d.ts ├── .gitignore ├── tailwind.config.ts ├── tsconfig.json ├── LICENSE ├── package.json ├── prisma └── schema.prisma └── README.md /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "next/core-web-vitals" 3 | } 4 | -------------------------------------------------------------------------------- /public/12.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tehseen01/nextjs-blog/HEAD/public/12.jpg -------------------------------------------------------------------------------- /public/laptop.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tehseen01/nextjs-blog/HEAD/public/laptop.jpg -------------------------------------------------------------------------------- /src/app/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tehseen01/nextjs-blog/HEAD/src/app/favicon.ico -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /public/rayi-christian-wicaksono-6PF6DaiWz48-unsplash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tehseen01/nextjs-blog/HEAD/public/rayi-christian-wicaksono-6PF6DaiWz48-unsplash.jpg -------------------------------------------------------------------------------- /src/app/(pages)/[userId]/[postId]/layout.tsx: -------------------------------------------------------------------------------- 1 | const PostLayout = ({ children }: { children: React.ReactNode }) => { 2 | return <>{children}>; 3 | }; 4 | 5 | export default PostLayout; 6 | -------------------------------------------------------------------------------- /src/utils/getPublicIdCloudinary.ts: -------------------------------------------------------------------------------- 1 | export const getPublicIdCloudinary = (imageURL: string) => { 2 | const publicID = imageURL.split("/").pop()?.split(".")[0]; 3 | return publicID; 4 | }; 5 | -------------------------------------------------------------------------------- /src/components/Loading.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | const Loading = () => { 4 | return ( 5 |
31 | The page you are looking for doesn't exist or
32 | has been removed.
33 |
32 | We're a place where coders share, stay up-to-date and 33 | grow their careers. 34 |
35 |Total post reactions
21 |Total post views
31 |Total credits
35 |Total post comments
41 |
47 | Oops something went wrong. Try to{" "}
48 | {" "}
54 | this page or
feel free to contact us if the problem presists.
55 |
80 | You cannot undo this action, perhaps you just want to edit 81 | instead? 82 |
83 |55 | Don't have an account?{" "} 56 | 57 | Create an account 58 | 59 |
60 |115 | 118 |
119 | ))} 120 | > 121 | ); 122 | }; 123 | -------------------------------------------------------------------------------- /src/app/(auth)/signup/page.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import NextLink from "next/link"; 4 | import { useRouter } from "next/navigation"; 5 | 6 | import { Input, Button, Link } from "@nextui-org/react"; 7 | 8 | import { useForm, SubmitHandler } from "react-hook-form"; 9 | import { zodResolver } from "@hookform/resolvers/zod"; 10 | 11 | import { signUpSchema, signUpSchemaType } from "@/lib/validation/signUpSchema"; 12 | 13 | import axios from "axios"; 14 | import toast from "react-hot-toast"; 15 | 16 | const Page = () => { 17 | const router = useRouter(); 18 | 19 | const { 20 | register, 21 | reset, 22 | handleSubmit, 23 | formState: { errors, isSubmitting }, 24 | } = useForm51 | Already have an account?{" "} 52 | 53 | Sign in 54 | 55 |
56 |{post.author.bio}
94 | 99 | {post.author.site} 100 | 101 |105 | {post.author.followingIDs.length} 106 |
107 |Following
108 |111 | {post.author.followerIDs.length} 112 |
113 |Followers
114 |@{user.username}
91 |{user.bio}
92 |95 | {user.followingIDs.length} 96 |
97 |Following
98 |101 | {user.followerIDs.length} 102 |
103 |Followers
104 |{tag.description}
129 |117 | We're a place where coders share, stay up-to-date and 118 | grow their careers. 119 |
120 |{tag.description}
141 |{user?.name}
97 |@{user?.username}
98 | 99 |92 | Published: 93 | 94 | {moment(post.createdAt, moment.ISO_8601).format("MMM DD")} 95 | 96 |
97 |
59 | Top Comments: {post._count.comments} 60 |
61 |