├── .eslintrc.json ├── bun.lockb ├── app ├── favicon.ico ├── opengraph-image.png ├── api │ ├── auth │ │ └── [...nextauth] │ │ │ └── route.ts │ └── feedback │ │ └── route.ts ├── sitemap.ts ├── dashboard │ ├── steps │ │ └── page.tsx │ ├── layout.tsx │ ├── pricing │ │ └── page.tsx │ ├── page.tsx │ └── feedbacks │ │ └── [id] │ │ └── page.tsx ├── robots.ts ├── actions │ ├── deleteFeedback.ts │ ├── deleteProject.ts │ └── createProject.ts ├── global-error.tsx ├── not-found.tsx ├── globals.css ├── layout.tsx ├── privacy │ └── page.tsx ├── page.tsx └── about │ └── page.tsx ├── public ├── Logo.png ├── peerlist.png ├── process1.png ├── process2.png └── process3.png ├── env.example ├── prisma ├── migrations │ ├── migration_lock.toml │ ├── 20240807181025_refatored │ │ └── migration.sql │ ├── 20240807180653_added_foreign_key_in_feedback_model │ │ └── migration.sql │ ├── 20240806174843_added_project_schema │ │ └── migration.sql │ ├── 20240809085715_adding │ │ └── migration.sql │ ├── 20240807043409_added_schema_for_the_feedbacks_and_updated_at_constraints │ │ └── migration.sql │ ├── 20240807103708_fixed_the_feedback_schema │ │ └── migration.sql │ ├── 20240807105030_refactored_whole_schema │ │ └── migration.sql │ ├── 20240806032711_initial_migration_for_authentication │ │ └── migration.sql │ ├── 20240806042013_corrected_auth_table │ │ └── migration.sql │ └── 20240807181559_refactored │ │ └── migration.sql └── schema.prisma ├── postcss.config.mjs ├── lib ├── utils.ts ├── db.ts └── auth.ts ├── components ├── theme-provider.tsx ├── GetStartedButton.tsx ├── Announcement.tsx ├── ui │ ├── label.tsx │ ├── textarea.tsx │ ├── input.tsx │ ├── separator.tsx │ ├── progress.tsx │ ├── sonner.tsx │ ├── tooltip.tsx │ ├── avatar.tsx │ ├── rainbow-button.tsx │ ├── button.tsx │ ├── tabs.tsx │ ├── card.tsx │ ├── accordion.tsx │ ├── table.tsx │ ├── dialog.tsx │ ├── sheet.tsx │ ├── hero-video-dialog.tsx │ ├── select.tsx │ └── dropdown-menu.tsx ├── CopyToClipboard.tsx ├── HomeForm.tsx ├── HomeAvatars.tsx ├── DashboardCards.tsx ├── magicui │ ├── blur-fade.tsx │ ├── border-beam.tsx │ └── particles.tsx ├── ProjectDeleteButton.tsx ├── TechStack.tsx ├── steps-page.tsx ├── Accordian.tsx ├── FeaturesSection.tsx ├── CreateProject.tsx ├── feedback-view.tsx ├── Navbar.tsx ├── Footer.tsx ├── Pricing.tsx ├── HowToUse.tsx ├── AuthButtons.tsx ├── Sidebar.tsx └── feedback-table.tsx ├── components.json ├── .gitignore ├── tsconfig.json ├── next.config.mjs ├── package.json ├── README.md └── tailwind.config.ts /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "next/core-web-vitals" 3 | } 4 | -------------------------------------------------------------------------------- /bun.lockb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/avayyyyyyy/Opinify/HEAD/bun.lockb -------------------------------------------------------------------------------- /app/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/avayyyyyyy/Opinify/HEAD/app/favicon.ico -------------------------------------------------------------------------------- /public/Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/avayyyyyyy/Opinify/HEAD/public/Logo.png -------------------------------------------------------------------------------- /public/peerlist.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/avayyyyyyy/Opinify/HEAD/public/peerlist.png -------------------------------------------------------------------------------- /public/process1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/avayyyyyyy/Opinify/HEAD/public/process1.png -------------------------------------------------------------------------------- /public/process2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/avayyyyyyy/Opinify/HEAD/public/process2.png -------------------------------------------------------------------------------- /public/process3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/avayyyyyyy/Opinify/HEAD/public/process3.png -------------------------------------------------------------------------------- /app/opengraph-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/avayyyyyyy/Opinify/HEAD/app/opengraph-image.png -------------------------------------------------------------------------------- /env.example: -------------------------------------------------------------------------------- 1 | NEXTAUTH_SECRET= 2 | DATABASE_URL= 3 | GOOGLE_CLIENT_ID= 4 | GOOGLE_CLIENT_SECRET= 5 | AUTH_TRUST_HOST= -------------------------------------------------------------------------------- /app/api/auth/[...nextauth]/route.ts: -------------------------------------------------------------------------------- 1 | import { handlers } from "@/lib/auth"; 2 | export const { GET, POST } = handlers; 3 | -------------------------------------------------------------------------------- /prisma/migrations/migration_lock.toml: -------------------------------------------------------------------------------- 1 | # Please do not edit this file manually 2 | # It should be added in your version-control system (i.e. Git) 3 | provider = "postgresql" -------------------------------------------------------------------------------- /postcss.config.mjs: -------------------------------------------------------------------------------- 1 | /** @type {import('postcss-load-config').Config} */ 2 | const config = { 3 | plugins: { 4 | tailwindcss: {}, 5 | }, 6 | }; 7 | 8 | export default config; 9 | -------------------------------------------------------------------------------- /lib/utils.ts: -------------------------------------------------------------------------------- 1 | import { type ClassValue, clsx } from "clsx" 2 | import { twMerge } from "tailwind-merge" 3 | 4 | export function cn(...inputs: ClassValue[]) { 5 | return twMerge(clsx(inputs)) 6 | } 7 | -------------------------------------------------------------------------------- /app/sitemap.ts: -------------------------------------------------------------------------------- 1 | import { MetadataRoute } from "next"; 2 | 3 | export default async function sitemap(): Promise { 4 | return [ 5 | { 6 | url: `${process.env.AUTH_TRUST_HOST}`, 7 | lastModified: new Date(), 8 | }, 9 | ]; 10 | } 11 | -------------------------------------------------------------------------------- /prisma/migrations/20240807181025_refatored/migration.sql: -------------------------------------------------------------------------------- 1 | -- DropForeignKey 2 | ALTER TABLE "feedbacks" DROP CONSTRAINT "feedbacks_projectId_fkey"; 3 | 4 | -- AddForeignKey 5 | ALTER TABLE "feedbacks" ADD CONSTRAINT "feedbacks_projectId_fkey" FOREIGN KEY ("projectId") REFERENCES "projects"("id") ON DELETE RESTRICT ON UPDATE CASCADE; 6 | -------------------------------------------------------------------------------- /prisma/migrations/20240807180653_added_foreign_key_in_feedback_model/migration.sql: -------------------------------------------------------------------------------- 1 | -- DropForeignKey 2 | ALTER TABLE "feedbacks" DROP CONSTRAINT "feedbacks_projectId_fkey"; 3 | 4 | -- AddForeignKey 5 | ALTER TABLE "feedbacks" ADD CONSTRAINT "feedbacks_projectId_fkey" FOREIGN KEY ("projectId") REFERENCES "projects"("id") ON DELETE CASCADE ON UPDATE CASCADE; 6 | -------------------------------------------------------------------------------- /components/theme-provider.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import * as React from "react"; 4 | import { ThemeProvider as NextThemesProvider } from "next-themes"; 5 | import { type ThemeProviderProps } from "next-themes/dist/types"; 6 | 7 | export function ThemeProvider({ children, ...props }: ThemeProviderProps) { 8 | return {children}; 9 | } 10 | -------------------------------------------------------------------------------- /app/dashboard/steps/page.tsx: -------------------------------------------------------------------------------- 1 | import { StepsPage } from "@/components/steps-page"; 2 | import { Metadata } from "next"; 3 | import React from "react"; 4 | 5 | export const metadata: Metadata = { 6 | title: "Steps", 7 | }; 8 | 9 | const page = () => { 10 | return ( 11 |
12 | 13 |
14 | ); 15 | }; 16 | 17 | export default page; 18 | -------------------------------------------------------------------------------- /app/robots.ts: -------------------------------------------------------------------------------- 1 | import { MetadataRoute } from "next"; 2 | 3 | export default function robots(): MetadataRoute.Robots { 4 | return { 5 | rules: [ 6 | { 7 | userAgent: "*", 8 | allow: ["/", "/about", "/privacy"], 9 | disallow: ["/dashboard", "/dashboard/feedbacks"], 10 | }, 11 | ], 12 | sitemap: `${process.env.AUTH_TRUST_HOST}sitemap.xml`, 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /components.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://ui.shadcn.com/schema.json", 3 | "style": "new-york", 4 | "rsc": true, 5 | "tsx": true, 6 | "tailwind": { 7 | "config": "tailwind.config.ts", 8 | "css": "app/globals.css", 9 | "baseColor": "zinc", 10 | "cssVariables": true, 11 | "prefix": "" 12 | }, 13 | "aliases": { 14 | "components": "@/components", 15 | "utils": "@/lib/utils" 16 | } 17 | } -------------------------------------------------------------------------------- /lib/db.ts: -------------------------------------------------------------------------------- 1 | import { PrismaClient } from "@prisma/client"; 2 | 3 | const prismaClientSingleton = () => { 4 | return new PrismaClient(); 5 | }; 6 | 7 | declare const globalThis: { 8 | prismaGlobal: ReturnType; 9 | } & typeof global; 10 | 11 | const prisma = globalThis.prismaGlobal ?? prismaClientSingleton(); 12 | 13 | export default prisma; 14 | 15 | if (process.env.NODE_ENV !== "production") globalThis.prismaGlobal = prisma; 16 | -------------------------------------------------------------------------------- /app/actions/deleteFeedback.ts: -------------------------------------------------------------------------------- 1 | "use server"; 2 | 3 | import prisma from "@/lib/db"; 4 | 5 | export const deleteFeedback = async (id: string) => { 6 | try { 7 | // console.log("id: ", id); 8 | const deleteFeedback = await prisma.feedback.delete({ 9 | where: { 10 | id: id, 11 | }, 12 | }); 13 | 14 | // console.log("deleteFeedback: ", deleteFeedback); 15 | 16 | return { success: true }; 17 | } catch (error) { 18 | return { success: false }; 19 | } 20 | }; 21 | -------------------------------------------------------------------------------- /prisma/migrations/20240806174843_added_project_schema/migration.sql: -------------------------------------------------------------------------------- 1 | -- CreateTable 2 | CREATE TABLE "Project" ( 3 | "id" TEXT NOT NULL, 4 | "name" TEXT NOT NULL, 5 | "url" TEXT NOT NULL, 6 | "description" TEXT NOT NULL, 7 | "userId" TEXT NOT NULL, 8 | 9 | CONSTRAINT "Project_pkey" PRIMARY KEY ("id") 10 | ); 11 | 12 | -- AddForeignKey 13 | ALTER TABLE "Project" ADD CONSTRAINT "Project_userId_fkey" FOREIGN KEY ("userId") REFERENCES "users"("id") ON DELETE RESTRICT ON UPDATE CASCADE; 14 | -------------------------------------------------------------------------------- /components/GetStartedButton.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | import React from "react"; 3 | import { Button } from "./ui/button"; 4 | import { MoveRight } from "lucide-react"; 5 | import { signIn } from "next-auth/react"; 6 | 7 | const GetStartedButton = () => { 8 | return ( 9 |
10 | 13 |
14 | ); 15 | }; 16 | 17 | export default GetStartedButton; 18 | -------------------------------------------------------------------------------- /app/dashboard/layout.tsx: -------------------------------------------------------------------------------- 1 | import Sidebar from "@/components/Sidebar"; 2 | import { auth } from "@/lib/auth"; 3 | import { redirect } from "next/navigation"; 4 | import React from "react"; 5 | 6 | const layout = async ({ children }: { children: React.ReactNode }) => { 7 | const user = await auth(); 8 | 9 | if (!user?.user?.email) { 10 | return redirect("/"); 11 | } 12 | 13 | return ( 14 |
15 | 16 | {children} 17 |
18 | ); 19 | }; 20 | 21 | export default layout; 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | .yarn/install-state.gz 8 | 9 | # testing 10 | /coverage 11 | 12 | # next.js 13 | /.next/ 14 | /out/ 15 | 16 | # production 17 | /build 18 | 19 | # misc 20 | .DS_Store 21 | *.pem 22 | 23 | # debug 24 | npm-debug.log* 25 | yarn-debug.log* 26 | yarn-error.log* 27 | 28 | # local env files 29 | .env*.local 30 | .env 31 | 32 | # vercel 33 | .vercel 34 | 35 | # typescript 36 | *.tsbuildinfo 37 | next-env.d.ts 38 | .env 39 | -------------------------------------------------------------------------------- /app/dashboard/pricing/page.tsx: -------------------------------------------------------------------------------- 1 | import PricingPage from "@/components/Pricing"; 2 | import { auth } from "@/lib/auth"; 3 | import { Metadata } from "next"; 4 | import { redirect } from "next/navigation"; 5 | import React from "react"; 6 | 7 | export const metadata: Metadata = { 8 | title: "Pricing", 9 | }; 10 | 11 | const page = async () => { 12 | const user = await auth(); 13 | 14 | if (!user) { 15 | return redirect("/"); 16 | } 17 | 18 | return ( 19 |
20 | 21 |
22 | ); 23 | }; 24 | 25 | export default page; 26 | -------------------------------------------------------------------------------- /prisma/migrations/20240809085715_adding/migration.sql: -------------------------------------------------------------------------------- 1 | -- DropForeignKey 2 | ALTER TABLE "feedbacks" DROP CONSTRAINT "feedbacks_projectId_fkey"; 3 | 4 | -- DropForeignKey 5 | ALTER TABLE "projects" DROP CONSTRAINT "projects_userId_fkey"; 6 | 7 | -- AddForeignKey 8 | ALTER TABLE "projects" ADD CONSTRAINT "projects_userId_fkey" FOREIGN KEY ("userId") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE; 9 | 10 | -- AddForeignKey 11 | ALTER TABLE "feedbacks" ADD CONSTRAINT "feedbacks_projectId_fkey" FOREIGN KEY ("projectId") REFERENCES "projects"("id") ON DELETE CASCADE ON UPDATE CASCADE; 12 | -------------------------------------------------------------------------------- /components/Announcement.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | const Announcement = () => { 4 | return ( 5 | <> 6 |
7 |
8 | {/* Update: */} 9 |
10 | Congratulations, everyone! We’ve added over 10 new themes to 11 | customize your feedback form. 🎉 12 |
13 |
14 |
15 | 16 | ); 17 | }; 18 | 19 | export default Announcement; 20 | -------------------------------------------------------------------------------- /lib/auth.ts: -------------------------------------------------------------------------------- 1 | import NextAuth from "next-auth"; 2 | import { PrismaAdapter } from "@auth/prisma-adapter"; 3 | import Google from "next-auth/providers/google"; 4 | import prisma from "./db"; 5 | 6 | export const { handlers, auth, signIn, signOut } = NextAuth({ 7 | adapter: PrismaAdapter(prisma), 8 | providers: [ 9 | Google({ 10 | clientId: process.env.GOOGLE_CLIENT_ID, 11 | clientSecret: process.env.GOOGLE_CLIENT_SECRET, 12 | }), 13 | ], 14 | pages: { 15 | error: "/", 16 | signIn: "/", 17 | signOut: "/", 18 | }, 19 | session: { 20 | strategy: "jwt", 21 | }, 22 | trustHost: true, 23 | secret: process.env.NEXTAUTH_SECRET!, 24 | }); 25 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "lib": ["dom", "dom.iterable", "esnext"], 4 | "allowJs": true, 5 | "skipLibCheck": true, 6 | "strict": true, 7 | "noEmit": true, 8 | "esModuleInterop": true, 9 | "module": "esnext", 10 | "moduleResolution": "bundler", 11 | "resolveJsonModule": true, 12 | "isolatedModules": true, 13 | "jsx": "preserve", 14 | "incremental": true, 15 | "plugins": [ 16 | { 17 | "name": "next" 18 | } 19 | ], 20 | "paths": { 21 | "@/*": ["./*"] 22 | } 23 | }, 24 | "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], 25 | "exclude": ["node_modules"] 26 | } 27 | -------------------------------------------------------------------------------- /components/ui/label.tsx: -------------------------------------------------------------------------------- 1 | "use client" 2 | 3 | import * as React from "react" 4 | import * as LabelPrimitive from "@radix-ui/react-label" 5 | import { cva, type VariantProps } from "class-variance-authority" 6 | 7 | import { cn } from "@/lib/utils" 8 | 9 | const labelVariants = cva( 10 | "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70" 11 | ) 12 | 13 | const Label = React.forwardRef< 14 | React.ElementRef, 15 | React.ComponentPropsWithoutRef & 16 | VariantProps 17 | >(({ className, ...props }, ref) => ( 18 | 23 | )) 24 | Label.displayName = LabelPrimitive.Root.displayName 25 | 26 | export { Label } 27 | -------------------------------------------------------------------------------- /components/ui/textarea.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react" 2 | 3 | import { cn } from "@/lib/utils" 4 | 5 | export interface TextareaProps 6 | extends React.TextareaHTMLAttributes {} 7 | 8 | const Textarea = React.forwardRef( 9 | ({ className, ...props }, ref) => { 10 | return ( 11 |