Skip to content

PankajKumardev/feedwall

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

80 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Feed-Wall

A modern feedback collection tool that allows users to create projects and collect valuable feedback from their customers through an embeddable widget.

Features

  • πŸ” Authentication: Secure login with email/password and Google OAuth
  • πŸ“Š Project Management: Create and manage multiple projects
  • πŸ’¬ Feedback Collection: Embeddable widget for collecting customer feedback
  • πŸ€– AI-Powered Insights: Generate AI summaries of feedback using Google's Gemini
  • πŸ“ˆ Analytics: View, search, and export feedback data
  • 🎨 Modern UI: Clean, responsive design with dark mode support
  • ⚑ Rate Limiting: Built-in protection against abuse

Tech Stack

  • Frontend: Next.js 15, React 18, TypeScript
  • Styling: Tailwind CSS, Radix UI components
  • Authentication: NextAuth.js
  • Database: PostgreSQL with Prisma ORM
  • AI: Google Generative AI (Gemini)
  • Deployment: Vercel-ready

Getting Started

Prerequisites

  • Node.js 18+
  • PostgreSQL database
  • Google OAuth credentials (optional)
  • Google AI API key

Installation

  1. Clone the repository

    git clone <repository-url>
    cd feedwall
  2. Install dependencies

    npm install
  3. Set up environment variables Create a .env.local file in the root directory:

    # Database
    DATABASE_URL="postgresql://username:password@localhost:5432/feedwall"
    
    # NextAuth
    NEXTAUTH_SECRET="your-secret-key"
    NEXTAUTH_URL="http://localhost:3000"
    
    # Google OAuth (optional)
    GOOGLE_ID="your-google-client-id"
    GOOGLE_SECRET="your-google-client-secret"
    
    # Google AI
    GOOGLE_API_KEY="your-google-ai-api-key"
  4. Set up the database

    npx prisma migrate deploy
    npx prisma generate
  5. Run the development server

    npm run dev
  6. Open your browser Navigate to http://localhost:3000

Project Structure

feedwall/
β”œβ”€β”€ app/                    # Next.js app directory
β”‚   β”œβ”€β”€ actions/           # Server actions
β”‚   β”‚   β”œβ”€β”€ Ai.ts         # AI summary functionality
β”‚   β”‚   β”œβ”€β”€ createProject.ts
β”‚   β”‚   β”œβ”€β”€ deleteFeedback.ts
β”‚   β”‚   β”œβ”€β”€ deleteProject.ts
β”‚   β”‚   β”œβ”€β”€ getFeedback.ts
β”‚   β”‚   └── getProject.ts
β”‚   β”œβ”€β”€ api/              # API routes
β”‚   β”‚   β”œβ”€β”€ auth/         # Authentication endpoints
β”‚   β”‚   β”œβ”€β”€ feedback/     # Feedback submission
β”‚   β”‚   └── user/         # User data
β”‚   β”œβ”€β”€ docs/             # Documentation pages
β”‚   β”œβ”€β”€ feedbacks/        # Feedback management
β”‚   β”œβ”€β”€ projects/         # Project management
β”‚   └── signin/           # Authentication pages
β”œβ”€β”€ components/           # React components
β”‚   β”œβ”€β”€ ui/              # Reusable UI components
β”‚   └── ...              # Feature components
β”œβ”€β”€ lib/                 # Utility libraries
β”‚   β”œβ”€β”€ auth.ts         # Authentication configuration
β”‚   β”œβ”€β”€ db.ts           # Database connection
β”‚   β”œβ”€β”€ rate-limit.ts   # Rate limiting utility
β”‚   └── utils.ts        # General utilities
β”œβ”€β”€ prisma/             # Database schema and migrations
└── middleware.ts       # Next.js middleware

Rate Limiting

The application includes built-in rate limiting to prevent abuse:

  • Feedback Submission: 20 requests per minute per IP
  • Authentication: 30 requests per minute per IP
  • AI Summaries: 10 requests per hour per user
  • Project Creation: 15 requests per hour per user

Rate limits are enforced at the middleware level for API routes and in server actions for user-specific operations.

API Documentation

Authentication

POST /api/auth/signin

Sign in with email/password or Google OAuth.

Rate Limit: 10 requests/minute per IP

Feedback

POST /api/feedback

Submit feedback for a project.

Request Body:

{
  "name": "string",
  "email": "string",
  "feedback": "string",
  "rating": 1-5,
  "projectid": number
}

Rate Limit: 5 requests/minute per IP

User

GET /api/user

Get current user information.

Rate Limit: 10 requests/minute per IP

Widget Integration

HTML Integration

<body>
  <script src="https://cdn.tailwindcss.com"></script>
  <script>
    tailwind.config = { darkMode: 'class' };
  </script>
  <script
    type="module"
    src="https://your-domain.com/feedback-widget.js"
  ></script>
  <feedback-widget projectId="123" websiteName="Your Site"></feedback-widget>
</body>

React Integration

import { useEffect } from 'react';

function FeedbackWidget() {
  useEffect(() => {
    const script = document.createElement('script');
    script.src = 'https://your-domain.com/feedback-widget.js';
    script.type = 'module';
    document.body.appendChild(script);
  }, []);

  return <feedback-widget projectId="123" websiteName="Your Site" />;
}

Database Schema

Users

  • id: Primary key
  • email: Unique email address
  • password: Hashed password (for email auth)

Projects

  • id: Primary key
  • name: Project name
  • description: Project description
  • url: Project URL
  • userId: Foreign key to Users
  • createdAt: Creation timestamp

Feedback

  • id: Primary key
  • name: Submitter name
  • email: Submitter email
  • rating: 1-5 star rating
  • feedback: Feedback text
  • projectid: Foreign key to Projects
  • createdAt: Submission timestamp

Deployment

Vercel (Recommended)

  1. Connect your repository to Vercel
  2. Set environment variables in the Vercel dashboard
  3. Deploy - Vercel will automatically build and deploy

Other Platforms

  1. Build the application:

    npm run build
  2. Start the production server:

    npm start
  3. Set up your database and configure environment variables

Environment Variables

Variable Description Required
DATABASE_URL PostgreSQL connection string Yes
NEXTAUTH_SECRET Secret for JWT signing Yes
NEXTAUTH_URL Application URL Yes
GOOGLE_ID Google OAuth client ID No
GOOGLE_SECRET Google OAuth client secret No
GOOGLE_API_KEY Google AI API key Yes

Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature-name
  3. Commit your changes: git commit -m 'Add feature'
  4. Push to the branch: git push origin feature-name
  5. Submit a pull request

Security

  • Rate limiting prevents abuse
  • Input validation with Zod schemas
  • Secure password hashing with bcrypt
  • CORS headers properly configured
  • Environment variables for sensitive data

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

For support, email support@feedwall.com or create an issue in the repository.

About

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages