Skip to content

A modern, feature-rich feedback management platform built with Next.js 15, designed to collect, organize, and discuss user feedback in an aesthetically pleasing mint-green themed interface.

Notifications You must be signed in to change notification settings

sgfrdgrln/FeedbackHub

Repository files navigation

🎯 FeedbackHub

A modern, feature-rich feedback management platform built with Next.js 15, designed to collect, organize, and discuss user feedback in an aesthetically pleasing mint-green themed interface.

Next.js React TypeScript MongoDB

✨ Features

🎨 Beautiful Design

  • Two-toned aesthetic with mint green and white color scheme
  • Dark mode support with seamless theme switching using next-themes
  • Fully responsive with mobile-friendly burger menu navigation
  • Smooth animations on landing page and interactive elements
  • CSS variables for consistent theming across all components

πŸ” Authentication & Authorization

  • GitHub OAuth integration via NextAuth.js
  • Session management with secure user authentication
  • Protected routes for creating feedback and posting comments
  • User profile dropdown with theme toggle and sign-out option
  • Avatar support with fallback initials for users without profile images

πŸ“ Feedback Management

  • Create, read, and upvote feedback posts
  • Status tracking (Pending, In Progress, Completed, Rejected)
  • Category organization for better feedback classification
  • Advanced filtering by status (all, pending, in-progress, completed)
  • Sorting options by popularity (upvotes) or recency (date)
  • Persistent upvotes stored in localStorage to prevent duplicate votes
  • Modal-based interaction - view feedback details without page navigation

πŸ’¬ Discussion System

  • Comment threads on each feedback post
  • Real-time comment loading via API endpoints
  • Author attribution with profile images
  • Timestamp tracking for all comments
  • Authentication check - only signed-in users can comment
  • Embedded comments in MongoDB for efficient data retrieval

πŸ“Š Analytics

  • Visitor tracking system with persistent count
  • Real-time visitor statistics displayed on landing page
  • MongoDB-based storage for accurate metrics

πŸ€– AI Chatbot

  • Gemini Flash 2.0 powered intelligent assistant
  • Context-aware responses about platform features
  • Conversation history for natural dialogue flow
  • Quick question suggestions for common queries
  • Always accessible floating chat button on all pages
  • Real-time responses with typing indicators
  • Built-in rate limiting (10 messages/min) to protect API usage
  • Beautiful UI matching the mint-green theme

🎭 User Experience

  • Skeleton loading states for smooth content transitions
  • Custom dialogs for authentication prompts
  • Empty state designs with call-to-action buttons
  • Hover effects and smooth transitions throughout
  • Optimized images with Next.js Image component

πŸš€ Getting Started

Prerequisites

  • Node.js 18.x or higher
  • MongoDB database (local or Atlas)
  • GitHub OAuth App credentials

Installation

  1. Clone the repository
git clone <your-repo-url>
cd feedback-board
  1. Install dependencies
npm install
  1. Set up environment variables

Create a .env.local file in the root directory:

# MongoDB Connection
MONGODB_URI=your_mongodb_connection_string

# NextAuth Configuration
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your_nextauth_secret_key

# GitHub OAuth
GITHUB_ID=your_github_oauth_app_id
GITHUB_SECRET=your_github_oauth_app_secret

# Gemini AI (for Chatbot)
GEMINI_API_KEY=your_gemini_api_key

Note: Get your Gemini API key from Google AI Studio

  1. Run the development server
npm run dev
  1. Open your browser

Navigate to http://localhost:3000

πŸ—οΈ Project Structure

feedback-board/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ api/
β”‚   β”‚   β”œβ”€β”€ auth/[...nextauth]/    # NextAuth configuration
β”‚   β”‚   β”œβ”€β”€ feedback/              # Feedback CRUD endpoints
β”‚   β”‚   β”‚   └── [id]/
β”‚   β”‚   β”‚       └── comments/      # Comment endpoints
β”‚   β”‚   β”œβ”€β”€ visitors/              # Visitor tracking
β”‚   β”‚   └── chatbot/               # Gemini AI chatbot endpoint
β”‚   β”œβ”€β”€ feedback/
β”‚   β”‚   β”œβ”€β”€ page.tsx               # Feedback list page
β”‚   β”‚   β”œβ”€β”€ new/                   # Create feedback form
β”‚   β”‚   └── [id]/                  # Feedback detail pages
β”‚   β”œβ”€β”€ login/                     # Login page
β”‚   β”œβ”€β”€ layout.tsx                 # Root layout with providers
β”‚   β”œβ”€β”€ page.tsx                   # Landing page
β”‚   └── globals.css                # Global styles & CSS variables
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ FeedbackCard.tsx           # Feedback card component
β”‚   β”œβ”€β”€ FeedbackModal.tsx          # Modal for feedback details
β”‚   β”œβ”€β”€ FeedbackForm.tsx           # Create/edit feedback form
β”‚   β”œβ”€β”€ CommentList.tsx            # Comment display component
β”‚   β”œβ”€β”€ Chatbot.tsx                # AI chatbot component
β”‚   β”œβ”€β”€ Navbar.tsx                 # Navigation with auth
β”‚   β”œβ”€β”€ ThemeToggle.tsx            # Dark mode toggle
β”‚   β”œβ”€β”€ SubmitDialog.tsx           # Auth-aware submission dialog
β”‚   └── FeedbackSkeleton.tsx       # Loading skeleton
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ models/
β”‚   β”‚   β”œβ”€β”€ Feedback.ts            # Feedback schema with comments
β”‚   β”‚   β”œβ”€β”€ User.ts                # User authentication schema
β”‚   β”‚   └── Visitor.ts             # Visitor tracking schema
β”‚   β”œβ”€β”€ types/
β”‚   β”‚   └── IFeedback.ts           # TypeScript interfaces
β”‚   └── lib/
β”‚       └── mongodb.ts             # Database connection
β”œβ”€β”€ hooks/
β”‚   β”œβ”€β”€ useFeedback.ts             # Fetch feedback data
β”‚   └── useVisitors.ts             # Track visitor count
└── types/
    └── next-auth.d.ts             # NextAuth type definitions

