A modern, reusable full-stack feedback widget built with Next.js, React, Tailwind CSS, and Prisma (MongoDB). Easily embed this widget into any project to collect user feedback — view and manage submissions across platforms via a connected CRM or shared feedback table.
- Live Widget: https://widget-feedback-next.vercel.app/
- Integrated Example: https://marketing-arnob.netlify.app/
- Integration Repo: Marketing--TailwindCSS-Fundamental-Project-2
- Project Summary
- Features
- Screenshots
- Live Demo & Integration
- Project Structure
- Technology Stack
- Prerequisites
- Installation
- Environment Variables
- Database Setup
- Usage Instructions
- Widget Integration
- Development & Customization
- ESLint & Tailwind CSS Configuration
- React Testing
- Keywords & Topics
- Learn More
- About
- Conclusion
Feedback Widget Next is a reusable, embeddable feedback widget for modern web projects. Users can submit feedback (name, email, message, rating), which is stored in a MongoDB database via Prisma. The widget is designed for easy integration, customization, and educational purposes.
- Reusable Widget Component: Easily add, customize, and extend widgets.
- API Route Example: Feedback API route for backend integration.
- Prisma ORM: Type-safe database access and schema management (MongoDB or PostgreSQL).
- Tailwind CSS: Utility-first, responsive styling.
- UI Component Library: Modular, reusable UI components (Button, Card, Input, etc.).
- TypeScript & JavaScript: Mixed usage for flexibility and gradual migration.
- Ready for Testing: Easily add React tests (see below for test instructions).
- Widget Embedding: Can be built and embedded in other projects as a UMD bundle.
- Vercel Deployment: Fast, global delivery with serverless functions.
- Next.js (App Router)
- React (Functional Components)
- Tailwind CSS (Styling)
- Prisma (ORM for MongoDB or PostgreSQL)
- TypeScript & JavaScript
- PostCSS
- ESLint
feedback-widget-next/
├── components.json
├── eslint.config.mjs
├── next-env.d.ts
├── next.config.ts
├── package.json
├── postcss.config.js
├── tailwind.config.js
├── tsconfig.json
├── prisma/
│ └── schema.prisma
├── public/
│ └── *.svg, widget.umd.js, ...
├── src/
│ ├── app/
│ │ ├── favicon.ico
│ │ ├── globals.css
│ │ ├── layout.tsx
│ │ ├── page.jsx
│ │ ├── page.module.css
│ │ └── api/
│ │ └── feedback/route.js
│ ├── components/
│ │ ├── Widget.jsx
│ │ └── ui/
│ │ ├── button.jsx, button.tsx
│ │ ├── card.tsx
│ │ ├── input.jsx, input.tsx
│ │ ├── label.jsx, label.tsx
│ │ ├── popover.jsx, popover.tsx
│ │ ├── separator.jsx
│ │ ├── textarea.jsx, textarea.tsx
│ └── lib/
│ ├── prisma.js
│ ├── utils.js, utils.tsgit clone <your-repo-url>
cd feedback-widget-nextnpm install
# or
yarn install
# or
pnpm install
# or
bun installCreate a .env file in the root directory and add the following (example for MongoDB):
DATABASE_URL="mongodb+srv://USER:PASSWORD@CLUSTER.mongodb.net/DATABASE?retryWrites=true&w=majority"- Edit your Prisma schema (
prisma/schema.prisma) as needed. - Push your schema to the database:
npx prisma generate
npx prisma db pushnpm run dev
# or
yarn dev
# or
pnpm dev
# or
bun devVisit http://localhost:3000 in your browser.
npm run build:widgetThis will output widget.umd.js in the public/ directory, ready for embedding.
You can embed the feedback widget into any HTML page (including other projects) with just a few lines:
<!-- Load React and ReactDOM UMD builds for the widget -->
<script src="https://unpkg.com/react@18/umd/react.production.min.js"></script>
<script src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"></script>
<!-- Include the widget script from your Vercel deployment -->
<script src="https://widget-feedback-next.vercel.app/widget.umd.js"></script>
<my-widget
api-base="https://widget-feedback-next.vercel.app/api/feedback"
></my-widget>- The
api-baseattribute should point to your deployed Next.js API endpoint. - The widget will automatically inject its styles and handle feedback submission.
To integrate into your own project:
- Deploy this project to Vercel.
- Copy the script and
<my-widget>tag above into your HTML. - Optionally, style or position the widget as needed.
- Add new UI components in
src/components/ui/. - Update database schema in
prisma/schema.prismaand runnpx prisma db push. - Customize Tailwind in
tailwind.config.js. - Utility functions in
src/lib/utils.jsandsrc/lib/utils.ts.
- ESLint: See
eslint.config.mjsfor linting rules. Example:
import { dirname } from "path";
import { fileURLToPath } from "url";
import { FlatCompat } from "@eslint/eslintrc";
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
});
const eslintConfig = [
...compat.extends("next/core-web-vitals", "next/typescript"),
];
export default eslintConfig;- Tailwind CSS: See
tailwind.config.jsfor theme and content settings. Example:
module.exports = {
darkMode: ["class"],
content: [
"./pages/**/*.{js,jsx}",
"./components/**/*.{js,jsx}",
"./app/**/*.{js,jsx}",
"./src/**/*.{js,jsx}",
],
theme: {
extend: {
// ...custom colors, borderRadius, keyframes, etc.
},
},
plugins: [require("tailwindcss-animate")],
};This project is ready for adding React tests. To add tests:
-
Install a test runner (e.g., Jest, React Testing Library):
npm install --save-dev jest @testing-library/react @testing-library/jest-dom
-
Add test files alongside your components, e.g.,
Widget.test.jsx. -
Run tests with:
npm test # or yarn test
-
For more, see React Testing Library Docs.
widget, reactjs, feedback, mongodb, feedback-form, widget-manager, tailwindcss, feedback-collector, feedback-widget, easy-integration, nextjs, prisma, fullstack, typescript, component-library, api, vercel, modern-web, boilerplate, teaching, example
- Next.js Documentation
- Learn Next.js
- Next.js GitHub Repository
- Prisma Documentation
- Tailwind CSS Documentation
- React Testing Library
This project is designed as a teaching and demonstration tool for modern React, Next.js, and TailwindCSS workflows, with a focus on real-world integration patterns and best practices. It is ideal for learning, rapid prototyping, and production use.
Feedback Widget Next provides a robust starting point for building embeddable widgets and APIs for modern web projects. The modular approach allows for easy integration and extension, making it ideal for both learning and production use.
If you have questions or want to contribute, feel free to open an issue or pull request!