πŸ› οΈ Tech Stack

Frontend

  • Next.js 15.5.6 - React framework with App Router
  • React 18.3.1 - UI library
  • TypeScript - Type safety
  • Tailwind CSS 4 - Utility-first styling
  • next-themes - Theme management

Backend

  • Next.js API Routes - RESTful endpoints
  • MongoDB - NoSQL database
  • Mongoose 8.19.2 - ODM for MongoDB

Authentication

  • NextAuth.js 4.24.11 - Authentication solution
  • GitHub OAuth - OAuth provider

AI & Machine Learning

  • Google Generative AI - Gemini Flash 2.0 for chatbot
  • Context-aware AI - Intelligent conversation handling

Form Handling

  • react-hook-form - Form state management
  • zod - Schema validation
  • @hookform/resolvers - Validation resolvers

πŸ“‘ API Endpoints

Feedback

  • GET /api/feedback - Fetch all feedback
  • POST /api/feedback - Create new feedback
  • PATCH /api/feedback/[id] - Update feedback (upvote)

Comments

  • GET /api/feedback/[id]/comments - Get comments for feedback
  • POST /api/feedback/[id]/comments - Add new comment

Visitors

  • GET /api/visitors - Get total visitor count
  • POST /api/visitors - Track new visitor

Chatbot

  • POST /api/chatbot - Send message to AI chatbot
    • Request body: { message: string, conversationHistory: array }
    • Response: { message: string, success: boolean }

Authentication

  • GET/POST /api/auth/[...nextauth] - NextAuth endpoints

🎨 Theming

FeedbackHub uses CSS variables for consistent theming:

/* Light Mode */
--background: white
--foreground: #1a1a1a
--mint-primary: #6ee7b7
--mint-light: #d1fae5
--mint-accent: #34d399
--mint-dark: #10b981

/* Dark Mode */
--background: #1a1a1a
--foreground: #f5f5f5
--mint-primary: #34d399
--mint-light: rgba(52, 211, 153, 0.1)
--mint-accent: #10b981
--mint-dark: #059669

πŸ”’ Authentication Flow

  1. User clicks "Sign in with GitHub"
  2. Redirected to GitHub OAuth
  3. After authorization, user data stored in session
  4. Session persists across page navigations
  5. Protected actions check session status
  6. User can sign out via profile dropdown

πŸ’‘ Key Features Explained

Modal-Based Feedback View

Instead of navigating to a separate page, clicking a feedback card opens a modal overlay that:

  • Shows full feedback details
  • Displays all comments in a threaded view
  • Allows authenticated users to post comments
  • Maintains context by staying on the same page

Upvote System

  • Each user can upvote once per feedback item
  • Upvote state persisted in localStorage
  • Optimistic UI updates with loading states
  • Server-side validation and count updates

Visitor Tracking

  • Tracks unique page visits
  • Stored in MongoDB for persistence
  • Displayed on landing page with formatted count
  • Fallback to default count on error

🚒 Deployment

Vercel (Recommended)

  1. Push your code to GitHub
  2. Import project in Vercel
  3. Add environment variables
  4. Deploy

Environment Variables for Production

Ensure all environment variables are set in your deployment platform:

  • MONGODB_URI
  • NEXTAUTH_URL (your production URL)
  • NEXTAUTH_SECRET
  • GITHUB_ID
  • GITHUB_SECRET

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“ License

This project is open source and available under the MIT License.

πŸ™ Acknowledgments


Made with ❀️ and β˜• by sgfrdgrln

About

A modern, feature-rich feedback management platform built with Next.js 15, designed to collect, organize, and discuss user feedback in an aesthetically pleasing mint-green themed interface.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published